首页 / PYTHON / 弱口令扫描.python脚本
弱口令扫描.python脚本
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了弱口令扫描.python脚本,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1697字,纯文字阅读大概需要3分钟。
内容图文
![弱口令扫描.python脚本](/upload/InfoBanner/zyjiaocheng/617/5d475d9427b54f129d4cc5005827ed46.jpg)
手把手教你打造自己的弱口令扫描工具(系统弱口令篇)
?前言
在渗透测试过程中,弱口令检测是必要的一个环节,选择一个好用的弱口令扫描工具,尤为重要。
类似的弱口令检测工具如:Hydra、Hscan、X-Scan,很多时候满足不了自己的需求。
通过Python打造自己的弱口令扫描工具,集成在一起的Python脚本,在实战应用中,更切合实际。
FTP模块
FTP一般分为两种情况,匿名访问和弱口令,分别编写:
import ftplib def ftp_anonymous(ip,port): try: ftp = ftplib.FTP() ftp.connect(ip,port,2) ftp.login() ftp.quit() print '[+] FTP login for anonymous' except: print '[-] checking for FTP anonymous fail' def ftp_login(ip,port,user,pwd): try: ftp = ftplib.FTP() ftp.connect(ip,port,2) ftp.login(user,pwd) ftp.quit() print '[+] FTP weak password: '+user,pwd except: print '[-] checking for '+user,pwd+' fail'
SSH模块
import paramiko def ssh_login(ip,port,user,pwd): try: ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(ip,port,user,pwd,timeout=5) print '[+] SSH weak password: '+user,pwd ssh.close() except: print '[-] checking for '+user,pwd+' fail'
Telnet模块
import telnetlib def telnet(ip,port=23): try: tn = telnetlib.Telnet(ip,timeout=5) tn.set_debuglevel(0) tn.read_until("login: ") tn.write(user + '\r\n') tn.read_until("assword: ") tn.write(pwd + '\r\n') result = tn.read_some() result = result+tn.read_some() if result.find('Login Fail')>0 or result.find('incorrect')>0: print "[-] Checking for "+user,pwd+" fail" else: print "[+] Success login for "+user,pwd tn.close() except: print '[-] Something Error'+username,password+" fail"
ipc$模块
from impacket import smb def smb_login(ip,port,user,pwd): try: client = smb.SMB('*SMBSERVER',ip) client.login(user,pwd) flag ='[+] IPC$ weak password: '+user,pwd except: print '[-] checking for '+user,pwd+' fail'
内容总结
以上是互联网集市为您收集整理的弱口令扫描.python脚本全部内容,希望文章能够帮你解决弱口令扫描.python脚本所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。