Skip to main content

backdoor in Python

##Backdoor based on TCP server and client with python

Server side code : 'server.py'


"server.py is the code which will be running on the attacker's machine"

##required libraries
## create socket object
## generate_socket_and_listen method is to generate socket (i.e. bind an ip address with the port number) and listen for the incoming connections
## once the victim opens the executable in his/her machine ,and the socket recieved the incoming connection ,then shell method will be executed . since we have the shell from the victims machine we can do anything like perform any os command ,or execute manually written commands like get ,download ,start ,upload
"download -> download files from victim's machine"
"upload -> upload files to victim's machine"
"get -> download files from the internet to victim's machine"
"start-> start other applications on victim's machine"
## we will use the json to communicate over sockets while both recieving data from victim's machine or sending commands/files to victims machine


Client side code : 'reverse_shell.py'


"reverse_shell.py is the code which will be running on the victim's machine"

## Required libraries
## create socket object
## This part of the code is should be uncommented if victim has window's machine ,code in this snippet will create registry and after every reload/reboot of the system ,this will autmoatically be invoked and start running /br> connect_back method will try to connect to the after every 20 seconds in case client is not able to reach the server at attacker's machine
download method will help attacker to download the files from the internet in the victim's machine
## we will use the json to communicate over sockets while both recieving data from victim's machine or sending commands/files to victims machine
## shell method at client side is different from what we have in our above server.py file ,once attacker will trigger a command to be executed in the vcitim's machine then this shell method will come into the picture and the command send by the attacker will go through the if else and will be executed accordingly
## start the execution of the code

**NOTE : revershell.py can be given/tricked to the victim in form of executable or image or audio file.
you can find the whole code this git repository link : backdoor_code



Checkout some more hacking scripts


SECURING SYSTEM BLUETOOTH ATTACKS STEALING AND SNIFFING ATTACKS KALI LINUX HACKING COMMANDS CHEATSHEET TROJAN AND BACKDOORS DICTIONARY AND BURTEFORCING ATTACKS MAN IN THE MIDDLE ATTACKS
1. Sign & Verify message 1. Bluetooth discovery 1. Stealing saved wifi password from windows 1. Hacking commands with Kali Linux 1. Command and Control Trojan 1. Dictionary Attack 1. Man in Browser Attack
2. SandBox Detection 2. Bluetooth SDP browsing 2. Sniffing packets 2. Reverse shell in python
3. TCP Proxy 3. Bluetooth OBEX 3. Email Credential sniffers 3. Keylogger
4. Bluetooth RCOMM channel scanner 4. Screenshot with Python
5. Blue Bug Exploit 5. Backdoor with Python
6. Blue Snarf Exploit
7. Bluetooth spoofing
8. Bluetooth sniffing