@@ -23,6 +23,8 @@ class WordPress
23
23
24
24
public $ torForGuzzle ;
25
25
26
+ public $ commandData ;
27
+
26
28
/**
27
29
* @param string $proxy
28
30
*/
@@ -56,6 +58,25 @@ public function __construct($commands=array())
56
58
$ this ->optionTor = array ();
57
59
$ this ->installPlugin ();
58
60
$ 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 ;
59
80
}
60
81
61
82
public function setTarget ($ target ){
@@ -90,7 +111,7 @@ public function getBaseUrlWordPressByUrl()
90
111
try {
91
112
$ client = new Client (['defaults ' => [
92
113
'headers ' => ['User-Agent ' => $ header ->getUserAgent ()],
93
- 'proxy ' => $ this ->torForGuzzle ,
114
+ 'proxy ' => $ this ->commandData [ ' tor ' ] ,
94
115
'timeout ' => 30 ,
95
116
],
96
117
]);
@@ -123,7 +144,7 @@ public function getBaseUrlWordPressCrawler()
123
144
try {
124
145
$ client = new Client (['defaults ' => [
125
146
'headers ' => ['User-Agent ' => $ header ->getUserAgent ()],
126
- 'proxy ' => $ this ->torForGuzzle ,
147
+ 'proxy ' => $ this ->commandData [ ' tor ' ] ,
127
148
'timeout ' => 30 ,
128
149
],
129
150
]);
@@ -199,7 +220,7 @@ public function getUsers($limitNumberUsers = 99999)
199
220
try {
200
221
$ client = new Client (['defaults ' => [
201
222
'headers ' => ['User-Agent ' => $ header ->getUserAgent ()],
202
- 'proxy ' => $ this ->torForGuzzle ,
223
+ 'proxy ' => $ this ->commandData [ ' tor ' ] ,
203
224
'timeout ' => 30 ,
204
225
],
205
226
]);
@@ -294,7 +315,7 @@ public function getPluginsVull()
294
315
try {
295
316
$ arrPluginsVull = array ();
296
317
$ client = new Client ();
297
- $ res = $ client ->get ($ this ->target , $ this ->optionTor );
318
+ $ res = $ client ->get ($ this ->target , $ this ->commandData [ ' tor ' ] );
298
319
//check if is block
299
320
$ body = $ res ->getBody ()->getContents ();
300
321
$ crawler = new Crawler ($ body );
@@ -352,7 +373,7 @@ private function checkPluginExpert($plugin)
352
373
try {
353
374
$ url = $ this ->target .'/wp-content/plugins/ ' .$ plugin ;
354
375
$ client = new Client ();
355
- $ res = $ client ->get ($ url , $ this ->optionTor );
376
+ $ res = $ client ->get ($ url , $ this ->commandData [ ' tor ' ] );
356
377
//check if change new tor ip
357
378
$ status = $ res ->getStatusCode ();
358
379
if (!$ status == 200 ) {
0 commit comments