-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient_attack.py
More file actions
24 lines (19 loc) · 807 Bytes
/
Copy pathclient_attack.py
File metadata and controls
24 lines (19 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import paramiko
def malware_command(ip,port,user,passwd,cmd):
target = paramiko.SSHClient()
target.set_missing_host_key_policy(paramiko.AutoAddPolicy())
target.connect(ip, port=port, username=user,password=passwd)
_, stdout, stderr = target.exec_command(cmd)
output = stdout.readlines() + stderr.readlines()
if output:
print("----The result-----")
for line in output:
print(line.strip())
if __name__ == "__main__":
import getpass
user = input("Please enter your target's username: ")
password = input("Please enter the target's password: ")
ip= input("Please enter your target's IP address: ")
port = input("Please specify the port: ")
cmd = input("Please enter the command: ")
malware_command(ip,port,user,password,cmd)