日本综合一区二区|亚洲中文天堂综合|日韩欧美自拍一区|男女精品天堂一区|欧美自拍第6页亚洲成人精品一区|亚洲黄色天堂一区二区成人|超碰91偷拍第一页|日韩av夜夜嗨中文字幕|久久蜜综合视频官网|精美人妻一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
打造自己的弱口令掃描工具

本文轉(zhuǎn)載自微信公眾號(hào)「 Bypass」,作者 Bypass。轉(zhuǎn)載本文請(qǐng)聯(lián)系 Bypass公眾號(hào)。

創(chuàng)新互聯(lián)提供網(wǎng)站設(shè)計(jì)、成都網(wǎng)站設(shè)計(jì)、網(wǎng)頁(yè)設(shè)計(jì),成都品牌網(wǎng)站建設(shè),1元廣告等致力于企業(yè)網(wǎng)站建設(shè)與公司網(wǎng)站制作,十年的網(wǎng)站開發(fā)和建站經(jīng)驗(yàn),助力企業(yè)信息化建設(shè),成功案例突破上千家,是您實(shí)現(xiàn)網(wǎng)站建設(shè)的好選擇.

在內(nèi)網(wǎng)檢測(cè)中,弱口令掃描是必不可少的環(huán)節(jié),選擇一個(gè)好用的弱口令掃描工具,尤為重要。

我曾寫過(guò)一款弱口令檢測(cè)工具,經(jīng)常有童鞋在后臺(tái)詢問(wèn)關(guān)于iscan源代碼的事情,但其實(shí)通過(guò)Python打造自己的弱口令掃描工具是一件非常簡(jiǎn)單的事情,無(wú)非就是將多個(gè)Python掃描腳本集成在一起。

今天,分享一些常見的端口服務(wù)掃描腳本,可根據(jù)自己的需求來(lái)改寫腳本,打造一款屬于自己的弱口令檢測(cè)工具,然后在實(shí)戰(zhàn)中應(yīng)用,不是挺有意思的嗎。

1、RDP 掃描模塊

RDP協(xié)議相對(duì)復(fù)雜,想要使用Python實(shí)現(xiàn)RDP暴力破解,一直沒(méi)找到比較簡(jiǎn)單實(shí)現(xiàn)的方式。后來(lái),我在impacket 示例文件下找到了rdp_check.py,這個(gè)腳本可用于測(cè)試目標(biāo)主機(jī)上的帳戶是否有效。那么,通過(guò)它來(lái)改寫Pyhton掃描腳本,就變得很簡(jiǎn)單。

demo代碼有點(diǎn)長(zhǎng),這里就不貼了,演示截圖如下:

具體參考代碼:

 
 
 
 
  1. https://github.com/SecureAuthCorp/impacket/blob/master/examples/rdp_check.py 

2、SMB 掃描模塊

用于檢測(cè)共享文件夾和smb弱口令。

 
 
 
 
  1. from impacket import smb 
  2. def smb_login(ip,port,user,pwd): 
  3.     try: 
  4.         client = smb.SMB('*SMBSERVER',ip) 
  5.         client.login(user,pwd) 
  6.         flag ='[+] IPC$ weak password: '+user,pwd 
  7.     except: 
  8.         print '[-] checking for '+user,pwd+' fail' 

3、FTP 掃描模塊

用于檢測(cè)FTP匿名訪問(wèn)和弱口令。

 
 
 
 
  1. import ftplib 
  2. def ftp_anonymous(ip,port): 
  3.     try: 
  4.         ftp = ftplib.FTP() 
  5.         ftp.connect(ip,port,2) 
  6.         ftp.login() 
  7.         ftp.quit() 
  8.         print '[+] FTP login for anonymous' 
  9.     except: 
  10.         print '[-] checking for FTP anonymous fail' 
  11. def ftp_login(ip,port,user,pwd): 
  12.     try: 
  13.         ftp = ftplib.FTP() 
  14.         ftp.connect(ip,port,2) 
  15.         ftp.login(user,pwd) 
  16.         ftp.quit() 
  17.         print '[+] FTP weak password: '+user,pwd 
  18.     except: 
  19.         print '[-] checking for '+user,pwd+' fail' 

4、SSH 掃描模塊

用于檢測(cè)SSH弱口令。

 
 
 
 
  1. import paramiko 
  2. def ssh_login(ip,port,user,pwd): 
  3.     try: 
  4.         ssh = paramiko.SSHClient() 
  5.         ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) 
  6.         ssh.connect(ip,port,user,pwd,timeout=5) 
  7.         print '[+] SSH weak password: '+user,pwd 
  8.         ssh.close() 
  9.     except: 
  10.         print '[-] checking for '+user,pwd+' fail' 

5、Telnet 掃描模塊

模擬Telnet 登錄驗(yàn)證過(guò)程,用于telnet弱口令的檢測(cè)。

 
 
 
 
  1. import telnetlib 
  2. def telnet(ip,port,user,pwd): 
  3.   try: 
  4.     tn = telnetlib.Telnet(ip,timeout=5) 
  5.     tn.set_debuglevel(0) 
  6.     tn.read_until("login: ") 
  7.     tn.write(user + '\r\n') 
  8.     tn.read_until("assword: ") 
  9.     tn.write(pwd + '\r\n') 
  10.     result = tn.read_some() 
  11.     result = result+tn.read_some() 
  12.     if result.find('Login Fail')>0 or result.find('incorrect')>0: 
  13.        print "[-] Checking for "+user,pwd+" fail" 
  14.     else: 
  15.       print "[+] Success login for "+user,pwd 
  16.     tn.close() 

6、MySQL 掃描模塊

用于檢測(cè)MySQL弱口令。

 
 
 
 
  1. import MySQLdb 
  2. def Mysql_login(ip,port,user,pwd): 
  3.     try: 
  4.         db = MySQLdb.connect(host=ip, user=user, passwd=pwd,port=port) 
  5.         print '[+] Mysql weak password: '+user,pwd 
  6.         db.close() 
  7.     except: 
  8.         print '[-] checking for '+user,pwd+' fail' 

7、MSsql 掃描模塊

用于檢測(cè)MSSQL弱口令。

 
 
 
 
  1. import pymssql 
  2. def mssql_login(ip,port,user,pwd): 
  3.     try: 
  4.         db = pymssql.connect(host=ip,user=user,password=pwd,port=port) 
  5.         print '[+] MSsql weak password: '+user,pwd 
  6.         db.close() 
  7.     except: 
  8.         #pass 
  9.         print '[-] checking for '+user,pwd+' fail' 

8、MongoDB 模塊

用于檢測(cè)MongoDB 匿名登錄和弱口令。

 
 
 
 
  1. from pymongo import MongoClient 
  2. def mongodb(ip,port=27017):     
  3.     try: 
  4.         client = MongoClient(ip,port) 
  5.         db=client.local 
  6.         flag = db.collection_names() 
  7.         if flag:     
  8.             print "[+] Mongodb login for anonymous" 
  9.     except Exception, e: 
  10.         pass 
  11.  
  12. def mongodb_login(ip,port,user,pwd): 
  13.     try: 
  14.         client = MongoClient(ip,port) 
  15.         db_auth = client.admin 
  16.         flag = db_auth.authenticate(user, pwd) 
  17.         if flag == True: 
  18.             print '[+] Mongodb weak password: '+user,pwd 
  19.     except: 
  20.         print '[-] checking for '+user,pwd+' fail' 

9、phpmyadmin 掃描模塊

模擬http請(qǐng)求,檢測(cè)phpmyadmin弱口令。

 
 
 
 
  1. import requests 
  2. def phpMyAdmin_login(ip,port,user,pwd): 
  3.     try: 
  4.         url = "http://"+ip+":"+str(port)+"/phpmyadmin/index.php" 
  5.         data={'pma_username':user,'pma_password':pwd} 
  6.         response = requests.post(url,data=data,timeout=5) 
  7.         result=response.content 
  8.  
  9.         if result.find('name="login_form"')==-1: 
  10.             print '[+] find phpMyAdmin weak password in:'+url 
  11.             print '[+] find phpMyAdmin weak password:'+user,pwd 
  12.         else: 
  13.             print '[-] Checking for '+user,pwd+" fail" 
  14.             time.sleep(2) 
  15.     except: 
  16.             print '[-] Something Error'+user,pwd+" fail" 

10、Tomcat 掃描模塊

模擬http請(qǐng)求,檢測(cè)tomcat控制臺(tái)弱口令。

 
 
 
 
  1. import requests 
  2. def tomcat_login(ip,port,user,pwd): 
  3.     try:         
  4.         url = "http://"+ip+":"+str(port)+"/manager/html" 
  5.         user_agent = "Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)"   
  6.         Authorization = "Basic %s" % (base64.b64encode(user+':'+pwd)) 
  7.         header = { 'User-Agent' : user_agent , 'Authorization':Authorization}  
  8.         request = urllib2.Request(url,headers=header) 
  9.         response = urllib2.urlopen(request,timeout=5) 
  10.         result=response.read() 
  11.         if response.code ==200: 
  12.             print '[Success] '  + url+' '+user+':'+pwd              
  13.     except: 
  14.         print '[Login failed]' + url+' '+user+':'+pwd 

網(wǎng)站題目:打造自己的弱口令掃描工具
URL標(biāo)題:http://www.dlmjj.cn/article/ccceees.html