Skip to content

Commit b2aa8d6

Browse files
committed
adjuste for btwp
1 parent b294381 commit b2aa8d6

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

src/DefaultSite.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,16 @@ class DefaultSite
1414

1515
public $tor;
1616

17+
public $torl;
18+
1719
public $proxy;
1820

1921
public $bodyTarget;
2022

2123
public $header;
2224

25+
public $commandData;
26+
2327
public function __construct($commandData, $targets)
2428
{
2529
//Check command of entered.
@@ -45,6 +49,7 @@ private function defaultEnterData()
4549

4650
public function checkSuccess()
4751
{
52+
4853
$this->header = new FakeHeaders();
4954
$wp = new WordPress();
5055
$wp->setTarget($this->target);
@@ -57,7 +62,7 @@ public function checkSuccess()
5762
$this->bodyTarget = $client->get(
5863
$this->target,
5964
[
60-
'proxy' => $this->proxy,
65+
'proxy' => $this->commandData['tor'],
6166
'headers' => ['User-Agent' => $this->header->getUserAgent()],
6267
'timeout' => 30,
6368
])->getBody()->getContents();
@@ -79,7 +84,7 @@ public function check()
7984
$resultCheck = $this->checkSuccess();
8085
if ($resultCheck) {
8186
echo $this->target;
82-
echo ' is a admin...';
87+
echo ' have a admin...';
8388
$result[] = $this->target;
8489
}
8590
echo "\n";
@@ -196,7 +201,7 @@ private function singleBruteForce($action, $method, $usernameField, $passwordFie
196201
$dataToPost = ['body' => $dataPost];
197202
$client = new Client(['defaults' => [
198203
'headers' => ['User-Agent' => $this->header->getUserAgent()],
199-
'proxy' => $this->proxy,
204+
'proxy' => $this->commandData['tor'],
200205
'timeout' => 30,
201206
],
202207
]);

src/WordPress.php

+26-5
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class WordPress
2323

2424
public $torForGuzzle;
2525

26+
public $commandData;
27+
2628
/**
2729
* @param string $proxy
2830
*/
@@ -56,6 +58,25 @@ public function __construct($commands=array())
5658
$this->optionTor = array();
5759
$this->installPlugin();
5860
$this->torForGuzzle = false;
61+
62+
//Check command of entered.
63+
$defaultEnterData = $this->defaultEnterData();
64+
$this->commandData = array_merge($defaultEnterData, $commands);
65+
if ($this->commandData['torl']) {
66+
$this->commandData['tor'] = $this->commandData['torl'];
67+
}
68+
}
69+
70+
private function defaultEnterData()
71+
{
72+
$dataDefault['dork'] = false;
73+
$dataDefault['pl'] = false;
74+
$dataDefault['tor'] = false;
75+
$dataDefault['torl'] = false;
76+
$dataDefault['virginProxies'] = false;
77+
$dataDefault['proxyOfSites'] = false;
78+
79+
return $dataDefault;
5980
}
6081

6182
public function setTarget($target){
@@ -90,7 +111,7 @@ public function getBaseUrlWordPressByUrl()
90111
try {
91112
$client = new Client(['defaults' => [
92113
'headers' => ['User-Agent' => $header->getUserAgent()],
93-
'proxy' => $this->torForGuzzle,
114+
'proxy' => $this->commandData['tor'],
94115
'timeout' => 30,
95116
],
96117
]);
@@ -123,7 +144,7 @@ public function getBaseUrlWordPressCrawler()
123144
try {
124145
$client = new Client(['defaults' => [
125146
'headers' => ['User-Agent' => $header->getUserAgent()],
126-
'proxy' => $this->torForGuzzle,
147+
'proxy' => $this->commandData['tor'],
127148
'timeout' => 30,
128149
],
129150
]);
@@ -199,7 +220,7 @@ public function getUsers($limitNumberUsers = 99999)
199220
try {
200221
$client = new Client(['defaults' => [
201222
'headers' => ['User-Agent' => $header->getUserAgent()],
202-
'proxy' => $this->torForGuzzle,
223+
'proxy' => $this->commandData['tor'],
203224
'timeout' => 30,
204225
],
205226
]);
@@ -294,7 +315,7 @@ public function getPluginsVull()
294315
try {
295316
$arrPluginsVull = array();
296317
$client = new Client();
297-
$res = $client->get($this->target, $this->optionTor);
318+
$res = $client->get($this->target, $this->commandData['tor']);
298319
//check if is block
299320
$body = $res->getBody()->getContents();
300321
$crawler = new Crawler($body);
@@ -352,7 +373,7 @@ private function checkPluginExpert($plugin)
352373
try {
353374
$url = $this->target.'/wp-content/plugins/'.$plugin;
354375
$client = new Client();
355-
$res = $client->get($url, $this->optionTor);
376+
$res = $client->get($url, $this->commandData['tor']);
356377
//check if change new tor ip
357378
$status = $res->getStatusCode();
358379
if (!$status == 200) {

0 commit comments

Comments
 (0)