-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpermiter.py
More file actions
1337 lines (1283 loc) · 64.3 KB
/
permiter.py
File metadata and controls
1337 lines (1283 loc) · 64.3 KB
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
# -*- coding: utf-8 -*-
from burp import IBurpExtender, IHttpListener, ITab, IContextMenuFactory, IMessageEditorController, IExtensionStateListener
from java.awt import BorderLayout, GridBagLayout, GridBagConstraints, Insets, Dimension, FlowLayout
from javax.swing import JPanel, JLabel, JTextField, JTextArea, JCheckBox, JButton, JScrollPane, BorderFactory, JMenuItem, JTable, JComboBox, ListSelectionModel, JSpinner, SpinnerNumberModel, JSplitPane, JFileChooser
from javax.swing.table import DefaultTableModel
from javax.swing.event import ListSelectionListener
from javax.swing.filechooser import FileNameExtensionFilter
from java.awt.event import ActionListener
import re
import threading
import time
import java.io.File
try:
import json
except ImportError:
import simplejson as json
class BurpExtender(IBurpExtender, ITab, IContextMenuFactory, IMessageEditorController, ActionListener, IExtensionStateListener):
def registerExtenderCallbacks(self, callbacks):
self.callbacks = callbacks
self.helpers = callbacks.getHelpers()
callbacks.setExtensionName("Permiter")
callbacks.registerContextMenuFactory(self)
callbacks.registerExtensionStateListener(self)
self.roles = {}
self.test_results = []
self.target_scope = ""
self.test_lock = threading.Lock()
self.stop_testing = False
self.current_testing_thread = None
self.tested_urls = set()
self.current_request_response = None
self.createGUI()
callbacks.addSuiteTab(self)
print("Permiter")
print("Author: Dave Blandford");
print("Twitter: @hackr1ot")
print("Email: dave@mailo.com");
print(
'''
-----BEGIN PGP PUBLIC KEY BLOCK-----
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
JSYTJzaX2Ds2ClCwTyz5P4Gjx6CoKwBIdsEspog=
=iIJQ
-----END PGP PUBLIC KEY BLOCK-----
'''
)
def extensionUnloaded(self):
self.stop_testing = True
if self.current_testing_thread and self.current_testing_thread.isAlive():
self.current_testing_thread.join(5)
def createGUI(self):
self.panel = JPanel(BorderLayout())
main_split = JSplitPane(JSplitPane.VERTICAL_SPLIT)
main_split.setResizeWeight(0.5)
top_panel = JPanel(BorderLayout())
config_section = JPanel(BorderLayout())
config_split = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
config_split.setResizeWeight(0.5)
left_config = JPanel(GridBagLayout())
left_gbc = GridBagConstraints()
left_gbc.insets = Insets(3, 3, 3, 3)
left_gbc.anchor = GridBagConstraints.NORTHWEST
left_gbc.weighty = 1.0
left_gbc.gridx = 0; left_gbc.gridy = 0; left_gbc.weightx = 0
left_config.add(JLabel("Target Scope:"), left_gbc)
left_gbc.gridx = 1; left_gbc.fill = GridBagConstraints.NONE; left_gbc.weightx = 0
scope_options_panel = JPanel(FlowLayout(FlowLayout.LEFT, 2, 0))
self.scope_method_combo = JComboBox(["Target History", "Custom Regex"])
self.scope_method_combo.addActionListener(self)
scope_options_panel.add(self.scope_method_combo)
self.refresh_targets_button = JButton("Refresh Targets")
self.refresh_targets_button.addActionListener(self)
scope_options_panel.add(self.refresh_targets_button)
left_config.add(scope_options_panel, left_gbc)
left_gbc.gridx = 0; left_gbc.gridy = 1; left_gbc.weightx = 0
left_config.add(JLabel("Select Target:"), left_gbc)
left_gbc.gridx = 1; left_gbc.fill = GridBagConstraints.HORIZONTAL; left_gbc.weightx = 1.0
self.target_combo = JComboBox()
self.target_combo.addActionListener(self)
left_config.add(self.target_combo, left_gbc)
left_gbc.gridx = 0; left_gbc.gridy = 2; left_gbc.weightx = 0
left_config.add(JLabel("Scope Pattern:"), left_gbc)
left_gbc.gridx = 1; left_gbc.fill = GridBagConstraints.HORIZONTAL; left_gbc.weightx = 1.0
self.scope_field = JTextField("https://hackedsite\\.uhoh/.*", 30)
left_config.add(self.scope_field, left_gbc)
left_gbc.gridx = 0; left_gbc.gridy = 3; left_gbc.weightx = 0
left_config.add(JLabel("Exclude Endpoints:"), left_gbc)
left_gbc.gridx = 1; left_gbc.fill = GridBagConstraints.HORIZONTAL; left_gbc.weightx = 1.0
self.exclude_field = JTextField("/password_reset,/logout,/login")
self.exclude_field.setToolTipText("Comma-separated list of endpoints to exclude")
left_config.add(self.exclude_field, left_gbc)
left_gbc.gridx = 0; left_gbc.gridy = 4; left_gbc.weightx = 0
left_config.add(JLabel("Request Delay (ms):"), left_gbc)
left_gbc.gridx = 1; left_gbc.fill = GridBagConstraints.NONE; left_gbc.weightx = 0
self.delay_spinner = JSpinner(SpinnerNumberModel(10, 0, 1000, 5))
left_config.add(self.delay_spinner, left_gbc)
left_gbc.gridx = 0; left_gbc.gridy = 5; left_gbc.gridwidth = 2; left_gbc.fill = GridBagConstraints.HORIZONTAL
testing_panel = JPanel(GridBagLayout())
testing_gbc = GridBagConstraints()
testing_gbc.insets = Insets(2, 2, 2, 2)
testing_gbc.anchor = GridBagConstraints.WEST
testing_gbc.gridx = 0; testing_gbc.gridy = 0
self.test_history_button = JButton("Use Proxy History")
self.test_history_button.addActionListener(self)
testing_panel.add(self.test_history_button, testing_gbc)
testing_gbc.gridx = 1
self.test_target_button = JButton("Use Site Map")
self.test_target_button.addActionListener(self)
testing_panel.add(self.test_target_button, testing_gbc)
testing_gbc.gridx = 2
self.stop_test_button = JButton("Stop Testing")
self.stop_test_button.addActionListener(self)
self.stop_test_button.setEnabled(False)
testing_panel.add(self.stop_test_button, testing_gbc)
testing_gbc.gridx = 0; testing_gbc.gridy = 1
self.save_state_button = JButton("Save State")
self.save_state_button.addActionListener(self)
testing_panel.add(self.save_state_button, testing_gbc)
testing_gbc.gridx = 1
self.load_state_button = JButton("Load State")
self.load_state_button.addActionListener(self)
testing_panel.add(self.load_state_button, testing_gbc)
testing_gbc.gridx = 2
self.clear_results_button = JButton("Clear Results")
self.clear_results_button.addActionListener(self)
testing_panel.add(self.clear_results_button, testing_gbc)
testing_gbc.gridx = 0; testing_gbc.gridy = 2
self.export_csv_button = JButton("Export CSV")
self.export_csv_button.addActionListener(self)
testing_panel.add(self.export_csv_button, testing_gbc)
testing_gbc.gridx = 1
self.export_html_button = JButton("Export HTML")
self.export_html_button.addActionListener(self)
testing_panel.add(self.export_html_button, testing_gbc)
testing_gbc.gridx = 2
self.test_unauth_checkbox = JCheckBox("Include Unauth", False)
testing_panel.add(self.test_unauth_checkbox, testing_gbc)
testing_gbc.gridx = 0; testing_gbc.gridy = 3
self.use_entire_history_checkbox = JCheckBox("Use Entire History", False)
self.use_entire_history_checkbox.setToolTipText("Test all requests without removing duplicates")
testing_panel.add(self.use_entire_history_checkbox, testing_gbc)
testing_gbc.gridx = 0; testing_gbc.gridy = 4; testing_gbc.gridwidth = 1
skip_label = JLabel("Skip Static:")
testing_panel.add(skip_label, testing_gbc)
testing_gbc.gridx = 1; testing_gbc.gridwidth = 2
skip_panel = JPanel(FlowLayout(FlowLayout.LEFT, 2, 0))
self.skip_js_checkbox = JCheckBox("JS", True)
self.skip_css_checkbox = JCheckBox("CSS", True)
self.skip_images_checkbox = JCheckBox("Images", True)
self.skip_fonts_checkbox = JCheckBox("Fonts", True)
self.skip_media_checkbox = JCheckBox("Media", True)
skip_panel.add(self.skip_js_checkbox)
skip_panel.add(self.skip_css_checkbox)
skip_panel.add(self.skip_images_checkbox)
skip_panel.add(self.skip_fonts_checkbox)
skip_panel.add(self.skip_media_checkbox)
testing_panel.add(skip_panel, testing_gbc)
left_config.add(testing_panel, left_gbc)
config_split.setLeftComponent(left_config)
right_config = JPanel(BorderLayout())
role_controls_panel = JPanel(GridBagLayout())
controls_gbc = GridBagConstraints()
controls_gbc.insets = Insets(3, 3, 3, 3)
controls_gbc.anchor = GridBagConstraints.WEST
controls_gbc.gridx = 0; controls_gbc.gridy = 0; controls_gbc.weightx = 0
role_controls_panel.add(JLabel("Roles:"), controls_gbc)
controls_gbc.gridx = 0; controls_gbc.gridy = 1; controls_gbc.fill = GridBagConstraints.HORIZONTAL; controls_gbc.weightx = 0.5
self.role_combo = JComboBox()
self.role_combo.addActionListener(self)
role_controls_panel.add(self.role_combo, controls_gbc)
controls_gbc.gridx = 0; controls_gbc.gridy = 2; controls_gbc.fill = GridBagConstraints.NONE; controls_gbc.weightx = 0
role_buttons_panel = JPanel(FlowLayout(FlowLayout.LEFT, 2, 2))
self.add_role_button = JButton("Add New Role")
self.add_role_button.addActionListener(self)
role_buttons_panel.add(self.add_role_button)
self.delete_role_button = JButton("Delete Role")
self.delete_role_button.addActionListener(self)
role_buttons_panel.add(self.delete_role_button)
role_controls_panel.add(role_buttons_panel, controls_gbc)
controls_gbc.gridx = 1; controls_gbc.gridy = 0; controls_gbc.weightx = 0
role_controls_panel.add(JLabel("Role Name:"), controls_gbc)
controls_gbc.gridx = 1; controls_gbc.gridy = 1; controls_gbc.fill = GridBagConstraints.HORIZONTAL; controls_gbc.weightx = 0.5
self.role_name_field = JTextField("", 25)
role_controls_panel.add(self.role_name_field, controls_gbc)
right_config.add(role_controls_panel, BorderLayout.NORTH)
patterns_panel = JPanel(BorderLayout())
patterns_panel.setBorder(BorderFactory.createTitledBorder("Regex Patterns"))
self.main_patterns_panel = JPanel(GridBagLayout())
patterns_scroll = JScrollPane(self.main_patterns_panel)
patterns_scroll.setPreferredSize(Dimension(600, 200))
patterns_panel.add(patterns_scroll, BorderLayout.CENTER)
pattern_button_panel = JPanel()
self.add_pattern_button = JButton("Add Regex")
self.add_pattern_button.addActionListener(self)
pattern_button_panel.add(self.add_pattern_button)
self.save_role_button = JButton("Save")
self.save_role_button.addActionListener(self)
pattern_button_panel.add(self.save_role_button)
patterns_panel.add(pattern_button_panel, BorderLayout.SOUTH)
right_config.add(patterns_panel, BorderLayout.CENTER)
config_split.setRightComponent(right_config)
config_section.add(config_split, BorderLayout.CENTER)
top_panel.add(config_section, BorderLayout.CENTER)
main_split.setTopComponent(top_panel)
bottom_panel = JPanel(BorderLayout())
bottom_split = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
bottom_split.setResizeWeight(0.5)
test_section = JPanel(BorderLayout())
self.results_table_model = DefaultTableModel()
self.results_table_model.addColumn("Role")
self.results_table_model.addColumn("Method")
self.results_table_model.addColumn("URL")
self.results_table_model.addColumn("Status Code")
self.results_table_model.addColumn("Response Length")
self.results_table_model.addColumn("Notes")
self.results_table = JTable(self.results_table_model)
self.results_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)
self.results_table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS)
self.results_table.getSelectionModel().addListSelectionListener(ResultsTableSelectionHandler(self))
results_scroll = JScrollPane(self.results_table)
results_scroll.setPreferredSize(Dimension(700, 300))
test_section.add(results_scroll, BorderLayout.CENTER)
self.status_area = JTextArea(3, 50)
self.status_area.setEditable(False)
status_scroll = JScrollPane(self.status_area)
status_scroll.setBorder(BorderFactory.createTitledBorder("Status"))
test_section.add(status_scroll, BorderLayout.SOUTH)
bottom_split.setLeftComponent(test_section)
viewer_panel = JPanel(BorderLayout())
viewer_split = JSplitPane(JSplitPane.VERTICAL_SPLIT)
viewer_split.setResizeWeight(0.5)
request_panel = JPanel(BorderLayout())
request_panel.setBorder(BorderFactory.createTitledBorder("Request"))
self.request_editor = self.callbacks.createMessageEditor(self, False)
request_panel.add(self.request_editor.getComponent(), BorderLayout.CENTER)
viewer_split.setTopComponent(request_panel)
response_panel = JPanel(BorderLayout())
response_panel.setBorder(BorderFactory.createTitledBorder("Response"))
self.response_editor = self.callbacks.createMessageEditor(self, False)
response_panel.add(self.response_editor.getComponent(), BorderLayout.CENTER)
viewer_split.setBottomComponent(response_panel)
viewer_panel.add(viewer_split, BorderLayout.CENTER)
bottom_split.setRightComponent(viewer_panel)
bottom_panel.add(bottom_split, BorderLayout.CENTER)
main_split.setBottomComponent(bottom_panel)
self.panel.add(main_split, BorderLayout.CENTER)
self.role_pattern_panels = []
def _isStaticResource(self, request_response):
try:
service = request_response.getHttpService()
request_info = self.helpers.analyzeRequest(service, request_response.getRequest())
url = request_info.getUrl()
path = url.getPath().lower() if url.getPath() else ""
if self.skip_js_checkbox.isSelected():
if path.endswith('.js') or '/js/' in path:
return True
if self.skip_css_checkbox.isSelected():
if path.endswith('.css') or '/css/' in path:
return True
if self.skip_images_checkbox.isSelected():
img_extensions = ['.jpg', '.jpeg', '.png', '.gif', '.svg', '.ico', '.webp', '.bmp']
if any(path.endswith(ext) for ext in img_extensions) or '/images/' in path or '/img/' in path:
return True
if self.skip_fonts_checkbox.isSelected():
font_extensions = ['.woff', '.woff2', '.ttf', '.eot', '.otf']
if any(path.endswith(ext) for ext in font_extensions) or '/fonts/' in path:
return True
if self.skip_media_checkbox.isSelected():
media_extensions = ['.pdf', '.zip', '.mp4', '.mp3', '.avi', '.mov']
static_paths = ['/static/', '/assets/', '/media/', '/uploads/', '/files/']
if any(path.endswith(ext) for ext in media_extensions) or any(static_path in path for static_path in static_paths):
return True
return False
except:
return False
def createPatternPair(self, index):
pair_panel = JPanel(GridBagLayout())
pair_panel.setBorder(BorderFactory.createTitledBorder("Regex #%d" % (index + 1)))
gbc = GridBagConstraints()
gbc.insets = Insets(3, 3, 3, 3)
gbc.anchor = GridBagConstraints.WEST
gbc.gridx = 0; gbc.gridy = 0; gbc.gridwidth = 4
enable_checkbox = JCheckBox("Enable this pattern", True)
pair_panel.add(enable_checkbox, gbc)
gbc.gridx = 0; gbc.gridy = 1; gbc.gridwidth = 1
pair_panel.add(JLabel("Find (regex):"), gbc)
gbc.gridx = 1; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0
find_field = JTextField("", 35)
pair_panel.add(find_field, gbc)
gbc.gridx = 0; gbc.gridy = 2; gbc.fill = GridBagConstraints.NONE; gbc.weightx = 0
pair_panel.add(JLabel("Replace with:"), gbc)
gbc.gridx = 1; gbc.fill = GridBagConstraints.HORIZONTAL; gbc.weightx = 1.0
replace_field = JTextField("", 35)
pair_panel.add(replace_field, gbc)
gbc.gridx = 0; gbc.gridy = 3; gbc.gridwidth = 4; gbc.fill = GridBagConstraints.HORIZONTAL
pair_data = {
'panel': pair_panel,
'enabled': enable_checkbox,
'find_field': find_field,
'replace_field': replace_field
}
self.role_pattern_panels.append(pair_data)
main_gbc = GridBagConstraints()
main_gbc.gridx = 0; main_gbc.gridy = len(self.role_pattern_panels) - 1
main_gbc.fill = GridBagConstraints.HORIZONTAL; main_gbc.weightx = 1.0
main_gbc.insets = Insets(5, 5, 5, 5)
self.main_patterns_panel.add(pair_panel, main_gbc)
self.panel.revalidate()
self.panel.repaint()
def clearPatternPanels(self):
self.main_patterns_panel.removeAll()
self.role_pattern_panels = []
self.panel.revalidate()
self.panel.repaint()
def loadRoleDetails(self):
selected_role = str(self.role_combo.getSelectedItem()) if self.role_combo.getSelectedItem() else None
self.clearPatternPanels()
if selected_role and selected_role in self.roles:
role_data = self.roles[selected_role]
self.role_name_field.setText(selected_role)
for i, pattern in enumerate(role_data.get("regex_pairs", [])):
self.createPatternPair(i)
if i < len(self.role_pattern_panels):
self.role_pattern_panels[i]['enabled'].setSelected(pattern.get("enabled", True))
self.role_pattern_panels[i]['find_field'].setText(pattern.get("find", ""))
self.role_pattern_panels[i]['replace_field'].setText(pattern.get("replace", ""))
else:
self.role_name_field.setText("")
def saveRoleDetails(self):
role_name = self.role_name_field.getText().strip()
if not role_name:
self.addStatus("Error: Role name cannot be empty")
return
regex_pairs = []
for pattern_data in self.role_pattern_panels:
find_text = pattern_data['find_field'].getText().strip()
replace_text = pattern_data['replace_field'].getText().strip()
if find_text:
regex_pairs.append({
"enabled": pattern_data['enabled'].isSelected(),
"find": find_text,
"replace": replace_text
})
old_name = str(self.role_combo.getSelectedItem()) if self.role_combo.getSelectedItem() else None
role_data = {
"regex_pairs": regex_pairs,
}
if old_name and old_name != role_name and old_name in self.roles:
del self.roles[old_name]
self.role_combo.removeItem(old_name)
self.roles[role_name] = role_data
if role_name not in [str(self.role_combo.getItemAt(i)) for i in range(self.role_combo.getItemCount())]:
self.role_combo.addItem(role_name)
self.role_combo.setSelectedItem(role_name)
def refreshTargets(self):
try:
target_map = self.callbacks.getSiteMap(None)
if not target_map:
self.addStatus("No target history found")
return
self.target_combo.removeAllItems()
targets = set()
for item in target_map:
try:
service = item.getHttpService()
port_str = ""
if service.getPort() != 80 and service.getPort() != 443:
port_str = ":%d" % service.getPort()
target = "%s://%s%s" % (service.getProtocol(), service.getHost(), port_str)
targets.add(target)
except:
continue
sorted_targets = sorted(list(targets))
for target in sorted_targets:
self.target_combo.addItem(target)
if sorted_targets:
self.target_combo.insertItemAt("All Targets", 0)
self.target_combo.setSelectedIndex(0)
else:
self.addStatus("No valid targets found in history")
except Exception as e:
self.addStatus("Error refreshing targets: %s" % str(e))
def updateScopeFromTarget(self):
try:
selected_target = str(self.target_combo.getSelectedItem()) if self.target_combo.getSelectedItem() else None
if not selected_target or selected_target == "All Targets":
targets = []
for i in range(1, self.target_combo.getItemCount()):
targets.append(str(self.target_combo.getItemAt(i)))
if targets:
escaped_targets = [re.escape(target) for target in targets]
scope_pattern = "(%s)/.*" % "|".join(escaped_targets)
self.scope_field.setText(scope_pattern)
else:
escaped_target = re.escape(selected_target)
scope_pattern = "%s/.*" % escaped_target
self.scope_field.setText(scope_pattern)
except Exception as e:
self.addStatus("Error updating scope from target: %s" % str(e))
def actionPerformed(self, event):
source = event.getSource()
if source == self.add_role_button:
self.addNewRole()
elif source == self.delete_role_button:
self.deleteRole()
elif source == self.role_combo:
self.loadRoleDetails()
elif source == self.add_pattern_button:
self.createPatternPair(len(self.role_pattern_panels))
elif source == self.save_role_button:
self.saveRoleDetails()
elif source == self.test_history_button:
self.testProxyHistory()
elif source == self.test_target_button:
self.testSiteMap()
elif source == self.stop_test_button:
self.stopTesting()
elif source == self.clear_results_button:
self.clearResults()
elif source == self.export_csv_button:
self.exportCSV()
elif source == self.export_html_button:
self.exportHTML()
elif source == self.save_state_button:
self.saveState()
elif source == self.load_state_button:
self.loadState()
elif source == self.refresh_targets_button:
self.refreshTargets()
elif source == self.target_combo:
self.updateScopeFromTarget()
elif source == self.scope_method_combo:
self.updateScopeMethod()
def updateScopeMethod(self):
method = str(self.scope_method_combo.getSelectedItem())
if method == "Target History":
self.refresh_targets_button.setEnabled(True)
self.target_combo.setEnabled(True)
self.scope_field.setToolTipText("Select a target from dropdown")
if self.target_combo.getItemCount() == 0:
self.refreshTargets()
else:
self.refresh_targets_button.setEnabled(False)
self.target_combo.setEnabled(False)
self.scope_field.setToolTipText("Enter custom regex pattern")
def addNewRole(self):
self.role_combo.setSelectedItem(None)
self.clearPatternPanels()
self.role_name_field.setText("")
self.createPatternPair(0)
def deleteRole(self):
selected_role = str(self.role_combo.getSelectedItem()) if self.role_combo.getSelectedItem() else None
if selected_role and selected_role in self.roles:
del self.roles[selected_role]
self.role_combo.removeItem(selected_role)
self.clearPatternPanels()
self.role_name_field.setText("")
else:
self.addStatus("No role selected to delete")
def saveState(self):
try:
file_chooser = JFileChooser()
file_chooser.setDialogTitle("Save Permiter State")
default_name = "permiter_state_%s.json" % time.strftime("%Y%m%d_%H%M%S")
file_chooser.setSelectedFile(java.io.File(default_name))
json_filter = FileNameExtensionFilter("JSON files (*.json)", ["json"])
file_chooser.setFileFilter(json_filter)
result = file_chooser.showSaveDialog(self.panel)
if result == JFileChooser.APPROVE_OPTION:
selected_file = file_chooser.getSelectedFile()
file_path = selected_file.getAbsolutePath()
if not file_path.lower().endswith('.json'):
file_path += '.json'
state_data = {
"version": "1.0",
"timestamp": time.strftime("%Y-%m-%d %H:%M:%S"),
"scope_method": str(self.scope_method_combo.getSelectedItem()),
"scope_pattern": self.scope_field.getText(),
"exclude_endpoints": self.exclude_field.getText(),
"request_delay": self.delay_spinner.getValue(),
"include_unauth": self.test_unauth_checkbox.isSelected(),
"roles": self.roles,
"skip_js": self.skip_js_checkbox.isSelected(),
"skip_css": self.skip_css_checkbox.isSelected(),
"skip_images": self.skip_images_checkbox.isSelected(),
"skip_fonts": self.skip_fonts_checkbox.isSelected(),
"skip_media": self.skip_media_checkbox.isSelected(),
"use_entire_history": self.use_entire_history_checkbox.isSelected()
}
def _do_save(path, data):
try:
with open(path, 'w') as f:
f.write(json.dumps(data, indent=2))
self.addStatus("State saved to %s" % path)
except Exception as e:
self.addStatus("Error saving state: %s" % str(e))
thread = threading.Thread(target=_do_save, args=(file_path, state_data))
thread.daemon = True
thread.start()
except Exception as e:
self.addStatus("Error saving state: %s" % str(e))
def loadState(self):
try:
file_chooser = JFileChooser()
file_chooser.setDialogTitle("Load Permiter State")
json_filter = FileNameExtensionFilter("JSON files (*.json)", ["json"])
file_chooser.setFileFilter(json_filter)
result = file_chooser.showOpenDialog(self.panel)
if result == JFileChooser.APPROVE_OPTION:
selected_file = file_chooser.getSelectedFile()
file_path = selected_file.getAbsolutePath()
def _do_load(path):
try:
with open(path, 'r') as f:
state_data = json.loads(f.read())
from javax.swing import SwingUtilities
def _apply():
if "scope_method" in state_data:
self.scope_method_combo.setSelectedItem(state_data["scope_method"])
if "scope_pattern" in state_data:
self.scope_field.setText(state_data["scope_pattern"])
if "exclude_endpoints" in state_data:
self.exclude_field.setText(state_data["exclude_endpoints"])
if "request_delay" in state_data:
self.delay_spinner.setValue(state_data["request_delay"])
if "include_unauth" in state_data:
self.test_unauth_checkbox.setSelected(state_data["include_unauth"])
if "skip_js" in state_data:
self.skip_js_checkbox.setSelected(state_data["skip_js"])
if "skip_css" in state_data:
self.skip_css_checkbox.setSelected(state_data["skip_css"])
if "skip_images" in state_data:
self.skip_images_checkbox.setSelected(state_data["skip_images"])
if "skip_fonts" in state_data:
self.skip_fonts_checkbox.setSelected(state_data["skip_fonts"])
if "skip_media" in state_data:
self.skip_media_checkbox.setSelected(state_data["skip_media"])
if "roles" in state_data:
self.roles = state_data["roles"]
self.role_combo.removeAllItems()
for role_name in self.roles.keys():
self.role_combo.addItem(role_name)
if self.role_combo.getItemCount() > 0:
self.role_combo.setSelectedIndex(0)
self.loadRoleDetails()
if "use_entire_history" in state_data:
self.use_entire_history_checkbox.setSelected(state_data["use_entire_history"])
self.addStatus("State loaded from %s" % path)
SwingUtilities.invokeLater(_apply)
except Exception as e:
self.addStatus("Error loading state: %s" % str(e))
thread = threading.Thread(target=_do_load, args=(file_path,))
thread.daemon = True
thread.start()
except Exception as e:
self.addStatus("Error loading state: %s" % str(e))
def exportCSV(self):
try:
if not self.test_results:
return
file_chooser = JFileChooser()
file_chooser.setDialogTitle("Export Results to CSV")
default_name = "permiter_results_%s.csv" % time.strftime("%Y%m%d_%H%M%S")
file_chooser.setSelectedFile(java.io.File(default_name))
csv_filter = FileNameExtensionFilter("CSV files (*.csv)", ["csv"])
file_chooser.setFileFilter(csv_filter)
result = file_chooser.showSaveDialog(self.panel)
if result == JFileChooser.APPROVE_OPTION:
selected_file = file_chooser.getSelectedFile()
file_path = selected_file.getAbsolutePath()
if not file_path.lower().endswith('.csv'):
file_path += '.csv'
results_snapshot = list(self.test_results)
def _do_export_csv(path, results):
try:
with open(path, 'w') as f:
f.write("Role,Method,URL,Status Code,Response Length,Notes\n")
for result in results:
row = [
'"%s"' % result["role"].replace('"', '""'),
result["method"],
'"%s"' % result["url"].replace('"', '""'),
result["status"],
result["response_length"],
'"%s"' % result["notes"].replace('"', '""')
]
f.write(",".join(row) + "\n")
self.addStatus("CSV exported to %s" % path)
except Exception as e:
self.addStatus("Error exporting CSV: %s" % str(e))
thread = threading.Thread(target=_do_export_csv, args=(file_path, results_snapshot))
thread.daemon = True
thread.start()
except Exception as e:
self.addStatus("Error exporting CSV: %s" % str(e))
def exportHTML(self):
try:
if not self.test_results:
return
file_chooser = JFileChooser()
file_chooser.setDialogTitle("Export Results to HTML")
default_name = "permiter_results_%s.html" % time.strftime("%Y%m%d_%H%M%S")
file_chooser.setSelectedFile(java.io.File(default_name))
html_filter = FileNameExtensionFilter("HTML files (*.html)", ["html"])
file_chooser.setFileFilter(html_filter)
result = file_chooser.showSaveDialog(self.panel)
if result == JFileChooser.APPROVE_OPTION:
selected_file = file_chooser.getSelectedFile()
file_path = selected_file.getAbsolutePath()
if not file_path.lower().endswith('.html'):
file_path += '.html'
html_content = self._generateHTMLReport()
def _do_export_html(path, content):
try:
with open(path, 'w') as f:
f.write(content)
self.addStatus("HTML exported to %s" % path)
except Exception as e:
self.addStatus("Error exporting HTML: %s" % str(e))
thread = threading.Thread(target=_do_export_html, args=(file_path, html_content))
thread.daemon = True
thread.start()
except Exception as e:
self.addStatus("Error exporting HTML: %s" % str(e))
def _generateHTMLReport(self):
try:
timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
status_counts = {}
role_counts = {}
for result in self.test_results:
status = result["status"]
role = result["role"]
status_counts[status] = status_counts.get(status, 0) + 1
role_counts[role] = role_counts.get(role, 0) + 1
html = """<!DOCTYPE html>
<html>
<head>
<title>Permiter Results - {timestamp}</title>
<style>
body {{ font-family: Arial, sans-serif; margin: 20px; word-wrap: break-word; }}
table {{ border-collapse: collapse; width: 100%; font-size: 12px; table-layout: fixed; }}
th, td {{ border: 1px solid #ddd; padding: 8px; text-align: left; word-wrap: break-word; }}
.url {{ font-family: monospace; font-size: 11px; max-width: 300px; word-break: break-all; }}
.success {{ background-color: #e6ffe6; }}
.error {{ background-color: #ffe6e6; }}
.warning {{ background-color: #ffffe6; }}
.toggle-btn {{
background-color: #007cba;
color: white;
border: none;
padding: 4px 8px;
cursor: pointer;
border-radius: 3px;
font-size: 11px;
margin: 2px;
}}
.toggle-btn:hover {{ background-color: #005a8a; }}
.req-resp-container {{
display: none;
margin-top: 10px;
background-color: #f8f9fa;
border: 1px solid #dee2e6;
border-radius: 4px;
}}
.req-resp-header {{
background-color: #e9ecef;
padding: 8px;
font-weight: bold;
border-bottom: 1px solid #dee2e6;
}}
.req-resp-content {{
padding: 10px;
font-family: monospace;
font-size: 11px;
white-space: pre-wrap;
max-height: 400px;
overflow-y: auto;
background-color: #ffffff;
}}
</style>
<script>
function toggleReqResp(id) {{
var container = document.getElementById(id);
var btn = document.getElementById('btn_' + id);
if (container.style.display === 'none' || container.style.display === '') {{
container.style.display = 'block';
btn.innerHTML = 'Hide Request/Response';
}} else {{
container.style.display = 'none';
btn.innerHTML = 'Show Request/Response';
}}
}}
</script>
</head>
<body>
<div class="header">
<h1>Permiter Results</h1>
<p><strong>Generated:</strong> {timestamp}</p>
<p><strong>Scope:</strong> {scope}</p>
<p><strong>Excluded Endpoints:</strong> {excluded}</p>
<p><strong>Total Tests:</strong> {total}</p>
</div>
<div class="summary">
<h3>Summary</h3>
<p><strong>Status Codes:</strong></p>
<ul>
""".format(
timestamp=timestamp,
scope=self.scope_field.getText(),
excluded=self.exclude_field.getText(),
total=len(self.test_results)
)
for status, count in sorted(status_counts.items()):
html += " <li>HTTP {status}: {count} tests</li>\n".format(
status=status, count=count)
html += """ </ul>
<p><strong>Roles Tested:</strong></p>
<ul>
"""
for role, count in sorted(role_counts.items()):
html += " <li>{role}: {count} tests</li>\n".format(
role=role, count=count)
html += """ </ul>
</div>
<h2>Detailed Results</h2>
<table>
<thead>
<tr>
<th>Role</th>
<th>Method</th>
<th>URL</th>
<th>Status</th>
<th>Response Length</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
"""
for i, result in enumerate(self.test_results):
status_class = "success" if result["status"] == "200" else (
"error" if result["status"] in ["401", "403"] else "warning")
request_content = ""
response_content = ""
try:
if "request" in result:
request_str = self.helpers.bytesToString(result["request"])
request_content = ''.join(c if ord(c) < 128 else '?' for c in request_str)
request_content = request_content.replace('&', '&').replace('<', '<').replace('>', '>')
except:
request_content = "Error displaying request"
try:
if "response" in result:
response_str = self.helpers.bytesToString(result["response"])
response_content = ''.join(c if ord(c) < 128 else '?' for c in response_str)
response_content = response_content.replace('&', '&').replace('<', '<').replace('>', '>')
except:
response_content = "Error displaying response"
html += """ <tr>
<td>{role}</td>
<td>{method}</td>
<td class="url">{url}</td>
<td class="{status_class}">{status}</td>
<td>{response_length}</td>
<td class="notes">
{notes}
<br><button class="toggle-btn" id="btn_reqresp_{i}" onclick="toggleReqResp('reqresp_{i}')">Show Request/Response</button>
<div class="req-resp-container" id="reqresp_{i}">
<div class="req-resp-header">Request</div>
<div class="req-resp-content">{request_content}</div>
<div class="req-resp-header">Response</div>
<div class="req-resp-content">{response_content}</div>
</div>
</td>
</tr>
""".format(
role=result["role"],
method=result["method"],
url=result["url"],
status_class=status_class,
status=result["status"],
response_length=result["response_length"],
notes=result["notes"],
i=i,
request_content=request_content,
response_content=response_content
)
html += """ </tbody>
</table>
<div class="header" style="margin-top: 30px;">
<p><em>Report generated by Permiter</em></p>
</div>
</body>
</html>"""
return html
except Exception as e:
self.addStatus("Error generating HTML report: %s" % str(e))
return "<html><body><h1>Error generating report</h1></body></html>"
def testProxyHistory(self):
if not self.roles:
return
self.startTesting("Proxy History")
def testSiteMap(self):
if not self.roles:
return
self.startTesting("Site Map")
def startTesting(self, test_type):
if self.current_testing_thread and self.current_testing_thread.isAlive():
self.addStatus("Testing already in progress")
return
self.stop_testing = False
self.tested_urls.clear()
self.test_history_button.setEnabled(False)
self.test_target_button.setEnabled(False)
self.stop_test_button.setEnabled(True)
if test_type == "Proxy History":
self.current_testing_thread = threading.Thread(target=self._testProxyHistoryBackground)
else:
self.current_testing_thread = threading.Thread(target=self._testSiteMapBackground)
self.current_testing_thread.daemon = True
self.current_testing_thread.start()
def stopTesting(self):
self.stop_testing = True
self.test_history_button.setEnabled(True)
self.test_target_button.setEnabled(True)
self.stop_test_button.setEnabled(False)
def _testProxyHistoryBackground(self):
try:
proxy_history = self.callbacks.getProxyHistory()
scope_pattern = self.scope_field.getText().strip()
tested_count = 0
for request_response in proxy_history:
if self.stop_testing:
break
if self._isInScope(request_response, scope_pattern) and not self._isExcluded(request_response):
if self._testRequestWithAllRoles(request_response, "Proxy History"):
tested_count += 1
except Exception as e:
self.addStatus("Error in proxy history testing: %s" % str(e))
finally:
self.stopTesting()
def _testSiteMapBackground(self):
try:
site_map = self.callbacks.getSiteMap(None)
scope_pattern = self.scope_field.getText().strip()
tested_count = 0
for request_response in site_map:
if self.stop_testing:
break
if self._isInScope(request_response, scope_pattern) and not self._isExcluded(request_response):
if self._testRequestWithAllRoles(request_response, "Site Map"):
tested_count += 1
except Exception as e:
self.addStatus("Error in site map testing: %s" % str(e))
finally:
self.stopTesting()
def _isInScope(self, request_response, scope_pattern):
if not scope_pattern:
return True
try:
service = request_response.getHttpService()
request_info = self.helpers.analyzeRequest(service, request_response.getRequest())
port_str = ""
if service.getPort() != 80 and service.getPort() != 443:
port_str = ":%d" % service.getPort()
url = "%s://%s%s%s" % (service.getProtocol(), service.getHost(), port_str, request_info.getUrl().getPath())
return re.match(scope_pattern, url) is not None
except:
return False
def _isExcluded(self, request_response):
exclude_patterns = self.exclude_field.getText().strip()
if not exclude_patterns:
return False
try:
service = request_response.getHttpService()
request_info = self.helpers.analyzeRequest(service, request_response.getRequest())
path = request_info.getUrl().getPath()
for pattern in exclude_patterns.split(','):
pattern = pattern.strip()
if not pattern:
continue
try:
if re.search(pattern, path, re.IGNORECASE):
return True
except:
if pattern.lower() in path.lower():
return True
return False
except:
return False
def _testRequestWithAllRoles(self, original_request_response, test_type):
if self._isStaticResource(original_request_response):
return False
try:
original_request = original_request_response.getRequest()
service = original_request_response.getHttpService()
request_info = self.helpers.analyzeRequest(service, original_request)
port_str = ""
if service.getPort() != 80 and service.getPort() != 443:
port_str = ":%d" % service.getPort()
url = "%s://%s%s%s" % (service.getProtocol(), service.getHost(), port_str, request_info.getUrl().getPath())
method = request_info.getMethod()
url_key = "%s %s" % (method, url)
if not self.use_entire_history_checkbox.isSelected() and url_key in self.tested_urls:
return False
if not self.use_entire_history_checkbox.isSelected():
self.tested_urls.add(url_key)
test_threads = []
for role_name, role_data in self.roles.items():
if self.stop_testing:
break
thread = threading.Thread(target=self._testSingleRole, args=(
original_request_response, test_type, role_name, role_data, url, method, service
))
thread.daemon = True
test_threads.append(thread)
thread.start()
if self.test_unauth_checkbox.isSelected():
thread = threading.Thread(target=self._testUnauthenticated, args=(
original_request_response, test_type, url, method, service
))
thread.daemon = True
test_threads.append(thread)
thread.start()
for thread in test_threads:
thread.join()
return True
except Exception as e:
self.addStatus("Error in _testRequestWithAllRoles: %s" % str(e))
return False
def _testSingleRole(self, original_request_response, test_type, role_name, role_data, url, method, service):
try:
if self.stop_testing:
return
original_request = original_request_response.getRequest()
test_description = self._getTestDescription(role_name, role_data, service.getPort())
modified_request = self._applyRoleToRequest(original_request, role_data)
if modified_request: