-
Notifications
You must be signed in to change notification settings - Fork 33
/
InjectMate.py
1619 lines (1456 loc) · 100 KB
/
InjectMate.py
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
__author__ = 'Jake Miller (@LaconicWolf)'
__date__ = '20190404'
__version__ = '0.02'
__description__ = """\
Burp Extension that generates payloads for
XSS, SQLi, Header injection, and a few other vulns.
"""
from burp import IBurpExtender, ITab
from javax import swing
from javax.swing.filechooser import FileNameExtensionFilter
from java.awt import BorderLayout, GridLayout, Toolkit
from java.awt.datatransfer import StringSelection
from java.awt.datatransfer import Clipboard
from java.util import ArrayList
import string
import random
import threading
import time
import cgi
import urllib
import re
import sys
import os
try:
from exceptions_fix import FixBurpExceptions
except ImportError:
pass
# Set initial configuration. Values correspond with
# checkboxes and default settings
xssTags = {
'script': False,
'button': False,
'video': False,
'details': False,
'math': False,
'audio': False,
'img': False,
'body': False,
'object': False
}
xssEventHandlers = {
'onclick': False,
'onerror': False,
'onkeypress': False,
'onmouseover': False,
'onsubmit': False,
'ondblclick': False,
'onmouseenter': False,
'onscroll': False,
'onwheel': False
}
xssConfig = {
"URL encode special chars": False,
"Replace () with ``": False,
"Toggle case": False,
"Upper case": False,
"HTML encode special chars": False,
"Prepend random chars": False,
"Non-standard percent encoding": False,
"Non-standard slash encoding": False,
"Close tags": False
}
sqliDbmsToTest = {
"MySQL": False,
"Oracle": False,
"PostgreSQL": False,
"Microsoft SQL Server": False,
"Microsoft Access": False,
"IBM DB2": False,
"SQLite": False,
"Firebird": False,
"Sybase": False,
"SAP MaxDB": False,
"HSQLDB": False,
"Informix": False,
}
sqliTechniques = {
"Boolean-based blind": False,
"Error-based": False,
"Time-based blind": False,
"Stacked queries": False
}
sqliConfig = {
"URL encode special chars": False,
"Toggle case": False,
"Lower case": False,
"Non-standard percent encoding": False,
"Non-standard slash encoding": False
}
headersToTest = {
'Authorization': False,
'Connection': False,
'Host': False,
'HTTP2-Settings': False,
'Origin': False,
'Proxy-Authorization': False,
'Referer': False,
'User-Agent': False,
'X-Forwarded-For': False,
'X-Forwarded-Host': False,
'X-Method-Override': False,
'X-Wap-Profile': False
}
headersTests = {
"Random string reflection": False,
"Error Invoking Characters": False,
"Random long strings": False,
"Out-of-band": False,
}
headersConfig = {
"Lower case": False,
"Upper case": False,
"Toggle case": False,
"URL encode special chars": False,
"Non-standard percent encoding": False,
"Non-standard slash encoding": False
}
otherVulnsToTest = {
'NoSQLi': False,
'LDAP Injection': False,
'JavaScript Injection': False,
'General Fuzzing': False,
}
otherVulnsConfig = {
"URL encode special chars": False,
"Replace () with ``": False,
"Toggle case": False,
"Upper case": False,
"HTML encode special chars": False,
"Prepend random chars": False,
"Non-standard percent encoding": False,
"Non-standard slash encoding": False,
"Close tags": False
}
# Interact with Burp. Required
class BurpExtender(IBurpExtender, ITab, swing.JFrame):
def registerExtenderCallbacks(self, callbacks):
# Required for easier debugging:
# https://github.com/securityMB/burp-exceptions
sys.stdout = callbacks.getStdout()
# Keep a reference to our callbacks object
self.callbacks = callbacks
# Set our extension name
self.callbacks.setExtensionName("InjectMate")
# Initialize the collaborator
self.collab = []
# Create the main tab
self.tab = swing.JPanel(BorderLayout())
# Make it have subtabs
tabbedPane = swing.JTabbedPane()
self.tab.add(tabbedPane, BorderLayout.CENTER)
# Subtabs
# First tab ############ START XSS TAB ############
xssTab = swing.JPanel()
xssTab.layout = BorderLayout()
tabbedPane.addTab("XSS", xssTab)
tmpGridPanel = swing.JPanel()
tmpGridPanel.layout = GridLayout(1, 2)
# Top of XSS Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Tags to test")
# First row
tmpPanel.add(swing.JCheckBox("script", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JCheckBox("details", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JCheckBox("img", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JLabel("Custom tag : ", swing.SwingConstants.RIGHT))
self.xssCustomTag1Area = swing.JTextField('', 15)
tmpPanel.add(self.xssCustomTag1Area)
# Second row
tmpPanel.add(swing.JCheckBox("button", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JCheckBox("math", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JCheckBox("body", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JLabel("Custom tag : ", swing.SwingConstants.RIGHT))
self.xssCustomTag2Area = swing.JTextField('', 15)
tmpPanel.add(self.xssCustomTag2Area)
# Third row
tmpPanel.add(swing.JCheckBox("video", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JCheckBox("audio", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JCheckBox("object", False, actionPerformed=self.handleXssTagsSelectCheckBox))
tmpPanel.add(swing.JLabel("Custom tag : ", swing.SwingConstants.RIGHT))
self.xssCustomTag3Area = swing.JTextField('', 15)
tmpPanel.add(self.xssCustomTag3Area)
# Top of XSS Panel
tmpPanel1 = swing.JPanel()
tmpPanel1.layout = GridLayout(3, 5)
tmpPanel1.border = swing.BorderFactory.createTitledBorder("Event Handlers")
# First row
tmpPanel1.add(swing.JCheckBox("onclick", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JCheckBox("onmouseover", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JCheckBox("onmouseenter", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JLabel("Custom handler : ", swing.SwingConstants.RIGHT))
self.xssCustomHandler1Area = swing.JTextField('', 15)
tmpPanel1.add(self.xssCustomHandler1Area)
# Second row
tmpPanel1.add(swing.JCheckBox("onerror", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JCheckBox("onsubmit", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JCheckBox("onscroll", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JLabel("Custom handler : ", swing.SwingConstants.RIGHT))
self.xssCustomHandler2Area = swing.JTextField('', 15)
tmpPanel1.add(self.xssCustomHandler2Area)
# Third row
tmpPanel1.add(swing.JCheckBox("onkeypress", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JCheckBox("ondblclick", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JCheckBox("onwheel", False, actionPerformed=self.handleXssEventCheckBox))
tmpPanel1.add(swing.JLabel("Custom handler : ", swing.SwingConstants.RIGHT))
self.xssCustomHandler3Area = swing.JTextField('', 15)
tmpPanel1.add(self.xssCustomHandler3Area)
tmpGridPanel.add(tmpPanel)
tmpGridPanel.add(tmpPanel1)
xssTab.add(tmpGridPanel, BorderLayout.NORTH)
# Middle of XSS Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = BorderLayout()
tmpPanel.border = swing.BorderFactory.createTitledBorder("Payloads")
self.xssPayloadTextArea = swing.JTextArea('', 15, 100)
self.xssPayloadTextArea.setLineWrap(False)
scrollTextArea = swing.JScrollPane(self.xssPayloadTextArea)
tmpPanel.add(scrollTextArea)
xssTab.add(tmpPanel, BorderLayout.CENTER)
# Right/Middle of XSS Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(6,1)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Output options")
tmpPanel.add(swing.JButton('Generate Payloads', actionPerformed=self.handleXssButtonClick))
tmpPanel.add(swing.JButton('Copy Payloads to Clipboard', actionPerformed=self.handleXssButtonClick))
tmpPanel.add(swing.JButton('Clear Payloads', actionPerformed=self.handleXssButtonClick))
tmpPanel.add(swing.JButton('Save to File', actionPerformed=self.handleXssButtonClick))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
xssTab.add(tmpPanel, BorderLayout.EAST)
# Bottom of XSS Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Config")
# First row
tmpPanel.add(swing.JCheckBox("Upper case", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Prepend random chars", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Replace () with ``", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JLabel("Add a prefix : ", swing.SwingConstants.RIGHT))
self.xssPrefixArea = swing.JTextField('', 15)
tmpPanel.add(self.xssPrefixArea)
# Second row
tmpPanel.add(swing.JCheckBox("URL encode special chars", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Toggle case", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JCheckBox("HTML encode special chars", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JLabel("Add a suffix : ", swing.SwingConstants.RIGHT))
self.xssSuffixArea = swing.JTextField("", 15)
tmpPanel.add(self.xssSuffixArea)
# Third row
tmpPanel.add(swing.JCheckBox("Non-standard percent encoding", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Non-standard slash encoding", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Close tags", False, actionPerformed=self.handleXssConfigCheckBox))
tmpPanel.add(swing.JLabel("Add text : ", swing.SwingConstants.RIGHT))
self.xssTagTextArea = swing.JTextField('', 15)
tmpPanel.add(self.xssTagTextArea)
xssTab.add(tmpPanel, BorderLayout.SOUTH)
############ END XSS TAB ############
# Second tab
############ START SQLi TAB ############
sqliTab = swing.JPanel()
sqliTab.layout = BorderLayout()
tabbedPane.addTab("SQLi", sqliTab)
tmpGridPanel = swing.JPanel()
tmpGridPanel.layout = GridLayout(1, 2)
# Top of SQLi Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("DBMS to test")
# First row
tmpPanel.add(swing.JCheckBox("MySQL", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Oracle", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("PostgreSQL", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Microsoft SQL Server", False, actionPerformed=self.handleSqliDbSelectCheckBox))
# Second row
tmpPanel.add(swing.JCheckBox("Microsoft Access", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("IBM DB2", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("SQLite", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Firebird", False, actionPerformed=self.handleSqliDbSelectCheckBox))
# Third row
tmpPanel.add(swing.JCheckBox("Sybase", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("SAP MaxDB", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("HSQLDB", False, actionPerformed=self.handleSqliDbSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Informix", False, actionPerformed=self.handleSqliDbSelectCheckBox))
# Top of SQLi Panel
tmpPanel1 = swing.JPanel()
tmpPanel1.layout = GridLayout(3, 5)
tmpPanel1.border = swing.BorderFactory.createTitledBorder("Techniques")
# First row
tmpPanel1.add(swing.JCheckBox("Boolean-based blind", False, actionPerformed=self.handleSqliTechniquesCheckBox))
tmpPanel1.add(swing.JCheckBox("Time-based blind", False, actionPerformed=self.handleSqliTechniquesCheckBox))
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
# Second row
tmpPanel1.add(swing.JCheckBox("Error-based", False, actionPerformed=self.handleSqliTechniquesCheckBox))
tmpPanel1.add(swing.JCheckBox("Stacked queries", False, actionPerformed=self.handleSqliTechniquesCheckBox))
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
# Third row
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
tmpGridPanel.add(tmpPanel)
tmpGridPanel.add(tmpPanel1)
sqliTab.add(tmpGridPanel, BorderLayout.NORTH)
# Middle of SQLi Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = BorderLayout()
tmpPanel.border = swing.BorderFactory.createTitledBorder("Payloads")
self.sqliPayloadTextArea = swing.JTextArea('', 15, 100)
self.sqliPayloadTextArea.setLineWrap(False)
scrollTextArea = swing.JScrollPane(self.sqliPayloadTextArea)
tmpPanel.add(scrollTextArea)
sqliTab.add(tmpPanel, BorderLayout.CENTER)
# Right/Middle of SQLi Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(6,1)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Output options")
tmpPanel.add(swing.JButton('Generate Payloads', actionPerformed=self.handleSqliButtonClick))
tmpPanel.add(swing.JButton('Copy Payloads to Clipboard', actionPerformed=self.handleSqliButtonClick))
tmpPanel.add(swing.JButton('Clear Payloads', actionPerformed=self.handleSqliButtonClick))
tmpPanel.add(swing.JButton('Save to File', actionPerformed=self.handleSqliButtonClick))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
sqliTab.add(tmpPanel, BorderLayout.EAST)
# Bottom of SQLi Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Config")
# First row
tmpPanel.add(swing.JCheckBox("Lower case", False, actionPerformed=self.handleSqliConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Toggle case", False, actionPerformed=self.handleSqliConfigCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel("Add a prefix : ", swing.SwingConstants.RIGHT))
self.sqliPrefixArea = swing.JTextField("", 15)
tmpPanel.add(self.sqliPrefixArea)
# Second row
tmpPanel.add(swing.JCheckBox("URL encode special chars", False, actionPerformed=self.handleSqliConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Non-standard slash encoding", False, actionPerformed=self.handleSqliConfigCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel("Add a suffix : ", swing.SwingConstants.RIGHT))
self.sqliSuffixArea = swing.JTextField("", 15)
tmpPanel.add(self.sqliSuffixArea)
# Third row
tmpPanel.add(swing.JCheckBox("Non-standard percent encoding", False, actionPerformed=self.handleSqliConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Non-standard slash encoding", False, actionPerformed=self.handleSqliConfigCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel("Original parameter value : ", swing.SwingConstants.RIGHT))
self.sqliOriginalParamArea = swing.JTextField("", 15)
tmpPanel.add(self.sqliOriginalParamArea)
sqliTab.add(tmpPanel, BorderLayout.SOUTH)
############ END SQLi TAB ############
############ START HEADERS TAB ############
# Third tab
headersTab = swing.JPanel()
headersTab.layout = BorderLayout()
tabbedPane.addTab("Headers", headersTab)
# Top of Headers Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Headers to test")
# First row
tmpPanel.add(swing.JCheckBox("Authorization", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Connection", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Host", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("HTTP2-Settings", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JLabel("Custom Header : ", swing.SwingConstants.RIGHT))
self.customHeader1Area = swing.JTextField("", 15)
tmpPanel.add(self.customHeader1Area)
# Second row
tmpPanel.add(swing.JCheckBox("Origin", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Proxy-Authorization", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("Referer", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("User-Agent", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JLabel("Custom Header : ", swing.SwingConstants.RIGHT))
self.customHeader2Area = swing.JTextField("", 15)
tmpPanel.add(self.customHeader2Area)
# Third row
tmpPanel.add(swing.JCheckBox("X-Forwarded-For", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("X-Forwarded-Host", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("X-Method-Override", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JCheckBox("X-Wap-Profile", False, actionPerformed=self.handleHeadersSelectCheckBox))
tmpPanel.add(swing.JLabel("Custom Header : ", swing.SwingConstants.RIGHT))
self.customHeader3Area = swing.JTextField("", 15)
tmpPanel.add(self.customHeader3Area)
headersTab.add(tmpPanel, BorderLayout.NORTH)
# Middle of Headers Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = BorderLayout()
tmpPanel.border = swing.BorderFactory.createTitledBorder("Payloads")
self.headerPayloadTextArea = swing.JTextArea('', 15, 100)
self.headerPayloadTextArea.setLineWrap(False)
scrollTextArea = swing.JScrollPane(self.headerPayloadTextArea)
tmpPanel.add(scrollTextArea)
headersTab.add(tmpPanel, BorderLayout.CENTER)
# Right/Middle of Headers Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(6,1)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Output options")
tmpPanel.add(swing.JButton('Generate Payloads', actionPerformed=self.handleHeadersButtonClick))
tmpPanel.add(swing.JButton('Copy Payloads to Clipboard', actionPerformed=self.handleHeadersButtonClick))
tmpPanel.add(swing.JButton('Clear Payloads', actionPerformed=self.handleHeadersButtonClick))
tmpPanel.add(swing.JButton('Save to File', actionPerformed=self.handleHeadersButtonClick))
tmpPanel.add(swing.JButton('Poll Collaborator Server', actionPerformed=self.handleHeadersButtonClick))
tmpPanel.add(swing.JLabel(""))
headersTab.add(tmpPanel, BorderLayout.EAST)
# Bottom of Headers Panel
# splitting the bottom panel
tmpGridPanel = swing.JPanel()
tmpGridPanel.layout = GridLayout(1, 2)
#
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Config")
# First row
tmpPanel.add(swing.JCheckBox("Lower case", False, actionPerformed=self.handleHeadersConfigCheckBox))
tmpPanel.add(swing.JCheckBox("URL encode special chars", False, actionPerformed=self.handleHeadersConfigCheckBox))
# Second row
tmpPanel.add(swing.JCheckBox("Upper case", False, actionPerformed=self.handleHeadersConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Non-standard slash encoding", False, actionPerformed=self.handleHeadersConfigCheckBox))
# Third row
tmpPanel.add(swing.JCheckBox("Toggle case", False, actionPerformed=self.handleHeadersConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Non-standard percent encoding", False, actionPerformed=self.handleHeadersConfigCheckBox))
tmpPanel1 = swing.JPanel()
tmpPanel1.layout = GridLayout(3, 5)
tmpPanel1.border = swing.BorderFactory.createTitledBorder("Tests")
# First row
tmpPanel1.add(swing.JCheckBox("Error Invoking Characters", False, actionPerformed=self.handleHeadersTestsCheckBox))
tmpPanel1.add(swing.JCheckBox("Random string reflection", False, actionPerformed=self.handleHeadersTestsCheckBox))
tmpPanel1.add(swing.JLabel("Custom header value: ", swing.SwingConstants.RIGHT))
self.headersCustomValue1Area = swing.JTextField("", 15)
tmpPanel1.add(self.headersCustomValue1Area)
# Second row
tmpPanel1.add(swing.JCheckBox("Out-of-band", False, actionPerformed=self.handleHeadersTestsCheckBox))
tmpPanel1.add(swing.JCheckBox("Random long strings", False, actionPerformed=self.handleHeadersTestsCheckBox))
tmpPanel1.add(swing.JLabel("Custom header value: ", swing.SwingConstants.RIGHT))
self.headersCustomValue2Area = swing.JTextField("", 15)
tmpPanel1.add(self.headersCustomValue2Area)
# Third row
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel(""))
tmpPanel1.add(swing.JLabel("Callback server address: ", swing.SwingConstants.RIGHT))
self.headersCallbackAddressArea = swing.JTextField("", 15)
tmpPanel1.add(self.headersCallbackAddressArea)
tmpGridPanel.add(tmpPanel)
tmpGridPanel.add(tmpPanel1)
headersTab.add(tmpGridPanel, BorderLayout.SOUTH)
############ END HEADERS TAB ############
############ START OTHER TAB ############
otherTab = swing.JPanel()
otherTab.layout = BorderLayout()
tabbedPane.addTab("Other", otherTab)
# Top of Headers Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Vulnerabilities")
# First row
tmpPanel.add(swing.JCheckBox("NoSQLi", False, actionPerformed=self.handleOtherSelectCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
# Will add more payloads in future releases
# Second row
tmpPanel.add(swing.JCheckBox("JavaScript Injection", False, actionPerformed=self.handleOtherSelectCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
# Third row
tmpPanel.add(swing.JCheckBox("LDAP Injection", False, actionPerformed=self.handleOtherSelectCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
otherTab.add(tmpPanel, BorderLayout.NORTH)
# Middle of Headers Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = BorderLayout()
tmpPanel.border = swing.BorderFactory.createTitledBorder("Payloads")
self.otherPayloadTextArea = swing.JTextArea('', 15, 100)
self.otherPayloadTextArea.setLineWrap(False)
scrollTextArea = swing.JScrollPane(self.otherPayloadTextArea)
tmpPanel.add(scrollTextArea)
otherTab.add(tmpPanel, BorderLayout.CENTER)
# Right/Middle of XSS Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(6,1)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Output options")
tmpPanel.add(swing.JButton('Generate Payloads', actionPerformed=self.handleOtherButtonClick))
tmpPanel.add(swing.JButton('Copy Payloads to Clipboard', actionPerformed=self.handleOtherButtonClick))
tmpPanel.add(swing.JButton('Clear Payloads', actionPerformed=self.handleOtherButtonClick))
tmpPanel.add(swing.JButton('Save to File', actionPerformed=self.handleOtherButtonClick))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
otherTab.add(tmpPanel, BorderLayout.EAST)
# Bottom of XSS Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(3, 5)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Config")
# First row
tmpPanel.add(swing.JCheckBox("Upper case", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Prepend random chars", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JCheckBox("HTML encode special chars", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JLabel("Add a prefix : ", swing.SwingConstants.RIGHT))
self.otherPrefixArea = swing.JTextField('', 15)
tmpPanel.add(self.otherPrefixArea)
# Second row
tmpPanel.add(swing.JCheckBox("URL encode special chars", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Toggle case", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel("Add a suffix : ", swing.SwingConstants.RIGHT))
self.otherSuffixArea = swing.JTextField("", 15)
tmpPanel.add(self.otherSuffixArea)
# Third row
tmpPanel.add(swing.JCheckBox("Non-standard percent encoding", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JCheckBox("Non-standard slash encoding", False, actionPerformed=self.handleOtherConfigCheckBox))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
otherTab.add(tmpPanel, BorderLayout.SOUTH)
############ END OTHER TAB ############
####START COLLABORATOR INTERACTIONS TAB####
# Seventh tab
collabTab = swing.JPanel()
collabTab.layout = BorderLayout()
tabbedPane.addTab("Collaborator Log", collabTab)
# Text area for Collaborator Interactions Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = BorderLayout()
tmpPanel.border = swing.BorderFactory.createTitledBorder("Collaborator Interactions")
self.collaboratorInteractionsTextArea = swing.JTextArea('', 15, 100)
self.collaboratorInteractionsTextArea.setLineWrap(False)
scrollTextArea = swing.JScrollPane(self.collaboratorInteractionsTextArea)
tmpPanel.add(scrollTextArea)
collabTab.add(tmpPanel, BorderLayout.CENTER)
# Right/Middle of Collaborator Interactions Panel
tmpPanel = swing.JPanel()
tmpPanel.layout = GridLayout(8,1)
tmpPanel.border = swing.BorderFactory.createTitledBorder("Options")
tmpPanel.add(swing.JButton('Poll Collaborator Server', actionPerformed=self.handleCollabButtonClick))
tmpPanel.add(swing.JButton('Copy Interactions to Clipboard', actionPerformed=self.handleCollabButtonClick))
tmpPanel.add(swing.JButton('Clear Log', actionPerformed=self.handleCollabButtonClick))
tmpPanel.add(swing.JButton('Save to File', actionPerformed=self.handleCollabButtonClick))
tmpPanel.add(swing.JButton('Reset Collaborator Interactions', actionPerformed=self.handleCollabButtonClick))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
tmpPanel.add(swing.JLabel(""))
collabTab.add(tmpPanel, BorderLayout.EAST)
#####END COLLABORATOR INTERACTIONS TAB#####
callbacks.addSuiteTab(self)
# Set up space for save dialogue
self.savePanel = swing.JPanel()
self.savePanel.setLayout(BorderLayout())
self.saveArea = swing.JTextArea()
self.saveArea.setBorder(swing.BorderFactory.createEmptyBorder(10, 10, 10, 10))
pane = swing.JScrollPane()
pane.getViewport().add(self.saveArea)
self.savePanel.setBorder(swing.BorderFactory.createEmptyBorder(10, 10, 10, 10))
self.savePanel.add(pane)
self.add(self.savePanel)
self.setTitle("File chooser")
self.setSize(300, 250)
self.setDefaultCloseOperation(swing.JFrame.EXIT_ON_CLOSE)
self.setLocationRelativeTo(None)
# Provides a place for the save box
# no need for it to be visible on start
self.setVisible(False)
return
def getTabCaption(self):
"""Return the text to be displayed on the tab"""
return "InjectMate"
def getUiComponent(self):
"""Passes the UI to burp"""
return self.tab
def handleXssTagsSelectCheckBox(self, event):
"""Handles checkbox clicks from the XSS menu
selection to ensure only specified payloads
are generated.
"""
if event.source.selected:
xssTags[event.source.text] = True
else:
xssTags[event.source.text] = False
def handleXssEventCheckBox(self, event):
"""Handles checkbox clicks from the XSS evenk handler menu
selection to ensure only specified payloads are generated.
"""
if event.source.selected:
xssEventHandlers[event.source.text] = True
else:
xssEventHandlers[event.source.text] = False
def handleXssConfigCheckBox(self, event):
"""Handles checkbox clicks from the XSS menu config
selection to ensure only payloads are generated with
or without any specified options.
"""
if event.source.selected:
xssConfig[event.source.text] = True
else:
xssConfig[event.source.text] = False
def handleXssButtonClick(self, event):
"""Handles button clicks from xss menu."""
buttonText = event.source.text
if buttonText == "Generate Payloads":
self.launchThread(self.generateXssPayloads())
elif buttonText == "Copy Payloads to Clipboard":
self.copyToClipboard(self.xssPayloadTextArea.text)
elif buttonText == 'Clear Payloads':
self.clearTextArea(self.xssPayloadTextArea)
elif buttonText == "Save to File":
self.launchThread(self.saveTextToFile, [self.xssPayloadTextArea])
else:
print buttonText
def generateXssSamplePayload(self):
"""Generates a PoC payload to alert a user."""
samplePayloads = [
"prompt({})".format(random.randint(1,1000)),
"confirm({})".format(random.randint(1,1000))
]
return samplePayloads[random.randrange(0, 2)]
def generateXssPayloads(self):
"""Write payloads to the XSS text area"""
tags = [tag for tag in xssTags if xssTags[tag]]
handlers = [handler for handler in xssEventHandlers if xssEventHandlers[handler]]
payloads = []
if self.xssCustomTag1Area.text:
tags.append(self.xssCustomTag1Area.text)
if self.xssCustomTag2Area.text:
tags.append(self.xssCustomTag2Area.text)
if self.xssCustomTag3Area.text:
tags.append(self.xssCustomTag3Area.text)
if self.xssCustomHandler1Area.text:
handlers.append(self.xssCustomHandler1Area.text)
if self.xssCustomHandler2Area.text:
handlers.append(self.xssCustomHandler2Area.text)
if self.xssCustomHandler3Area.text:
handlers.append(self.xssCustomHandler3Area.text)
for tag in tags:
if xssConfig['Upper case']:
tag = tag.upper()
if xssConfig['Toggle case']:
tag = capsEveryOtherChar(tag)
if tag.lower() == 'script':
xssSamplePayload = self.generateXssSamplePayload()
payloads.append("<{0}>{1}</{0}>".format(tag, xssSamplePayload))
continue
if tag.lower() == 'math':
text = self.xssTagTextArea.text if self.xssTagTextArea.text else 'ClickMe'
payloads.append('<math href="javascript:alert({})">{}</math>'.format(random.randint(1,1000), text))
payloads.append('<math><maction actiontype="statusline#http://google.com" xlink:href="javascript:alert({})">{}</maction></math>'.format(random.randint(1,1000), text))
payloads.append('<math><maction actiontype="statusline" xlink:href="javascript:alert({})"><mtext>http://http://google.com</mtext></maction></math>'.format(random.randint(1,1000)))
continue
if tag.lower() == 'details':
xssSamplePayload = self.generateXssSamplePayload()
payloads.append('<details open ontoggle={}>{}'.format(xssSamplePayload, self.xssTagTextArea.text))
for handler in handlers:
xssSamplePayload = self.generateXssSamplePayload()
if tag.lower() == 'details':
if xssConfig['Close tags']:
payloads.append("<{0} open {1}={2}>{3}</{0}>".format(tag, handler, xssSamplePayload, self.xssTagTextArea.text))
else:
payloads.append("<{} open {}={}>{}".format(tag, handler, xssSamplePayload, self.xssTagTextArea.text))
elif tag.lower() in ['video', 'audio', 'img']:
if tag.lower() in ['video', 'audio']:
payloads.append("<{0} controls src={3} {1}={2}></{0}>".format(tag, handler, xssSamplePayload, random.randint(1,1000)))
else:
if xssConfig['Close tags']:
payloads.append("<{0} src={3} {1}={2}></{0}>".format(tag, handler, xssSamplePayload, random.randint(1,1000)))
else:
payloads.append("<{} src={} {}={}>".format(tag, handler, xssSamplePayload, random.randint(1,1000)))
else:
if xssConfig['Close tags']:
payloads.append("<{0} {1}={2}>{3}</{0}>".format(tag, handler, xssSamplePayload, self.xssTagTextArea.text))
else:
payloads.append("<{} {}={}>{}".format(tag, handler, xssSamplePayload, self.xssTagTextArea.text))
if xssConfig['Replace () with ``']:
payloads = [payload.replace('(','`').replace(')','`') for payload in payloads]
if self.xssPrefixArea.text:
payloads = [self.xssPrefixArea.text + payload for payload in payloads]
if self.xssSuffixArea.text:
payloads = [payload + self.xssSuffixArea.text for payload in payloads]
if xssConfig['Prepend random chars']:
payloads = [getRandomString(5) + payload for payload in payloads]
if xssConfig['Non-standard percent encoding']:
payloads = [percentNonStandardEncode(payload) for payload in payloads]
if xssConfig['Non-standard slash encoding']:
payloads = [slashNonStandardEncode(payload) for payload in payloads]
if xssConfig['URL encode special chars']:
payloads = [urlEncode(payload) for payload in payloads]
if xssConfig['HTML encode special chars']:
payloads = [cgi.escape(payload) for payload in payloads]
self.xssPayloadTextArea.text = '\n'.join(payloads)
def handleSqliDbSelectCheckBox(self, event):
if event.source.selected:
sqliDbmsToTest[event.source.text] = True
else:
sqliDbmsToTest[event.source.text] = False
def handleSqliTechniquesCheckBox(self, event):
if event.source.selected:
sqliTechniques[event.source.text] = True
else:
sqliTechniques[event.source.text] = False
def handleSqliConfigCheckBox(self, event):
"""Handles checkbox clicks from the SQLi menu config
selection to ensure only payloads are generated with
or without any specified options.
"""
if event.source.selected:
sqliConfig[event.source.text] = True
else:
sqliConfig[event.source.text] = False
def handleSqliButtonClick(self, event):
"""Handles button clicks from SQLi menu."""
buttonText = event.source.text
if buttonText == "Generate Payloads":
self.launchThread(self.generateSqliPayloads())
elif buttonText == "Copy Payloads to Clipboard":
self.copyToClipboard(self.sqliPayloadTextArea.text)
elif buttonText == 'Clear Payloads':
self.clearTextArea(self.sqliPayloadTextArea)
elif buttonText == "Poll Collaborator Server":
self.launchThread(self.pollCollabServer())
elif buttonText == "Save to File":
self.launchThread(self.saveTextToFile, [self.sqliPayloadTextArea])
else:
print buttonText
def generateSqliPayloads(self):
"""Write payloads to the text area"""
payloadData = getSqlMapPayloads()
dbms = [db for db in sqliDbmsToTest if sqliDbmsToTest[db]]
tests = [test for test in sqliTechniques if sqliTechniques[test]]
sqliPayloads = []
for payload in payloadData:
for db in dbms:
for test in tests:
if (db.lower() in payload[0].lower() and test.lower() in payload[0].lower()):
sqliPayloads.append(payload[1])
sqliPayloads = list(set(sqliPayloads))
sqliPayloads = [self.substituteValues(payload) for payload in sqliPayloads]
if self.sqliPrefixArea.text:
sqliPayloads = [self.sqliPrefixArea.text + payload for payload in sqliPayloads]
if self.sqliSuffixArea.text:
sqliPayloads = [payload + self.sqliSuffixArea.text for payload in sqliPayloads]
if sqliConfig['Non-standard percent encoding']:
sqliPayloads = [percentNonStandardEncode(payload) for payload in sqliPayloads]
if sqliConfig['Non-standard slash encoding']:
sqliPayloads = [slashNonStandardEncode(payload) for payload in sqliPayloads]
if sqliConfig['URL encode special chars']:
sqliPayloads = [urlEncode(payload) for payload in sqliPayloads]
if sqliConfig['Lower case']:
sqliPayloads = [payload.lower() for payload in sqliPayloads]
if sqliConfig['Toggle case']:
sqliPayloads = [capsEveryOtherChar(payload) for payload in sqliPayloads]
# Write the payloads sorted by length.
self.sqliPayloadTextArea.text = '\n'.join(sorted(list(set(sqliPayloads)), key=len))
def handleHeadersSelectCheckBox(self, event):
"""Handles checkbox clicks from the Headers menu
header selection to ensure only payloads for
specified headers are generated.
"""
if event.source.selected:
headersToTest[event.source.text] = True
else:
headersToTest[event.source.text] = False
def handleHeadersConfigCheckBox(self, event):
"""Handles heckbox clicks from the Headers menu config
selection to ensure only payloads are generated with
or without any specified options.
"""
if event.source.selected:
headersConfig[event.source.text] = True
else:
headersConfig[event.source.text] = False
def handleHeadersTestsCheckBox(self, event):
"""Handles heckbox clicks from the Headers tab Tests
selection to ensure only payloads are generated with
or without any specified options.
"""
if event.source.selected:
headersTests[event.source.text] = True
else:
headersTests[event.source.text] = False
def handleHeadersButtonClick(self, event):
"""Handles button clicks from header menu."""
buttonText = event.source.text
if buttonText == "Generate Payloads":
self.launchThread(self.generateHeaderPayloads())
elif buttonText == "Copy Payloads to Clipboard":
self.copyToClipboard(self.headerPayloadTextArea.text)
elif buttonText == 'Clear Payloads':
self.clearTextArea(self.headerPayloadTextArea)
elif buttonText == "Poll Collaborator Server":
self.launchThread(self.pollCollabServer())
elif buttonText == "Save to File":
self.launchThread(self.saveTextToFile, [self.headerPayloadTextArea])
else:
print buttonText
def generateHeaderPayloads(self):
"""Write payloads to the text area"""
payloads = []
headers = [header for header in headersToTest if headersToTest[header]]
tests = [test for test in headersTests if headersTests[test]]
if self.customHeader1Area.text:
headers.append(self.customHeader1Area.text)
if self.customHeader2Area.text:
headers.append(self.customHeader2Area.text)
if self.customHeader3Area.text:
headers.append(self.customHeader3Area.text)
for header in headers:
for test in tests:
if test == "Random string reflection":
payloads.append(header + ': ' + getRandomString(10))
if test == "Random long strings":
payloads.append(header + ': ' + getRandomString(25))
payloads.append(header + ': ' + getRandomString(50))
payloads.append(header + ': ' + getRandomString(100))
payloads.append(header + ': ' + getRandomString(500))
payloads.append(header + ': ' + getRandomString(1000))
if test == "Error Invoking Characters":
payloads += [header + ': ' + char for char in list(string.punctuation)]
if test == "Out-of-band":
if self.headersCallbackAddressArea.text:
payloads.append(header + ': ' + self.headersCallbackAddressArea.text)
else:
try:
self.collabPayload = self.callbacks.createBurpCollaboratorClientContext()
self.collab.append(self.collabPayload)
collabPayload = self.collabPayload.generatePayload(True)
payloads.append(header + ': ' + 'https://' + collabPayload)
except:
continue
if self.headersCustomValue1Area.text:
payloads.append(header + ': ' + self.headersCustomValue1Area.text)
if self.headersCustomValue2Area.text:
payloads.append(header + ': ' + self.headersCustomValue2Area.text)
if header == "Authorization":
payloads.append(header + ': Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk')
payloads.append(header + ': Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c')
payloads.append(header + ': Digest username="Mufasa"')
if headersConfig['Non-standard percent encoding']:
payloads = [payload.split(':')[0] + ': ' + urlEncode(payload.split(': ')[1]) for payload in payloads]
if headersConfig['Non-standard percent encoding']:
payloads = [payload.split(':')[0] + ': ' + percentNonStandardEncode(payload.split(': ')[1]) for payload in payloads]
if headersConfig['Non-standard slash encoding']:
payloads = [payload.split(':')[0] + ': ' + percentNonStandardEncode(payload.split(': ')[1]) for payload in payloads]
if headersConfig['Upper case']:
payloads = [payload.split(':')[0] + ': ' + payload.split(': ')[1].upper() for payload in payloads]
if headersConfig['Lower case']:
payloads = [payload.split(':')[0] + ': ' + payload.split(': ')[1].lower() for payload in payloads]
if headersConfig['Toggle case']:
payloads = [payload.split(':')[0] + ': ' + capsEveryOtherChar(payload.split(': ')[1]) for payload in payloads]
self.headerPayloadTextArea.text = '\n'.join(payloads)
def handleOtherSelectCheckBox(self, event):
"""Handles checkbox clicks from the Headers menu
header selection to ensure only payloads for
specified headers are generated.
"""
if event.source.selected:
otherVulnsToTest[event.source.text] = True
else:
otherVulnsToTest[event.source.text] = False
def handleOtherConfigCheckBox(self, event):
"""Handles checkbox clicks from the Other's menu config
selection to ensure only payloads are generated with
or without any specified options.
"""
if event.source.selected: