pwn 0.5.508 → 0.5.509
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- metadata +24 -1131
- data/.github/FUNDING.yml +0 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +0 -38
- data/.gitignore +0 -65
- data/.rubocop.yml +0 -35
- data/.rubocop_todo.yml +0 -178
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.travis.yml +0 -24
- data/CHANGELOG_BETWEEN_TAGS.txt +0 -185
- data/CODE_OF_CONDUCT.md +0 -46
- data/CONTRIBUTING.md +0 -13
- data/Gemfile +0 -107
- data/LICENSE.txt +0 -22
- data/README.md +0 -100
- data/Rakefile +0 -20
- data/Vagrantfile +0 -250
- data/bin/pwn +0 -30
- data/bin/pwn_android_war_dialer +0 -151
- data/bin/pwn_autoinc_version +0 -58
- data/bin/pwn_aws_describe_resources +0 -717
- data/bin/pwn_bdba_groups +0 -107
- data/bin/pwn_bdba_scan +0 -198
- data/bin/pwn_burp_suite_pro_active_rest_api_scan +0 -167
- data/bin/pwn_burp_suite_pro_active_scan +0 -132
- data/bin/pwn_char_base64_encoding +0 -15
- data/bin/pwn_char_dec_encoding +0 -14
- data/bin/pwn_char_hex_escaped_encoding +0 -17
- data/bin/pwn_char_html_entity_encoding +0 -15
- data/bin/pwn_char_unicode_escaped_encoding +0 -14
- data/bin/pwn_char_url_encoding +0 -15
- data/bin/pwn_crt_sh +0 -73
- data/bin/pwn_defectdojo_engagement_create +0 -148
- data/bin/pwn_defectdojo_importscan +0 -130
- data/bin/pwn_defectdojo_reimportscan +0 -118
- data/bin/pwn_diff_csv_files_w_column_exclude +0 -171
- data/bin/pwn_domain_reversewhois +0 -76
- data/bin/pwn_fuzz_net_app_proto +0 -170
- data/bin/pwn_gqrx_scanner +0 -196
- data/bin/pwn_jenkins_create_job +0 -58
- data/bin/pwn_jenkins_create_view +0 -58
- data/bin/pwn_jenkins_install_plugin +0 -83
- data/bin/pwn_jenkins_thinBackup_aws_s3 +0 -113
- data/bin/pwn_jenkins_update_plugins +0 -77
- data/bin/pwn_jenkins_useradd +0 -76
- data/bin/pwn_mail_agent +0 -114
- data/bin/pwn_msf_postgres_login +0 -28
- data/bin/pwn_nessus_cloud_scan_crud +0 -334
- data/bin/pwn_nessus_cloud_vulnscan +0 -87
- data/bin/pwn_nexpose +0 -42
- data/bin/pwn_nmap_discover_tcp_udp +0 -353
- data/bin/pwn_openvas_vulnscan +0 -104
- data/bin/pwn_pastebin_sample_filter +0 -47
- data/bin/pwn_phone +0 -129
- data/bin/pwn_rdoc_to_jsonl +0 -83
- data/bin/pwn_sast +0 -183
- data/bin/pwn_serial_check_voicemail +0 -56
- data/bin/pwn_serial_msr206 +0 -168
- data/bin/pwn_serial_qualcomm_commands +0 -16
- data/bin/pwn_serial_son_micro_sm132_rfid +0 -188
- data/bin/pwn_shodan_graphql_introspection +0 -304
- data/bin/pwn_shodan_search +0 -90
- data/bin/pwn_simple_http_server +0 -44
- data/bin/pwn_web_cache_deception +0 -205
- data/bin/pwn_www_checkip +0 -77
- data/bin/pwn_www_uri_buster +0 -363
- data/bin/pwn_xss_dom_vectors +0 -149
- data/bin/pwn_zaproxy_active_rest_api_scan +0 -159
- data/bin/pwn_zaproxy_active_scan +0 -130
- data/build_pwn_gem.sh +0 -33
- data/documentation/PWN.png +0 -0
- data/documentation/PWN_Contributors_and_Users.png +0 -0
- data/documentation/fax-spectrogram.png +0 -0
- data/documentation/fax-waveform.png +0 -0
- data/documentation/frozen_string_literal_files_changed_from_false_to_true.txt +0 -54
- data/documentation/pwn_android_war_dialer_session.png +0 -0
- data/documentation/pwn_install.png +0 -0
- data/documentation/pwn_wallpaper.jpg +0 -0
- data/documentation/ringing-spectrogram.png +0 -0
- data/documentation/ringing-waveform.png +0 -0
- data/etc/systemd/msfrpcd.service +0 -12
- data/etc/systemd/openvas.service +0 -14
- data/etc/userland/aws/apache2/jenkins_443.conf +0 -90
- data/etc/userland/aws/apache2/jenkins_80.conf +0 -7
- data/etc/userland/aws/apache2/openvas_443.conf +0 -87
- data/etc/userland/aws/apache2/openvas_80.conf +0 -7
- data/etc/userland/aws/apache2/sast_443.conf +0 -87
- data/etc/userland/aws/apache2/sast_80.conf +0 -9
- data/etc/userland/aws/apache2/vagrant.yaml.EXAMPLE +0 -9
- data/etc/userland/aws/arachni/navigation-REST.instruct.EXAMPLE +0 -29
- data/etc/userland/aws/arachni/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/aws/burpsuite/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/aws/burpsuite/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/aws/defectdojo/vagrant.yaml.EXAMPLE +0 -3
- data/etc/userland/aws/jenkins/inject_build_envs.sh +0 -15
- data/etc/userland/aws/jenkins/jenkins +0 -81
- data/etc/userland/aws/jenkins/jobs/pipeline-pwntemplate.xml +0 -298
- data/etc/userland/aws/jenkins/jobs/pipeline-selfupdate.xml +0 -462
- data/etc/userland/aws/jenkins/jobs/pwntemplate-DOMAIN-burpsuite.xml +0 -44
- data/etc/userland/aws/jenkins/jobs/pwntemplate-DOMAIN-owasp_zap.xml +0 -35
- data/etc/userland/aws/jenkins/jobs/pwntemplate-DOMAIN-ssllabs-scan.xml +0 -45
- data/etc/userland/aws/jenkins/jobs/pwntemplate-GITREPO_BRANCH-sast.xml +0 -71
- data/etc/userland/aws/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_discovery_scan_tcp_udp_65k.xml +0 -56
- data/etc/userland/aws/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_xml_results_searchsploit.xml +0 -59
- data/etc/userland/aws/jenkins/jobs/pwntemplate-NETWORKRANGE-openvas.xml +0 -45
- data/etc/userland/aws/jenkins/jobs/selfupdate-exploit-db.xml +0 -43
- data/etc/userland/aws/jenkins/jobs/selfupdate-gem.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-jenkins_plugins.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-metasploit.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-nmap_all_live_hosts.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-openvas_sync.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-openvas_wrappers.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-os.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-pwn.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-rvm.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-ssllabs-scan.xml +0 -42
- data/etc/userland/aws/jenkins/jobs/selfupdate-wpscan.xml +0 -42
- data/etc/userland/aws/jenkins/jobs_userland/.gitkeep +0 -0
- data/etc/userland/aws/jenkins/log_parser_rules/arachni.rules +0 -5
- data/etc/userland/aws/jenkins/log_parser_rules/sast.rules +0 -2
- data/etc/userland/aws/jenkins/log_parser_rules/self_update.rules +0 -14
- data/etc/userland/aws/jenkins/log_parser_rules/ssllabs-scan.rules +0 -8
- data/etc/userland/aws/jenkins/log_parser_rules/system_maintenance.rules +0 -9
- data/etc/userland/aws/jenkins/log_parser_rules/wpscan.rules +0 -2
- data/etc/userland/aws/jenkins/vagrant.yaml.EXAMPLE +0 -8
- data/etc/userland/aws/letsencrypt/vagrant.yaml.EXAMPLE +0 -5
- data/etc/userland/aws/metasploit/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/aws/nessus/vagrant.yaml.EXAMPLE +0 -15
- data/etc/userland/aws/openvas/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/aws/owasp_zap/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/aws/postgres/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/aws/recon-ng/vagrant.yaml.EXAMPLE +0 -52
- data/etc/userland/aws/vagrant.yaml.EXAMPLE +0 -35
- data/etc/userland/docker/apache2/jenkins_443.conf +0 -90
- data/etc/userland/docker/apache2/jenkins_80.conf +0 -7
- data/etc/userland/docker/apache2/openvas_443.conf +0 -87
- data/etc/userland/docker/apache2/openvas_80.conf +0 -7
- data/etc/userland/docker/apache2/sast_443.conf +0 -87
- data/etc/userland/docker/apache2/sast_80.conf +0 -9
- data/etc/userland/docker/apache2/vagrant.yaml.EXAMPLE +0 -9
- data/etc/userland/docker/arachni/navigation-REST.instruct.EXAMPLE +0 -29
- data/etc/userland/docker/arachni/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/docker/burpsuite/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/docker/burpsuite/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/docker/defectdojo/vagrant.yaml.EXAMPLE +0 -3
- data/etc/userland/docker/jenkins/inject_build_envs.sh +0 -15
- data/etc/userland/docker/jenkins/jenkins +0 -81
- data/etc/userland/docker/jenkins/jobs/pipeline-pwntemplate.xml +0 -298
- data/etc/userland/docker/jenkins/jobs/pipeline-selfupdate.xml +0 -462
- data/etc/userland/docker/jenkins/jobs/pwntemplate-DOMAIN-burpsuite.xml +0 -44
- data/etc/userland/docker/jenkins/jobs/pwntemplate-DOMAIN-owasp_zap.xml +0 -35
- data/etc/userland/docker/jenkins/jobs/pwntemplate-DOMAIN-ssllabs-scan.xml +0 -45
- data/etc/userland/docker/jenkins/jobs/pwntemplate-GITREPO_BRANCH-sast.xml +0 -71
- data/etc/userland/docker/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_discovery_scan_tcp_udp_65k.xml +0 -56
- data/etc/userland/docker/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_xml_results_searchsploit.xml +0 -59
- data/etc/userland/docker/jenkins/jobs/pwntemplate-NETWORKRANGE-openvas.xml +0 -45
- data/etc/userland/docker/jenkins/jobs/selfupdate-exploit-db.xml +0 -43
- data/etc/userland/docker/jenkins/jobs/selfupdate-gem.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-jenkins_plugins.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-metasploit.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-nmap_all_live_hosts.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-openvas_sync.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-openvas_wrappers.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-os.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-pwn.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-rvm.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-ssllabs-scan.xml +0 -42
- data/etc/userland/docker/jenkins/jobs/selfupdate-wpscan.xml +0 -42
- data/etc/userland/docker/jenkins/jobs_userland/.gitkeep +0 -0
- data/etc/userland/docker/jenkins/log_parser_rules/arachni.rules +0 -5
- data/etc/userland/docker/jenkins/log_parser_rules/sast.rules +0 -2
- data/etc/userland/docker/jenkins/log_parser_rules/self_update.rules +0 -14
- data/etc/userland/docker/jenkins/log_parser_rules/ssllabs-scan.rules +0 -8
- data/etc/userland/docker/jenkins/log_parser_rules/system_maintenance.rules +0 -9
- data/etc/userland/docker/jenkins/log_parser_rules/wpscan.rules +0 -2
- data/etc/userland/docker/jenkins/vagrant.yaml.EXAMPLE +0 -8
- data/etc/userland/docker/letsencrypt/vagrant.yaml.EXAMPLE +0 -5
- data/etc/userland/docker/metasploit/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/docker/nessus/vagrant.yaml.EXAMPLE +0 -15
- data/etc/userland/docker/openvas/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/docker/owasp_zap/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/docker/postgres/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/docker/recon-ng/vagrant.yaml.EXAMPLE +0 -52
- data/etc/userland/qemu/apache2/jenkins_443.conf +0 -90
- data/etc/userland/qemu/apache2/jenkins_80.conf +0 -7
- data/etc/userland/qemu/apache2/openvas_443.conf +0 -87
- data/etc/userland/qemu/apache2/openvas_80.conf +0 -7
- data/etc/userland/qemu/apache2/sast_443.conf +0 -87
- data/etc/userland/qemu/apache2/sast_80.conf +0 -9
- data/etc/userland/qemu/apache2/vagrant.yaml.EXAMPLE +0 -9
- data/etc/userland/qemu/arachni/navigation-REST.instruct.EXAMPLE +0 -29
- data/etc/userland/qemu/arachni/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/qemu/burpsuite/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/qemu/burpsuite/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/qemu/defectdojo/vagrant.yaml.EXAMPLE +0 -3
- data/etc/userland/qemu/jenkins/inject_build_envs.sh +0 -15
- data/etc/userland/qemu/jenkins/jenkins +0 -81
- data/etc/userland/qemu/jenkins/jobs/pipeline-pwntemplate.xml +0 -298
- data/etc/userland/qemu/jenkins/jobs/pipeline-selfupdate.xml +0 -462
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-DOMAIN-burpsuite.xml +0 -44
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-DOMAIN-owasp_zap.xml +0 -35
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-DOMAIN-ssllabs-scan.xml +0 -45
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-GITREPO_BRANCH-sast.xml +0 -71
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_discovery_scan_tcp_udp_65k.xml +0 -56
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_xml_results_searchsploit.xml +0 -59
- data/etc/userland/qemu/jenkins/jobs/pwntemplate-NETWORKRANGE-openvas.xml +0 -45
- data/etc/userland/qemu/jenkins/jobs/selfupdate-exploit-db.xml +0 -43
- data/etc/userland/qemu/jenkins/jobs/selfupdate-gem.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-jenkins_plugins.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-metasploit.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-nmap_all_live_hosts.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-openvas_sync.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-openvas_wrappers.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-os.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-pwn.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-rvm.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-ssllabs-scan.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs/selfupdate-wpscan.xml +0 -42
- data/etc/userland/qemu/jenkins/jobs_userland/.gitkeep +0 -0
- data/etc/userland/qemu/jenkins/log_parser_rules/arachni.rules +0 -5
- data/etc/userland/qemu/jenkins/log_parser_rules/sast.rules +0 -2
- data/etc/userland/qemu/jenkins/log_parser_rules/self_update.rules +0 -14
- data/etc/userland/qemu/jenkins/log_parser_rules/ssllabs-scan.rules +0 -8
- data/etc/userland/qemu/jenkins/log_parser_rules/system_maintenance.rules +0 -9
- data/etc/userland/qemu/jenkins/log_parser_rules/wpscan.rules +0 -2
- data/etc/userland/qemu/jenkins/vagrant.yaml.EXAMPLE +0 -8
- data/etc/userland/qemu/letsencrypt/vagrant.yaml.EXAMPLE +0 -5
- data/etc/userland/qemu/metasploit/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/qemu/nessus/vagrant.yaml.EXAMPLE +0 -15
- data/etc/userland/qemu/openvas/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/qemu/owasp_zap/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/qemu/postgres/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/qemu/recon-ng/vagrant.yaml.EXAMPLE +0 -52
- data/etc/userland/ruby-gem/apache2/jenkins_443.conf +0 -90
- data/etc/userland/ruby-gem/apache2/jenkins_80.conf +0 -7
- data/etc/userland/ruby-gem/apache2/openvas_443.conf +0 -87
- data/etc/userland/ruby-gem/apache2/openvas_80.conf +0 -7
- data/etc/userland/ruby-gem/apache2/sast_443.conf +0 -87
- data/etc/userland/ruby-gem/apache2/sast_80.conf +0 -9
- data/etc/userland/ruby-gem/apache2/vagrant.yaml.EXAMPLE +0 -9
- data/etc/userland/ruby-gem/arachni/navigation-REST.instruct.EXAMPLE +0 -29
- data/etc/userland/ruby-gem/arachni/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/ruby-gem/burpsuite/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/ruby-gem/burpsuite/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/ruby-gem/defectdojo/vagrant.yaml.EXAMPLE +0 -3
- data/etc/userland/ruby-gem/jenkins/inject_build_envs.sh +0 -15
- data/etc/userland/ruby-gem/jenkins/jenkins +0 -81
- data/etc/userland/ruby-gem/jenkins/jobs/pipeline-pwntemplate.xml +0 -298
- data/etc/userland/ruby-gem/jenkins/jobs/pipeline-selfupdate.xml +0 -462
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-DOMAIN-burpsuite.xml +0 -44
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-DOMAIN-owasp_zap.xml +0 -35
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-DOMAIN-ssllabs-scan.xml +0 -45
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-GITREPO_BRANCH-sast.xml +0 -71
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_discovery_scan_tcp_udp_65k.xml +0 -56
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_xml_results_searchsploit.xml +0 -59
- data/etc/userland/ruby-gem/jenkins/jobs/pwntemplate-NETWORKRANGE-openvas.xml +0 -45
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-exploit-db.xml +0 -43
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-gem.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-jenkins_plugins.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-metasploit.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-nmap_all_live_hosts.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-openvas_sync.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-openvas_wrappers.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-os.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-pwn.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-rvm.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-ssllabs-scan.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs/selfupdate-wpscan.xml +0 -42
- data/etc/userland/ruby-gem/jenkins/jobs_userland/.gitkeep +0 -0
- data/etc/userland/ruby-gem/jenkins/log_parser_rules/arachni.rules +0 -5
- data/etc/userland/ruby-gem/jenkins/log_parser_rules/sast.rules +0 -2
- data/etc/userland/ruby-gem/jenkins/log_parser_rules/self_update.rules +0 -14
- data/etc/userland/ruby-gem/jenkins/log_parser_rules/ssllabs-scan.rules +0 -8
- data/etc/userland/ruby-gem/jenkins/log_parser_rules/system_maintenance.rules +0 -9
- data/etc/userland/ruby-gem/jenkins/log_parser_rules/wpscan.rules +0 -2
- data/etc/userland/ruby-gem/jenkins/vagrant.yaml.EXAMPLE +0 -8
- data/etc/userland/ruby-gem/letsencrypt/vagrant.yaml.EXAMPLE +0 -5
- data/etc/userland/ruby-gem/metasploit/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/ruby-gem/nessus/vagrant.yaml.EXAMPLE +0 -15
- data/etc/userland/ruby-gem/openvas/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/ruby-gem/owasp_zap/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/ruby-gem/postgres/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/ruby-gem/recon-ng/vagrant.yaml.EXAMPLE +0 -52
- data/etc/userland/virtualbox/apache2/jenkins_443.conf +0 -90
- data/etc/userland/virtualbox/apache2/jenkins_80.conf +0 -7
- data/etc/userland/virtualbox/apache2/openvas_443.conf +0 -87
- data/etc/userland/virtualbox/apache2/openvas_80.conf +0 -7
- data/etc/userland/virtualbox/apache2/sast_443.conf +0 -87
- data/etc/userland/virtualbox/apache2/sast_80.conf +0 -9
- data/etc/userland/virtualbox/apache2/vagrant.yaml.EXAMPLE +0 -9
- data/etc/userland/virtualbox/arachni/navigation-REST.instruct.EXAMPLE +0 -29
- data/etc/userland/virtualbox/arachni/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/virtualbox/burpsuite/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/virtualbox/burpsuite/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/virtualbox/defectdojo/vagrant.yaml.EXAMPLE +0 -3
- data/etc/userland/virtualbox/jenkins/inject_build_envs.sh +0 -15
- data/etc/userland/virtualbox/jenkins/jenkins +0 -81
- data/etc/userland/virtualbox/jenkins/jobs/pipeline-pwntemplate.xml +0 -298
- data/etc/userland/virtualbox/jenkins/jobs/pipeline-selfupdate.xml +0 -462
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-DOMAIN-burpsuite.xml +0 -44
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-DOMAIN-owasp_zap.xml +0 -35
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-DOMAIN-ssllabs-scan.xml +0 -45
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-GITREPO_BRANCH-sast.xml +0 -71
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_discovery_scan_tcp_udp_65k.xml +0 -56
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_xml_results_searchsploit.xml +0 -59
- data/etc/userland/virtualbox/jenkins/jobs/pwntemplate-NETWORKRANGE-openvas.xml +0 -45
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-exploit-db.xml +0 -43
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-gem.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-jenkins_plugins.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-metasploit.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-nmap_all_live_hosts.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-openvas_sync.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-openvas_wrappers.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-os.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-pwn.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-rvm.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-ssllabs-scan.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs/selfupdate-wpscan.xml +0 -42
- data/etc/userland/virtualbox/jenkins/jobs_userland/.gitkeep +0 -0
- data/etc/userland/virtualbox/jenkins/log_parser_rules/arachni.rules +0 -5
- data/etc/userland/virtualbox/jenkins/log_parser_rules/sast.rules +0 -2
- data/etc/userland/virtualbox/jenkins/log_parser_rules/self_update.rules +0 -14
- data/etc/userland/virtualbox/jenkins/log_parser_rules/ssllabs-scan.rules +0 -8
- data/etc/userland/virtualbox/jenkins/log_parser_rules/system_maintenance.rules +0 -9
- data/etc/userland/virtualbox/jenkins/log_parser_rules/wpscan.rules +0 -2
- data/etc/userland/virtualbox/jenkins/vagrant.yaml.EXAMPLE +0 -8
- data/etc/userland/virtualbox/letsencrypt/vagrant.yaml.EXAMPLE +0 -5
- data/etc/userland/virtualbox/metasploit/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/virtualbox/nessus/vagrant.yaml.EXAMPLE +0 -15
- data/etc/userland/virtualbox/openvas/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/virtualbox/owasp_zap/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/virtualbox/postgres/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/virtualbox/recon-ng/vagrant.yaml.EXAMPLE +0 -52
- data/etc/userland/virtualbox/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/vmware/apache2/jenkins_443.conf +0 -90
- data/etc/userland/vmware/apache2/jenkins_80.conf +0 -7
- data/etc/userland/vmware/apache2/openvas_443.conf +0 -87
- data/etc/userland/vmware/apache2/openvas_80.conf +0 -7
- data/etc/userland/vmware/apache2/sast_443.conf +0 -87
- data/etc/userland/vmware/apache2/sast_80.conf +0 -9
- data/etc/userland/vmware/apache2/vagrant.yaml.EXAMPLE +0 -9
- data/etc/userland/vmware/arachni/navigation-REST.instruct.EXAMPLE +0 -29
- data/etc/userland/vmware/arachni/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/vmware/burpsuite/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/vmware/burpsuite/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/vmware/defectdojo/vagrant.yaml.EXAMPLE +0 -3
- data/etc/userland/vmware/jenkins/inject_build_envs.sh +0 -15
- data/etc/userland/vmware/jenkins/jenkins +0 -81
- data/etc/userland/vmware/jenkins/jobs/pipeline-pwntemplate.xml +0 -298
- data/etc/userland/vmware/jenkins/jobs/pipeline-selfupdate.xml +0 -462
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-DOMAIN-burpsuite.xml +0 -44
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-DOMAIN-owasp_zap.xml +0 -35
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-DOMAIN-ssllabs-scan.xml +0 -45
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-GITREPO_BRANCH-sast.xml +0 -71
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_discovery_scan_tcp_udp_65k.xml +0 -56
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-NETWORKRANGE-nmap_xml_results_searchsploit.xml +0 -59
- data/etc/userland/vmware/jenkins/jobs/pwntemplate-NETWORKRANGE-openvas.xml +0 -45
- data/etc/userland/vmware/jenkins/jobs/selfupdate-exploit-db.xml +0 -43
- data/etc/userland/vmware/jenkins/jobs/selfupdate-gem.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-jenkins_plugins.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-metasploit.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-nmap_all_live_hosts.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-openvas_sync.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-openvas_wrappers.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-os.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-pwn.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-rvm.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-ssllabs-scan.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs/selfupdate-wpscan.xml +0 -42
- data/etc/userland/vmware/jenkins/jobs_userland/.gitkeep +0 -0
- data/etc/userland/vmware/jenkins/log_parser_rules/arachni.rules +0 -5
- data/etc/userland/vmware/jenkins/log_parser_rules/sast.rules +0 -2
- data/etc/userland/vmware/jenkins/log_parser_rules/self_update.rules +0 -14
- data/etc/userland/vmware/jenkins/log_parser_rules/ssllabs-scan.rules +0 -8
- data/etc/userland/vmware/jenkins/log_parser_rules/system_maintenance.rules +0 -9
- data/etc/userland/vmware/jenkins/log_parser_rules/wpscan.rules +0 -2
- data/etc/userland/vmware/jenkins/vagrant.yaml.EXAMPLE +0 -8
- data/etc/userland/vmware/letsencrypt/vagrant.yaml.EXAMPLE +0 -5
- data/etc/userland/vmware/metasploit/vagrant.yaml.EXAMPLE +0 -4
- data/etc/userland/vmware/nessus/vagrant.yaml.EXAMPLE +0 -15
- data/etc/userland/vmware/openvas/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/vmware/owasp_zap/navigation.instruct.EXAMPLE +0 -3
- data/etc/userland/vmware/postgres/vagrant.yaml.EXAMPLE +0 -2
- data/etc/userland/vmware/recon-ng/vagrant.yaml.EXAMPLE +0 -52
- data/etc/userland/vmware/vagrant.yaml.EXAMPLE +0 -5
- data/find_latest_gem_versions_per_Gemfile.sh +0 -19
- data/git_commit_test_reinit_gem.sh +0 -57
- data/install.sh +0 -177
- data/lib/pwn/ai/grok.rb +0 -258
- data/lib/pwn/ai/introspection.rb +0 -100
- data/lib/pwn/ai/ollama.rb +0 -260
- data/lib/pwn/ai/open_ai.rb +0 -807
- data/lib/pwn/ai.rb +0 -19
- data/lib/pwn/aws/acm.rb +0 -92
- data/lib/pwn/aws/api_gateway.rb +0 -92
- data/lib/pwn/aws/app_stream.rb +0 -92
- data/lib/pwn/aws/application_auto_scaling.rb +0 -92
- data/lib/pwn/aws/application_discovery_service.rb +0 -92
- data/lib/pwn/aws/auto_scaling.rb +0 -92
- data/lib/pwn/aws/batch.rb +0 -92
- data/lib/pwn/aws/budgets.rb +0 -92
- data/lib/pwn/aws/cloud_formation.rb +0 -92
- data/lib/pwn/aws/cloud_front.rb +0 -92
- data/lib/pwn/aws/cloud_hsm.rb +0 -92
- data/lib/pwn/aws/cloud_search.rb +0 -92
- data/lib/pwn/aws/cloud_search_domain.rb +0 -92
- data/lib/pwn/aws/cloud_trail.rb +0 -92
- data/lib/pwn/aws/cloud_watch.rb +0 -92
- data/lib/pwn/aws/cloud_watch_events.rb +0 -92
- data/lib/pwn/aws/cloud_watch_logs.rb +0 -92
- data/lib/pwn/aws/code_build.rb +0 -92
- data/lib/pwn/aws/code_commit.rb +0 -92
- data/lib/pwn/aws/code_deploy.rb +0 -92
- data/lib/pwn/aws/code_pipeline.rb +0 -92
- data/lib/pwn/aws/cognito_identity.rb +0 -92
- data/lib/pwn/aws/cognito_identity_provider.rb +0 -92
- data/lib/pwn/aws/cognito_sync.rb +0 -92
- data/lib/pwn/aws/config_service.rb +0 -92
- data/lib/pwn/aws/data_pipleline.rb +0 -92
- data/lib/pwn/aws/database_migration_service.rb +0 -92
- data/lib/pwn/aws/device_farm.rb +0 -92
- data/lib/pwn/aws/direct_connect.rb +0 -92
- data/lib/pwn/aws/directory_service.rb +0 -92
- data/lib/pwn/aws/dynamo_db.rb +0 -92
- data/lib/pwn/aws/dynamo_db_streams.rb +0 -92
- data/lib/pwn/aws/ec2.rb +0 -92
- data/lib/pwn/aws/ecr.rb +0 -92
- data/lib/pwn/aws/ecs.rb +0 -92
- data/lib/pwn/aws/efs.rb +0 -92
- data/lib/pwn/aws/elasti_cache.rb +0 -92
- data/lib/pwn/aws/elastic_beanstalk.rb +0 -89
- data/lib/pwn/aws/elastic_load_balancing.rb +0 -92
- data/lib/pwn/aws/elastic_load_balancing_v2.rb +0 -92
- data/lib/pwn/aws/elastic_transcoder.rb +0 -92
- data/lib/pwn/aws/elasticsearch_service.rb +0 -92
- data/lib/pwn/aws/emr.rb +0 -92
- data/lib/pwn/aws/firehose.rb +0 -92
- data/lib/pwn/aws/game_lift.rb +0 -92
- data/lib/pwn/aws/glacier.rb +0 -92
- data/lib/pwn/aws/health.rb +0 -92
- data/lib/pwn/aws/iam.rb +0 -200
- data/lib/pwn/aws/import_export.rb +0 -92
- data/lib/pwn/aws/inspector.rb +0 -92
- data/lib/pwn/aws/iot.rb +0 -92
- data/lib/pwn/aws/iot_data_plane.rb +0 -92
- data/lib/pwn/aws/kinesis.rb +0 -92
- data/lib/pwn/aws/kinesis_analytics.rb +0 -92
- data/lib/pwn/aws/kms.rb +0 -92
- data/lib/pwn/aws/lambda.rb +0 -92
- data/lib/pwn/aws/lambda_preview.rb +0 -92
- data/lib/pwn/aws/lex.rb +0 -92
- data/lib/pwn/aws/lightsail.rb +0 -92
- data/lib/pwn/aws/machine_learning.rb +0 -92
- data/lib/pwn/aws/marketplace_commerce_analytics.rb +0 -92
- data/lib/pwn/aws/marketplace_metering.rb +0 -92
- data/lib/pwn/aws/ops_works.rb +0 -92
- data/lib/pwn/aws/ops_works_cm.rb +0 -92
- data/lib/pwn/aws/pinpoint.rb +0 -92
- data/lib/pwn/aws/polly.rb +0 -92
- data/lib/pwn/aws/rds.rb +0 -92
- data/lib/pwn/aws/redshift.rb +0 -92
- data/lib/pwn/aws/rekognition.rb +0 -92
- data/lib/pwn/aws/route53.rb +0 -92
- data/lib/pwn/aws/route53_domains.rb +0 -92
- data/lib/pwn/aws/s3.rb +0 -92
- data/lib/pwn/aws/service_catalog.rb +0 -92
- data/lib/pwn/aws/ses.rb +0 -92
- data/lib/pwn/aws/shield.rb +0 -92
- data/lib/pwn/aws/simple_db.rb +0 -92
- data/lib/pwn/aws/sms.rb +0 -92
- data/lib/pwn/aws/snowball.rb +0 -92
- data/lib/pwn/aws/sns.rb +0 -92
- data/lib/pwn/aws/sqs.rb +0 -92
- data/lib/pwn/aws/ssm.rb +0 -92
- data/lib/pwn/aws/states.rb +0 -92
- data/lib/pwn/aws/storage_gateway.rb +0 -92
- data/lib/pwn/aws/sts.rb +0 -63
- data/lib/pwn/aws/support.rb +0 -92
- data/lib/pwn/aws/swf.rb +0 -92
- data/lib/pwn/aws/waf.rb +0 -92
- data/lib/pwn/aws/waf_regional.rb +0 -92
- data/lib/pwn/aws/workspaces.rb +0 -92
- data/lib/pwn/aws/x_ray.rb +0 -92
- data/lib/pwn/aws.rb +0 -105
- data/lib/pwn/banner/anon.rb +0 -50
- data/lib/pwn/banner/bubble.rb +0 -42
- data/lib/pwn/banner/cheshire.rb +0 -58
- data/lib/pwn/banner/code_cave.rb +0 -1035
- data/lib/pwn/banner/dont_panic.rb +0 -52
- data/lib/pwn/banner/f_society.rb +0 -60
- data/lib/pwn/banner/fork_bomb.rb +0 -39
- data/lib/pwn/banner/jmp_esp.rb +0 -44
- data/lib/pwn/banner/matrix.rb +0 -206
- data/lib/pwn/banner/ninja.rb +0 -55
- data/lib/pwn/banner/off_the_air.rb +0 -73
- data/lib/pwn/banner/pirate.rb +0 -62
- data/lib/pwn/banner/radare2.rb +0 -41
- data/lib/pwn/banner/radare2_ai.rb +0 -116
- data/lib/pwn/banner/white_rabbit.rb +0 -55
- data/lib/pwn/banner.rb +0 -108
- data/lib/pwn/blockchain/btc.rb +0 -282
- data/lib/pwn/blockchain/eth.rb +0 -160
- data/lib/pwn/blockchain.rb +0 -17
- data/lib/pwn/config.rb +0 -304
- data/lib/pwn/driver.rb +0 -85
- data/lib/pwn/ffi/stdio.rb +0 -41
- data/lib/pwn/ffi.rb +0 -16
- data/lib/pwn/plugins/android.rb +0 -1617
- data/lib/pwn/plugins/assembly.rb +0 -275
- data/lib/pwn/plugins/authentication_helper.rb +0 -86
- data/lib/pwn/plugins/baresip.rb +0 -708
- data/lib/pwn/plugins/basic_auth.rb +0 -63
- data/lib/pwn/plugins/beef.rb +0 -312
- data/lib/pwn/plugins/black_duck_binary_analysis.rb +0 -790
- data/lib/pwn/plugins/burp_suite.rb +0 -2208
- data/lib/pwn/plugins/bus_pirate.rb +0 -147
- data/lib/pwn/plugins/char.rb +0 -474
- data/lib/pwn/plugins/credit_card.rb +0 -105
- data/lib/pwn/plugins/dao_ldap.rb +0 -131
- data/lib/pwn/plugins/dao_mongo.rb +0 -96
- data/lib/pwn/plugins/dao_postgres.rb +0 -224
- data/lib/pwn/plugins/dao_sqlite3.rb +0 -125
- data/lib/pwn/plugins/defect_dojo.rb +0 -841
- data/lib/pwn/plugins/detect_os.rb +0 -71
- data/lib/pwn/plugins/ein.rb +0 -141
- data/lib/pwn/plugins/file_fu.rb +0 -93
- data/lib/pwn/plugins/fuzz.rb +0 -204
- data/lib/pwn/plugins/git.rb +0 -159
- data/lib/pwn/plugins/github.rb +0 -137
- data/lib/pwn/plugins/hacker_one.rb +0 -154
- data/lib/pwn/plugins/hunter.rb +0 -160
- data/lib/pwn/plugins/ip_info.rb +0 -264
- data/lib/pwn/plugins/irc.rb +0 -312
- data/lib/pwn/plugins/jenkins.rb +0 -537
- data/lib/pwn/plugins/jira_data_center.rb +0 -676
- data/lib/pwn/plugins/json_pathify.rb +0 -46
- data/lib/pwn/plugins/log.rb +0 -123
- data/lib/pwn/plugins/mail_agent.rb +0 -344
- data/lib/pwn/plugins/metasploit.rb +0 -151
- data/lib/pwn/plugins/monkey_patch.rb +0 -182
- data/lib/pwn/plugins/msr206.rb +0 -1257
- data/lib/pwn/plugins/nessus_cloud.rb +0 -847
- data/lib/pwn/plugins/nexpose_vuln_scan.rb +0 -356
- data/lib/pwn/plugins/nmap_it.rb +0 -136
- data/lib/pwn/plugins/oauth2.rb +0 -67
- data/lib/pwn/plugins/ocr.rb +0 -43
- data/lib/pwn/plugins/open_api.rb +0 -896
- data/lib/pwn/plugins/openvas.rb +0 -314
- data/lib/pwn/plugins/packet.rb +0 -1313
- data/lib/pwn/plugins/pdf_parse.rb +0 -53
- data/lib/pwn/plugins/pony.rb +0 -281
- data/lib/pwn/plugins/ps.rb +0 -90
- data/lib/pwn/plugins/pwn_logger.rb +0 -64
- data/lib/pwn/plugins/rabbit_mq.rb +0 -70
- data/lib/pwn/plugins/repl.rb +0 -999
- data/lib/pwn/plugins/scannable_codes.rb +0 -87
- data/lib/pwn/plugins/serial.rb +0 -273
- data/lib/pwn/plugins/shodan.rb +0 -629
- data/lib/pwn/plugins/slack_client.rb +0 -104
- data/lib/pwn/plugins/sock.rb +0 -289
- data/lib/pwn/plugins/spider.rb +0 -78
- data/lib/pwn/plugins/ssn.rb +0 -52
- data/lib/pwn/plugins/thread_pool.rb +0 -80
- data/lib/pwn/plugins/tor.rb +0 -273
- data/lib/pwn/plugins/transparent_browser.rb +0 -1738
- data/lib/pwn/plugins/twitter_api.rb +0 -151
- data/lib/pwn/plugins/uri_scheme.rb +0 -328
- data/lib/pwn/plugins/vault.rb +0 -305
- data/lib/pwn/plugins/vin.rb +0 -361
- data/lib/pwn/plugins/voice.rb +0 -145
- data/lib/pwn/plugins/vsphere.rb +0 -81
- data/lib/pwn/plugins/xxd.rb +0 -298
- data/lib/pwn/plugins/zaproxy.rb +0 -837
- data/lib/pwn/plugins.rb +0 -81
- data/lib/pwn/reports/fuzz.rb +0 -328
- data/lib/pwn/reports/html_footer.rb +0 -160
- data/lib/pwn/reports/html_header.rb +0 -271
- data/lib/pwn/reports/phone.rb +0 -384
- data/lib/pwn/reports/sast.rb +0 -435
- data/lib/pwn/reports/uri_buster.rb +0 -335
- data/lib/pwn/reports.rb +0 -25
- data/lib/pwn/sast/amqp_connect_as_guest.rb +0 -78
- data/lib/pwn/sast/apache_file_system_util_api.rb +0 -76
- data/lib/pwn/sast/aws.rb +0 -77
- data/lib/pwn/sast/banned_function_calls_c.rb +0 -207
- data/lib/pwn/sast/base64.rb +0 -74
- data/lib/pwn/sast/beef_hook.rb +0 -75
- data/lib/pwn/sast/cmd_execution_go_lang.rb +0 -83
- data/lib/pwn/sast/cmd_execution_java.rb +0 -80
- data/lib/pwn/sast/cmd_execution_python.rb +0 -82
- data/lib/pwn/sast/cmd_execution_ruby.rb +0 -90
- data/lib/pwn/sast/cmd_execution_scala.rb +0 -80
- data/lib/pwn/sast/csrf.rb +0 -74
- data/lib/pwn/sast/deserial_java.rb +0 -85
- data/lib/pwn/sast/emoticon.rb +0 -82
- data/lib/pwn/sast/eval.rb +0 -76
- data/lib/pwn/sast/factory.rb +0 -79
- data/lib/pwn/sast/http_authorization_header.rb +0 -80
- data/lib/pwn/sast/inner_html.rb +0 -76
- data/lib/pwn/sast/keystore.rb +0 -75
- data/lib/pwn/sast/local_storage.rb +0 -77
- data/lib/pwn/sast/location_hash.rb +0 -76
- data/lib/pwn/sast/log4j.rb +0 -78
- data/lib/pwn/sast/logger.rb +0 -90
- data/lib/pwn/sast/md5.rb +0 -75
- data/lib/pwn/sast/outer_html.rb +0 -76
- data/lib/pwn/sast/padding_oracle.rb +0 -72
- data/lib/pwn/sast/password.rb +0 -75
- data/lib/pwn/sast/php_input_mechanisms.rb +0 -84
- data/lib/pwn/sast/php_type_juggling.rb +0 -82
- data/lib/pwn/sast/pom_version.rb +0 -164
- data/lib/pwn/sast/port.rb +0 -82
- data/lib/pwn/sast/post_message.rb +0 -76
- data/lib/pwn/sast/private_key.rb +0 -75
- data/lib/pwn/sast/redirect.rb +0 -77
- data/lib/pwn/sast/redos.rb +0 -82
- data/lib/pwn/sast/shell.rb +0 -83
- data/lib/pwn/sast/signature.rb +0 -75
- data/lib/pwn/sast/sql.rb +0 -85
- data/lib/pwn/sast/ssl.rb +0 -79
- data/lib/pwn/sast/sudo.rb +0 -75
- data/lib/pwn/sast/task_tag.rb +0 -89
- data/lib/pwn/sast/test_case_engine.rb +0 -189
- data/lib/pwn/sast/throw_errors.rb +0 -78
- data/lib/pwn/sast/token.rb +0 -77
- data/lib/pwn/sast/type_script_type_juggling.rb +0 -82
- data/lib/pwn/sast/use_after_free.rb +0 -82
- data/lib/pwn/sast/version.rb +0 -76
- data/lib/pwn/sast/window_location_hash.rb +0 -75
- data/lib/pwn/sast.rb +0 -67
- data/lib/pwn/sdr/decoder/gsm.rb +0 -200
- data/lib/pwn/sdr/decoder.rb +0 -19
- data/lib/pwn/sdr/flipper_zero.rb +0 -128
- data/lib/pwn/sdr/frequency_allocation.rb +0 -416
- data/lib/pwn/sdr/gqrx.rb +0 -655
- data/lib/pwn/sdr/rfidler.rb +0 -56
- data/lib/pwn/sdr/son_micro_rfid.rb +0 -773
- data/lib/pwn/sdr.rb +0 -21
- data/lib/pwn/version.rb +0 -5
- data/lib/pwn/www/app_cobalt_io.rb +0 -139
- data/lib/pwn/www/bing.rb +0 -88
- data/lib/pwn/www/bug_crowd.rb +0 -136
- data/lib/pwn/www/checkip.rb +0 -69
- data/lib/pwn/www/coinbase_pro.rb +0 -136
- data/lib/pwn/www/duckduckgo.rb +0 -114
- data/lib/pwn/www/facebook.rb +0 -124
- data/lib/pwn/www/google.rb +0 -114
- data/lib/pwn/www/hacker_one.rb +0 -649
- data/lib/pwn/www/linkedin.rb +0 -124
- data/lib/pwn/www/pandora.rb +0 -124
- data/lib/pwn/www/pastebin.rb +0 -84
- data/lib/pwn/www/paypal.rb +0 -208
- data/lib/pwn/www/synack.rb +0 -136
- data/lib/pwn/www/torch.rb +0 -107
- data/lib/pwn/www/trading_view.rb +0 -127
- data/lib/pwn/www/twitter.rb +0 -138
- data/lib/pwn/www/uber.rb +0 -124
- data/lib/pwn/www/upwork.rb +0 -124
- data/lib/pwn/www/wayback_machine.rb +0 -113
- data/lib/pwn/www/youtube.rb +0 -88
- data/lib/pwn/www.rb +0 -36
- data/lib/pwn.rb +0 -39
- data/packer/daemons/msfrpcd.rb +0 -64
- data/packer/daemons/openvas.rb +0 -51
- data/packer/deploy_docker_containers.sh +0 -9
- data/packer/deploy_packer_box.sh +0 -87
- data/packer/docker/kali_rolling_docker_pwn_fuzz_net_app_proto.json +0 -44
- data/packer/docker/kali_rolling_docker_pwn_prototyper.json +0 -48
- data/packer/docker/kali_rolling_docker_pwn_sast.json +0 -44
- data/packer/docker/kali_rolling_docker_pwn_transparent_browser.json +0 -46
- data/packer/docker/kali_rolling_docker_pwn_www_checkip.json +0 -34
- data/packer/http/kali_rolling_preseed.cfg +0 -81
- data/packer/kali_rolling_aws_ami.json +0 -139
- data/packer/kali_rolling_qemu_kvm.json +0 -159
- data/packer/kali_rolling_virtualbox.json +0 -186
- data/packer/kali_rolling_vmware.json +0 -167
- data/packer/packer_secrets.json.EXAMPLE +0 -9
- data/packer/provisioners/PayloadsAllTheThings.sh +0 -5
- data/packer/provisioners/SecLists.sh +0 -5
- data/packer/provisioners/afl.sh +0 -28
- data/packer/provisioners/aliases.rb +0 -23
- data/packer/provisioners/amass.sh +0 -5
- data/packer/provisioners/android.sh +0 -18
- data/packer/provisioners/ansible.sh +0 -5
- data/packer/provisioners/apache2.sh +0 -24
- data/packer/provisioners/arachni.sh +0 -28
- data/packer/provisioners/awscli.sh +0 -5
- data/packer/provisioners/bashrc.sh +0 -13
- data/packer/provisioners/beef.rb +0 -23
- data/packer/provisioners/burpsuite.sh +0 -24
- data/packer/provisioners/chrome.sh +0 -11
- data/packer/provisioners/coreutils.sh +0 -6
- data/packer/provisioners/curl.sh +0 -6
- data/packer/provisioners/docker.sh +0 -43
- data/packer/provisioners/docker_bashrc.sh +0 -2
- data/packer/provisioners/docker_rvm.sh +0 -22
- data/packer/provisioners/eyewitness.sh +0 -5
- data/packer/provisioners/ffmpeg.sh +0 -6
- data/packer/provisioners/firefox.sh +0 -7
- data/packer/provisioners/fuzzdb.sh +0 -5
- data/packer/provisioners/gdb.sh +0 -5
- data/packer/provisioners/geckodriver.sh +0 -9
- data/packer/provisioners/ghidra.sh +0 -5
- data/packer/provisioners/git.sh +0 -6
- data/packer/provisioners/init_image.sh +0 -103
- data/packer/provisioners/install_vagrant_ssh_key.sh +0 -15
- data/packer/provisioners/irc.sh +0 -13
- data/packer/provisioners/jenkins.sh +0 -77
- data/packer/provisioners/metasploit.rb +0 -59
- data/packer/provisioners/nmap.sh +0 -5
- data/packer/provisioners/openvas.sh +0 -23
- data/packer/provisioners/openvas_wrappers.sh +0 -4
- data/packer/provisioners/openvpn.sh +0 -7
- data/packer/provisioners/peda.sh +0 -4
- data/packer/provisioners/phantomjs.rb +0 -28
- data/packer/provisioners/phantomjs_wrapper.sh +0 -22
- data/packer/provisioners/post_install.sh +0 -41
- data/packer/provisioners/postgresql.sh +0 -49
- data/packer/provisioners/preeny.sh +0 -8
- data/packer/provisioners/pwn.sh +0 -100
- data/packer/provisioners/pwntools.sh +0 -13
- data/packer/provisioners/radamsa.sh +0 -7
- data/packer/provisioners/radare2.sh +0 -29
- data/packer/provisioners/rc.local.sh +0 -16
- data/packer/provisioners/reboot_os.sh +0 -7
- data/packer/provisioners/ruby.sh +0 -35
- data/packer/provisioners/rvm.sh +0 -31
- data/packer/provisioners/scapy.sh +0 -5
- data/packer/provisioners/scout2.sh +0 -5
- data/packer/provisioners/sox.sh +0 -5
- data/packer/provisioners/ssllabs-scan.sh +0 -9
- data/packer/provisioners/strace.sh +0 -5
- data/packer/provisioners/sublist3r.sh +0 -5
- data/packer/provisioners/terminator.sh +0 -5
- data/packer/provisioners/toggle_tor.sh +0 -2
- data/packer/provisioners/tor.sh +0 -5
- data/packer/provisioners/twinkle.sh +0 -6
- data/packer/provisioners/update_os.sh +0 -108
- data/packer/provisioners/upload_globals.sh +0 -63
- data/packer/provisioners/vim.sh +0 -23
- data/packer/provisioners/virtualbox_guest_additions.sh +0 -20
- data/packer/provisioners/vmware_tools.sh +0 -8
- data/packer/provisioners/wpscan.rb +0 -23
- data/packer/provisioners/xrdp.sh +0 -23
- data/packer/provisioners/zzuf.sh +0 -5
- data/pwn.gemspec +0 -77
- data/reinstall_pwn_gemset.sh +0 -30
- data/spec/lib/pwn/ai/grok_spec.rb +0 -15
- data/spec/lib/pwn/ai/introspection_spec.rb +0 -15
- data/spec/lib/pwn/ai/ollama_spec.rb +0 -15
- data/spec/lib/pwn/ai/open_ai_spec.rb +0 -15
- data/spec/lib/pwn/ai_spec.rb +0 -10
- data/spec/lib/pwn/aws/acm_spec.rb +0 -15
- data/spec/lib/pwn/aws/api_gateway_spec.rb +0 -15
- data/spec/lib/pwn/aws/app_stream_spec.rb +0 -15
- data/spec/lib/pwn/aws/application_auto_scaling_spec.rb +0 -15
- data/spec/lib/pwn/aws/application_discovery_service_spec.rb +0 -15
- data/spec/lib/pwn/aws/auto_scaling_spec.rb +0 -15
- data/spec/lib/pwn/aws/batch_spec.rb +0 -15
- data/spec/lib/pwn/aws/budgets_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_formation_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_front_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_hsm_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_search_domain_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_search_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_trail_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_watch_events_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_watch_logs_spec.rb +0 -15
- data/spec/lib/pwn/aws/cloud_watch_spec.rb +0 -15
- data/spec/lib/pwn/aws/code_build_spec.rb +0 -15
- data/spec/lib/pwn/aws/code_commit_spec.rb +0 -15
- data/spec/lib/pwn/aws/code_deploy_spec.rb +0 -15
- data/spec/lib/pwn/aws/code_pipeline_spec.rb +0 -15
- data/spec/lib/pwn/aws/cognito_identity_provider_spec.rb +0 -15
- data/spec/lib/pwn/aws/cognito_identity_spec.rb +0 -15
- data/spec/lib/pwn/aws/cognito_sync_spec.rb +0 -15
- data/spec/lib/pwn/aws/config_service_spec.rb +0 -15
- data/spec/lib/pwn/aws/data_pipleline_spec.rb +0 -15
- data/spec/lib/pwn/aws/database_migration_service_spec.rb +0 -15
- data/spec/lib/pwn/aws/device_farm_spec.rb +0 -15
- data/spec/lib/pwn/aws/direct_connect_spec.rb +0 -15
- data/spec/lib/pwn/aws/directory_service_spec.rb +0 -15
- data/spec/lib/pwn/aws/dynamo_db_spec.rb +0 -15
- data/spec/lib/pwn/aws/dynamo_db_streams_spec.rb +0 -15
- data/spec/lib/pwn/aws/ec2_spec.rb +0 -15
- data/spec/lib/pwn/aws/ecr_spec.rb +0 -15
- data/spec/lib/pwn/aws/ecs_spec.rb +0 -15
- data/spec/lib/pwn/aws/efs_spec.rb +0 -15
- data/spec/lib/pwn/aws/elasti_cache_spec.rb +0 -15
- data/spec/lib/pwn/aws/elastic_beanstalk_spec.rb +0 -15
- data/spec/lib/pwn/aws/elastic_load_balancing_spec.rb +0 -15
- data/spec/lib/pwn/aws/elastic_load_balancing_v2_spec.rb +0 -15
- data/spec/lib/pwn/aws/elastic_transcoder_spec.rb +0 -15
- data/spec/lib/pwn/aws/elasticsearch_service_spec.rb +0 -15
- data/spec/lib/pwn/aws/emr_spec.rb +0 -15
- data/spec/lib/pwn/aws/firehose_spec.rb +0 -15
- data/spec/lib/pwn/aws/game_lift_spec.rb +0 -15
- data/spec/lib/pwn/aws/glacier_spec.rb +0 -15
- data/spec/lib/pwn/aws/health_spec.rb +0 -15
- data/spec/lib/pwn/aws/iam_spec.rb +0 -15
- data/spec/lib/pwn/aws/import_export_spec.rb +0 -15
- data/spec/lib/pwn/aws/inspector_spec.rb +0 -15
- data/spec/lib/pwn/aws/iot_data_plane_spec.rb +0 -15
- data/spec/lib/pwn/aws/iot_spec.rb +0 -15
- data/spec/lib/pwn/aws/kinesis_analytics_spec.rb +0 -15
- data/spec/lib/pwn/aws/kinesis_spec.rb +0 -15
- data/spec/lib/pwn/aws/kms_spec.rb +0 -15
- data/spec/lib/pwn/aws/lambda_preview_spec.rb +0 -15
- data/spec/lib/pwn/aws/lambda_spec.rb +0 -15
- data/spec/lib/pwn/aws/lex_spec.rb +0 -15
- data/spec/lib/pwn/aws/lightsail_spec.rb +0 -15
- data/spec/lib/pwn/aws/machine_learning_spec.rb +0 -15
- data/spec/lib/pwn/aws/marketplace_commerce_analytics_spec.rb +0 -15
- data/spec/lib/pwn/aws/marketplace_metering_spec.rb +0 -15
- data/spec/lib/pwn/aws/ops_works_cm_spec.rb +0 -15
- data/spec/lib/pwn/aws/ops_works_spec.rb +0 -15
- data/spec/lib/pwn/aws/pinpoint_spec.rb +0 -15
- data/spec/lib/pwn/aws/polly_spec.rb +0 -15
- data/spec/lib/pwn/aws/rds_spec.rb +0 -15
- data/spec/lib/pwn/aws/redshift_spec.rb +0 -15
- data/spec/lib/pwn/aws/rekognition_spec.rb +0 -15
- data/spec/lib/pwn/aws/route53_domains_spec.rb +0 -15
- data/spec/lib/pwn/aws/route53_spec.rb +0 -15
- data/spec/lib/pwn/aws/s3_spec.rb +0 -15
- data/spec/lib/pwn/aws/service_catalog_spec.rb +0 -15
- data/spec/lib/pwn/aws/ses_spec.rb +0 -15
- data/spec/lib/pwn/aws/shield_spec.rb +0 -15
- data/spec/lib/pwn/aws/simple_db_spec.rb +0 -15
- data/spec/lib/pwn/aws/sms_spec.rb +0 -15
- data/spec/lib/pwn/aws/snowball_spec.rb +0 -15
- data/spec/lib/pwn/aws/sns_spec.rb +0 -15
- data/spec/lib/pwn/aws/sqs_spec.rb +0 -15
- data/spec/lib/pwn/aws/ssm_spec.rb +0 -15
- data/spec/lib/pwn/aws/states_spec.rb +0 -15
- data/spec/lib/pwn/aws/storage_gateway_spec.rb +0 -15
- data/spec/lib/pwn/aws/sts_spec.rb +0 -15
- data/spec/lib/pwn/aws/support_spec.rb +0 -15
- data/spec/lib/pwn/aws/swf_spec.rb +0 -15
- data/spec/lib/pwn/aws/waf_regional_spec.rb +0 -15
- data/spec/lib/pwn/aws/waf_spec.rb +0 -15
- data/spec/lib/pwn/aws/workspaces_spec.rb +0 -15
- data/spec/lib/pwn/aws/x_ray_spec.rb +0 -15
- data/spec/lib/pwn/aws_spec.rb +0 -10
- data/spec/lib/pwn/banner/anon_spec.rb +0 -20
- data/spec/lib/pwn/banner/bubble_spec.rb +0 -20
- data/spec/lib/pwn/banner/cheshire_spec.rb +0 -20
- data/spec/lib/pwn/banner/code_cave_spec.rb +0 -20
- data/spec/lib/pwn/banner/dont_panic_spec.rb +0 -20
- data/spec/lib/pwn/banner/f_society_spec.rb +0 -20
- data/spec/lib/pwn/banner/fork_bomb_spec.rb +0 -20
- data/spec/lib/pwn/banner/jmp_esp_spec.rb +0 -20
- data/spec/lib/pwn/banner/matrix_spec.rb +0 -20
- data/spec/lib/pwn/banner/ninja_spec.rb +0 -20
- data/spec/lib/pwn/banner/off_the_air_spec.rb +0 -20
- data/spec/lib/pwn/banner/pirate_spec.rb +0 -20
- data/spec/lib/pwn/banner/radare2_ai_spec.rb +0 -20
- data/spec/lib/pwn/banner/radare2_spec.rb +0 -20
- data/spec/lib/pwn/banner/white_rabbit_spec.rb +0 -20
- data/spec/lib/pwn/banner_spec.rb +0 -15
- data/spec/lib/pwn/blockchain/btc_spec.rb +0 -15
- data/spec/lib/pwn/blockchain/eth_spec.rb +0 -15
- data/spec/lib/pwn/blockchain_spec.rb +0 -10
- data/spec/lib/pwn/config_spec.rb +0 -15
- data/spec/lib/pwn/driver_spec.rb +0 -15
- data/spec/lib/pwn/ffi/stdio_spec.rb +0 -15
- data/spec/lib/pwn/ffi_spec.rb +0 -10
- data/spec/lib/pwn/plugins/android_spec.rb +0 -15
- data/spec/lib/pwn/plugins/assembly_spec.rb +0 -15
- data/spec/lib/pwn/plugins/authentication_helper_spec.rb +0 -15
- data/spec/lib/pwn/plugins/baresip_spec.rb +0 -15
- data/spec/lib/pwn/plugins/basic_auth_spec.rb +0 -15
- data/spec/lib/pwn/plugins/beef_spec.rb +0 -15
- data/spec/lib/pwn/plugins/black_duck_binary_analysis_spec.rb +0 -15
- data/spec/lib/pwn/plugins/burp_suite_spec.rb +0 -15
- data/spec/lib/pwn/plugins/bus_pirate_spec.rb +0 -15
- data/spec/lib/pwn/plugins/char_spec.rb +0 -15
- data/spec/lib/pwn/plugins/credit_card_spec.rb +0 -15
- data/spec/lib/pwn/plugins/dao_ldap_spec.rb +0 -15
- data/spec/lib/pwn/plugins/dao_mongo_spec.rb +0 -15
- data/spec/lib/pwn/plugins/dao_postgres_spec.rb +0 -15
- data/spec/lib/pwn/plugins/dao_sqlite3_spec.rb +0 -15
- data/spec/lib/pwn/plugins/defect_dojo_spec.rb +0 -15
- data/spec/lib/pwn/plugins/detect_os_spec.rb +0 -15
- data/spec/lib/pwn/plugins/ein_spec.rb +0 -15
- data/spec/lib/pwn/plugins/file_fu_spec.rb +0 -15
- data/spec/lib/pwn/plugins/fuzz_spec.rb +0 -15
- data/spec/lib/pwn/plugins/git_spec.rb +0 -15
- data/spec/lib/pwn/plugins/github_spec.rb +0 -15
- data/spec/lib/pwn/plugins/hacker_one_spec.rb +0 -15
- data/spec/lib/pwn/plugins/hunter_spec.rb +0 -15
- data/spec/lib/pwn/plugins/ip_info_spec.rb +0 -15
- data/spec/lib/pwn/plugins/irc_spec.rb +0 -15
- data/spec/lib/pwn/plugins/jenkins_spec.rb +0 -15
- data/spec/lib/pwn/plugins/jira_data_center_spec.rb +0 -15
- data/spec/lib/pwn/plugins/json_pathify_spec.rb +0 -15
- data/spec/lib/pwn/plugins/log_spec.rb +0 -15
- data/spec/lib/pwn/plugins/mail_agent_spec.rb +0 -15
- data/spec/lib/pwn/plugins/metasploit_spec.rb +0 -15
- data/spec/lib/pwn/plugins/monkey_patch_spec.rb +0 -15
- data/spec/lib/pwn/plugins/msr206_spec.rb +0 -15
- data/spec/lib/pwn/plugins/nessus_cloud_spec.rb +0 -15
- data/spec/lib/pwn/plugins/nexpose_vuln_scan_spec.rb +0 -15
- data/spec/lib/pwn/plugins/nmap_it_spec.rb +0 -15
- data/spec/lib/pwn/plugins/oauth2_spec.rb +0 -15
- data/spec/lib/pwn/plugins/ocr_spec.rb +0 -15
- data/spec/lib/pwn/plugins/open_api_spec.rb +0 -15
- data/spec/lib/pwn/plugins/openvas_spec.rb +0 -15
- data/spec/lib/pwn/plugins/packet_spec.rb +0 -15
- data/spec/lib/pwn/plugins/pdf_parse_spec.rb +0 -15
- data/spec/lib/pwn/plugins/pony_spec.rb +0 -15
- data/spec/lib/pwn/plugins/ps_spec.rb +0 -15
- data/spec/lib/pwn/plugins/pwn_logger_spec.rb +0 -15
- data/spec/lib/pwn/plugins/rabbit_mq_spec.rb +0 -15
- data/spec/lib/pwn/plugins/repl_spec.rb +0 -15
- data/spec/lib/pwn/plugins/scannable_codes_spec.rb +0 -15
- data/spec/lib/pwn/plugins/serial_spec.rb +0 -15
- data/spec/lib/pwn/plugins/shodan_spec.rb +0 -15
- data/spec/lib/pwn/plugins/slack_client_spec.rb +0 -15
- data/spec/lib/pwn/plugins/sock_spec.rb +0 -15
- data/spec/lib/pwn/plugins/spider_spec.rb +0 -15
- data/spec/lib/pwn/plugins/ssn_spec.rb +0 -15
- data/spec/lib/pwn/plugins/thread_pool_spec.rb +0 -15
- data/spec/lib/pwn/plugins/tor_spec.rb +0 -15
- data/spec/lib/pwn/plugins/transparent_browser_spec.rb +0 -15
- data/spec/lib/pwn/plugins/twitter_api_spec.rb +0 -15
- data/spec/lib/pwn/plugins/uri_scheme_spec.rb +0 -15
- data/spec/lib/pwn/plugins/vault_spec.rb +0 -15
- data/spec/lib/pwn/plugins/vin_spec.rb +0 -15
- data/spec/lib/pwn/plugins/voice_spec.rb +0 -15
- data/spec/lib/pwn/plugins/vsphere_spec.rb +0 -15
- data/spec/lib/pwn/plugins/xxd_spec.rb +0 -15
- data/spec/lib/pwn/plugins/zaproxy_spec.rb +0 -15
- data/spec/lib/pwn/plugins_spec.rb +0 -10
- data/spec/lib/pwn/reports/fuzz_spec.rb +0 -15
- data/spec/lib/pwn/reports/html_footer_spec.rb +0 -15
- data/spec/lib/pwn/reports/html_header_spec.rb +0 -15
- data/spec/lib/pwn/reports/phone_spec.rb +0 -15
- data/spec/lib/pwn/reports/sast_spec.rb +0 -15
- data/spec/lib/pwn/reports/uri_buster_spec.rb +0 -15
- data/spec/lib/pwn/reports_spec.rb +0 -10
- data/spec/lib/pwn/sast/amqp_connect_as_guest_spec.rb +0 -25
- data/spec/lib/pwn/sast/apache_file_system_util_api_spec.rb +0 -25
- data/spec/lib/pwn/sast/aws_spec.rb +0 -25
- data/spec/lib/pwn/sast/banned_function_calls_c_spec.rb +0 -25
- data/spec/lib/pwn/sast/base64_spec.rb +0 -25
- data/spec/lib/pwn/sast/beef_hook_spec.rb +0 -25
- data/spec/lib/pwn/sast/cmd_execution_go_lang_spec.rb +0 -25
- data/spec/lib/pwn/sast/cmd_execution_java_spec.rb +0 -25
- data/spec/lib/pwn/sast/cmd_execution_python_spec.rb +0 -25
- data/spec/lib/pwn/sast/cmd_execution_ruby_spec.rb +0 -25
- data/spec/lib/pwn/sast/cmd_execution_scala_spec.rb +0 -25
- data/spec/lib/pwn/sast/csrf_spec.rb +0 -25
- data/spec/lib/pwn/sast/deserial_java_spec.rb +0 -25
- data/spec/lib/pwn/sast/emoticon_spec.rb +0 -25
- data/spec/lib/pwn/sast/eval_spec.rb +0 -25
- data/spec/lib/pwn/sast/factory_spec.rb +0 -25
- data/spec/lib/pwn/sast/http_authorization_header_spec.rb +0 -25
- data/spec/lib/pwn/sast/inner_html_spec.rb +0 -25
- data/spec/lib/pwn/sast/keystore_spec.rb +0 -25
- data/spec/lib/pwn/sast/local_storage_spec.rb +0 -25
- data/spec/lib/pwn/sast/location_hash_spec.rb +0 -25
- data/spec/lib/pwn/sast/log4j_spec.rb +0 -25
- data/spec/lib/pwn/sast/logger_spec.rb +0 -25
- data/spec/lib/pwn/sast/md5_spec.rb +0 -25
- data/spec/lib/pwn/sast/outer_html_spec.rb +0 -25
- data/spec/lib/pwn/sast/padding_oracle_spec.rb +0 -25
- data/spec/lib/pwn/sast/password_spec.rb +0 -25
- data/spec/lib/pwn/sast/php_input_mechanisms_spec.rb +0 -25
- data/spec/lib/pwn/sast/php_type_juggling_spec.rb +0 -25
- data/spec/lib/pwn/sast/pom_version_spec.rb +0 -25
- data/spec/lib/pwn/sast/port_spec.rb +0 -25
- data/spec/lib/pwn/sast/post_message_spec.rb +0 -25
- data/spec/lib/pwn/sast/private_key_spec.rb +0 -25
- data/spec/lib/pwn/sast/redirect_spec.rb +0 -25
- data/spec/lib/pwn/sast/redos_spec.rb +0 -25
- data/spec/lib/pwn/sast/shell_spec.rb +0 -25
- data/spec/lib/pwn/sast/signature_spec.rb +0 -25
- data/spec/lib/pwn/sast/sql_spec.rb +0 -25
- data/spec/lib/pwn/sast/ssl_spec.rb +0 -25
- data/spec/lib/pwn/sast/sudo_spec.rb +0 -25
- data/spec/lib/pwn/sast/task_tag_spec.rb +0 -25
- data/spec/lib/pwn/sast/test_case_engine_spec.rb +0 -20
- data/spec/lib/pwn/sast/throw_errors_spec.rb +0 -25
- data/spec/lib/pwn/sast/token_spec.rb +0 -25
- data/spec/lib/pwn/sast/type_script_type_juggling_spec.rb +0 -25
- data/spec/lib/pwn/sast/use_after_free_spec.rb +0 -25
- data/spec/lib/pwn/sast/version_spec.rb +0 -25
- data/spec/lib/pwn/sast/window_location_hash_spec.rb +0 -25
- data/spec/lib/pwn/sast_spec.rb +0 -10
- data/spec/lib/pwn/sdr/decoder/gsm_spec.rb +0 -15
- data/spec/lib/pwn/sdr/decoder_spec.rb +0 -10
- data/spec/lib/pwn/sdr/flipper_zero_spec.rb +0 -15
- data/spec/lib/pwn/sdr/frequency_allocation_spec.rb +0 -15
- data/spec/lib/pwn/sdr/gqrx_spec.rb +0 -15
- data/spec/lib/pwn/sdr/rfidler_spec.rb +0 -15
- data/spec/lib/pwn/sdr/son_micro_rfid_spec.rb +0 -15
- data/spec/lib/pwn/sdr_spec.rb +0 -10
- data/spec/lib/pwn/version_spec.rb +0 -17
- data/spec/lib/pwn/www/app_cobalt_io_spec.rb +0 -15
- data/spec/lib/pwn/www/bing_spec.rb +0 -15
- data/spec/lib/pwn/www/bug_crowd_spec.rb +0 -15
- data/spec/lib/pwn/www/checkip_spec.rb +0 -15
- data/spec/lib/pwn/www/coinbase_pro_spec.rb +0 -15
- data/spec/lib/pwn/www/duckduckgo_spec.rb +0 -15
- data/spec/lib/pwn/www/facebook_spec.rb +0 -15
- data/spec/lib/pwn/www/google_spec.rb +0 -15
- data/spec/lib/pwn/www/hacker_one_spec.rb +0 -15
- data/spec/lib/pwn/www/linkedin_spec.rb +0 -15
- data/spec/lib/pwn/www/pandora_spec.rb +0 -15
- data/spec/lib/pwn/www/pastebin_spec.rb +0 -15
- data/spec/lib/pwn/www/paypal_spec.rb +0 -15
- data/spec/lib/pwn/www/synack_spec.rb +0 -15
- data/spec/lib/pwn/www/torch_spec.rb +0 -15
- data/spec/lib/pwn/www/trading_view_spec.rb +0 -15
- data/spec/lib/pwn/www/twitter_spec.rb +0 -15
- data/spec/lib/pwn/www/uber_spec.rb +0 -15
- data/spec/lib/pwn/www/upwork_spec.rb +0 -15
- data/spec/lib/pwn/www/wayback_machine_spec.rb +0 -15
- data/spec/lib/pwn/www/youtube_spec.rb +0 -15
- data/spec/lib/pwn/www_spec.rb +0 -10
- data/spec/lib/pwn_spec.rb +0 -10
- data/spec/spec_helper.rb +0 -3
- data/third_party/.gitkeep +0 -0
- data/third_party/http-request-headers-fields-large.txt +0 -1185
- data/third_party/pwn_rdoc.jsonl +0 -1435
- data/third_party/r2-pwn-layout +0 -1
- data/update_pwn.sh +0 -9
- data/upgrade_ruby.sh +0 -42
- data/vagrant/provisioners/apache2.sh +0 -76
- data/vagrant/provisioners/beef.rb +0 -30
- data/vagrant/provisioners/burpsuite_pro.rb +0 -37
- data/vagrant/provisioners/exploit-db.sh +0 -2
- data/vagrant/provisioners/gem.sh +0 -4
- data/vagrant/provisioners/init_env.sh +0 -22
- data/vagrant/provisioners/jenkins.sh +0 -87
- data/vagrant/provisioners/jenkins_ssh-keygen.rb +0 -86
- data/vagrant/provisioners/kali_customize.rb +0 -130
- data/vagrant/provisioners/letsencrypt.rb +0 -35
- data/vagrant/provisioners/metasploit.rb +0 -25
- data/vagrant/provisioners/nmap_all_live_hosts.sh +0 -2
- data/vagrant/provisioners/openvas.sh +0 -23
- data/vagrant/provisioners/openvas_wrappers.sh +0 -2
- data/vagrant/provisioners/post_install.sh +0 -14
- data/vagrant/provisioners/postgres.sh +0 -22
- data/vagrant/provisioners/pwn.sh +0 -13
- data/vagrant/provisioners/rvm.sh +0 -18
- data/vagrant/provisioners/ssllabs-scan.sh +0 -10
- data/vagrant/provisioners/toggle_tor.sh +0 -2
- data/vagrant/provisioners/update_jenkins_plugins.rb +0 -30
- data/vagrant/provisioners/update_os.sh +0 -108
- data/vagrant/provisioners/upload_globals.sh +0 -63
- data/vagrant/provisioners/userland_fdisk.sh +0 -22
- data/vagrant/provisioners/userland_lvm.sh +0 -5
- data/vagrant/provisioners/wpscan.rb +0 -25
- data/vagrant_rsync_third_party.lst +0 -1
- data/vagrant_rsync_userland_template.lst +0 -8
|
@@ -1,2208 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require 'base64'
|
|
4
|
-
require 'json'
|
|
5
|
-
require 'socket'
|
|
6
|
-
require 'uri'
|
|
7
|
-
require 'yaml'
|
|
8
|
-
|
|
9
|
-
module PWN
|
|
10
|
-
module Plugins
|
|
11
|
-
# This plugin was created to interact w/ Burp Suite Pro in headless mode to kick off spidering/live scanning
|
|
12
|
-
module BurpSuite
|
|
13
|
-
# Supported Method Parameters::
|
|
14
|
-
# uri = PWN::Plugins::BurpSuite.format_uri_from_sitemap_resp(
|
|
15
|
-
# scheme: 'required - scheme of the URI (http|https)',
|
|
16
|
-
# host: 'required - host of the URI',
|
|
17
|
-
# port: 'optional - port of the URI',
|
|
18
|
-
# path: 'optional - path of the URI',
|
|
19
|
-
# query: 'optional - query string of the URI'
|
|
20
|
-
# )
|
|
21
|
-
private_class_method def self.format_uri_from_sitemap_resp(opts = {})
|
|
22
|
-
scheme = opts[:scheme]
|
|
23
|
-
raise 'ERROR: scheme parameter is required' if scheme.nil?
|
|
24
|
-
|
|
25
|
-
host = opts[:host]
|
|
26
|
-
raise 'ERROR: host parameter is required' if host.nil?
|
|
27
|
-
|
|
28
|
-
port = opts[:port]
|
|
29
|
-
path = opts[:path]
|
|
30
|
-
query = opts[:query]
|
|
31
|
-
|
|
32
|
-
implicit_http_ports_arr = [
|
|
33
|
-
80,
|
|
34
|
-
443
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
uri = "#{scheme}://#{host}:#{port}#{path}"
|
|
38
|
-
uri = "#{scheme}://#{host}#{path}" if implicit_http_ports_arr.include?(port)
|
|
39
|
-
uri = "#{uri}?#{query}" unless query.nil?
|
|
40
|
-
|
|
41
|
-
uri
|
|
42
|
-
rescue StandardError => e
|
|
43
|
-
raise e
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# Supported Method Parameters::
|
|
47
|
-
# burp_obj = PWN::Plugins::BurpSuite.init_introspection_thread(
|
|
48
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
49
|
-
# type: 'required - type of history to introspect (:sitemap, :proxy_history, :websocket_history)'
|
|
50
|
-
# )
|
|
51
|
-
private_class_method def self.init_introspection_thread(opts = {})
|
|
52
|
-
# if PWN::Env[:ai][:introspection] is true,
|
|
53
|
-
# spin up Thread to:
|
|
54
|
-
# 1. Periodically call get_proxy_history(burp_obj: burp_obj) method
|
|
55
|
-
# 2. For each entry w/ empty comment,
|
|
56
|
-
# generate AI analysis via PWN::AI::Introspection.reflect_on
|
|
57
|
-
# and populate the comment field for the entry.
|
|
58
|
-
# 3. Update the highlight field based on EPSS score extracted from AI analysis.
|
|
59
|
-
# 4. Call update_proxy_history(burp_obj: burp_obj, entry: updated_entry)
|
|
60
|
-
burp_obj = opts[:burp_obj]
|
|
61
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
62
|
-
|
|
63
|
-
valid_types = %i[proxy_history sitemap websocket_history]
|
|
64
|
-
type = opts[:type]
|
|
65
|
-
raise "ERROR: type parameter is required and must be one of: #{valid_types.join(', ')}" unless valid_types.include?(type)
|
|
66
|
-
|
|
67
|
-
if PWN::Env[:ai][:introspection]
|
|
68
|
-
introspection_thread_arr = burp_obj[:introspection_threads] ||= []
|
|
69
|
-
introspection_thread = Thread.new do
|
|
70
|
-
system_role_content = '
|
|
71
|
-
Your expertise lies in dissecting HTTP request/response pairs and WebSocket messages to identify high-impact vulnerabilities, including but not limited to XSS (reflected, stored, DOM-based), CSRF, SSRF, IDOR, open redirects, CORS misconfigurations, authentication bypasses, SQLi/NoSQLi, command/code injection, business logic flaws, race conditions, and API abuse. You prioritize zero-days and novel chains, always focusing on exploitability, impact (e.g., account takeover, data exfiltration, RCE), and reproducibility.
|
|
72
|
-
|
|
73
|
-
During analysis:
|
|
74
|
-
|
|
75
|
-
1. **Parse and Contextualize Traffic**:
|
|
76
|
-
- Break down every element: HTTP method, URI (path, query parameters), headers (e.g., Host, User-Agent, Cookies, Authorization, Referer, Origin, Content-Type), request body (e.g., form data, JSON payloads), response status code, response headers, and response body (HTML, JSON, XML, etc.).
|
|
77
|
-
- Identify dynamic elements: User-controlled inputs (e.g., query params, POST data, headers like X-Forwarded-For), server-side echoes, redirects, and client-side processing.
|
|
78
|
-
- Trace data flow: Map how inputs propagate from request to response, including any client-side JavaScript execution where exploitation may be possible in the client without communicating with the server (e.g. DOM-XSS).
|
|
79
|
-
|
|
80
|
-
2. **Vulnerability Hunting Framework**:
|
|
81
|
-
- **Input Validation & Sanitization**: Check for unescaped/lack of encoding in outputs (e.g., HTML context for XSS, URL context for open redirects).
|
|
82
|
-
- **XSS Focus**: Hunt for sinks like innerHTML/outerHTML, document.write, eval, setTimeout/setInterval with strings, location.href/assign/replace, and history.pushState. Test payloads like <script>alert(1)</script>, javascript:alert(1), and polyglots. For DOM-based, simulate client-side execution.
|
|
83
|
-
- **JavaScript Library Analysis**: If JS is present (e.g., in response body or referenced scripts), deobfuscate and inspect:
|
|
84
|
-
- Objects/properties that could clobber DOM (e.g., window.name, document.cookie manipulation leading to prototype pollution).
|
|
85
|
-
- DOM XSS vectors: Analyze event handlers, querySelector, addEventListener with unsanitized data from location.hash/search, postMessage, or localStorage.
|
|
86
|
-
- Third-party libs (e.g., jQuery, React): Flag known sink patterns like .html(), dangerouslySetInnerHTML, or eval-like functions.
|
|
87
|
-
- **Server-Side Issues**: Probe for SSRF (e.g., via URL params fetching internal resources), IDOR (e.g., manipulating IDs in paths/bodies), rate limiting bypass, and insecure deserialization (e.g., in JSON/PHP objects).
|
|
88
|
-
- **Headers & Misc**: Examine for exposed sensitive info (e.g., debug headers, stack traces), misconfigured security headers (CSP, HSTS), and upload flaws (e.g., file extension bypass).
|
|
89
|
-
- **Chaining Opportunities**: Always consider multi-step exploits, like XSS leading to CSRF token theft or SSRF to internal metadata endpoints.
|
|
90
|
-
|
|
91
|
-
3. **PoC Generation**:
|
|
92
|
-
- Produce concise, step-by-step PoCs in a standardized format:
|
|
93
|
-
- **Description**: Clear vuln summary, CVSS-like severity, and impact.
|
|
94
|
-
- **Steps to Reproduce**: Numbered HTTP requests (use curl or Burp syntax, e.g., `curl -X POST -d "param=<payload>" https://target.com/endpoint`).
|
|
95
|
-
- **Payloads**: Provide working, minimal payloads with variations for evasion (e.g., encoded, obfuscated).
|
|
96
|
-
- **Screenshots/Evidence**: Suggest what to capture (e.g., alert popup for XSS, response diff for IDOR).
|
|
97
|
-
- **Mitigation Advice**: Recommend fixes (e.g., output encoding, input validation).
|
|
98
|
-
- Ensure PoCs are ethical: Target only in-scope assets, avoid DoS, and emphasize disclosure via proper channels (e.g., HackerOne, Bugcrowd).
|
|
99
|
-
- If no vuln found, explain why and suggest further tests (e.g., fuzzing params).
|
|
100
|
-
4. Risk Score:
|
|
101
|
-
For each analysis generate a risk score between 0% - 100% based on exploitability and impact. This should be reflected as { "risk_score": "nnn%" } in the final output JSON.
|
|
102
|
-
|
|
103
|
-
Analyze provided HTTP request/response pairs methodically: Start with a high-level overview, then dive into specifics, flag potential issues with evidence from the traffic, and end with PoC if applicable. Be verbose in reasoning but concise in output. Prioritize high-severity findings. If data is incomplete, request clarifications.
|
|
104
|
-
'
|
|
105
|
-
|
|
106
|
-
get_highlight_color = lambda do |opts = {}|
|
|
107
|
-
ai_analysis = opts[:ai_analysis]
|
|
108
|
-
|
|
109
|
-
highlight_color = 'GRAY'
|
|
110
|
-
if ai_analysis =~ /"risk_score":\s*"(\d{1,3})%"/
|
|
111
|
-
score = Regexp.last_match(1).to_i
|
|
112
|
-
highlight_color = case score
|
|
113
|
-
when 0..24
|
|
114
|
-
'GREEN'
|
|
115
|
-
when 25..49
|
|
116
|
-
'YELLOW'
|
|
117
|
-
when 50..74
|
|
118
|
-
'ORANGE'
|
|
119
|
-
when 75..100
|
|
120
|
-
'RED'
|
|
121
|
-
end
|
|
122
|
-
end
|
|
123
|
-
|
|
124
|
-
highlight_color
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
loop do
|
|
128
|
-
# TODO: Implement repeater into the loop? This reduces load to LLM but is slooow.
|
|
129
|
-
# Repeater should analyze the reqesut/response pair and suggest
|
|
130
|
-
# modifications to the request to further probe for vulnerabilities _quickly_.
|
|
131
|
-
case type
|
|
132
|
-
when :proxy_history
|
|
133
|
-
sitemap = get_sitemap(burp_obj: burp_obj)
|
|
134
|
-
proxy_history = get_proxy_history(burp_obj: burp_obj)
|
|
135
|
-
proxy_history.each do |entry|
|
|
136
|
-
next unless entry.key?(:comment) && entry[:comment].to_s.strip.empty?
|
|
137
|
-
|
|
138
|
-
request = entry[:request]
|
|
139
|
-
response = entry[:response]
|
|
140
|
-
host = entry[:http_service][:host]
|
|
141
|
-
port = entry[:http_service][:port]
|
|
142
|
-
protocol = entry[:http_service][:protocol]
|
|
143
|
-
next if request.nil? || response.nil? || host.nil? || port.nil? || protocol.nil?
|
|
144
|
-
|
|
145
|
-
# If sitemap comment and highlight color exists, use that instead of re-analyzing
|
|
146
|
-
sitemap_entry = nil
|
|
147
|
-
if sitemap.any?
|
|
148
|
-
sitemap_entry = sitemap.find do |site|
|
|
149
|
-
next unless site.key?(:http_service) && site.key?(:request)
|
|
150
|
-
|
|
151
|
-
site[:http_service][:host] == host &&
|
|
152
|
-
site[:http_service][:port] == port &&
|
|
153
|
-
site[:http_service][:protocol] == protocol &&
|
|
154
|
-
site[:request] == entry[:request]
|
|
155
|
-
end
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
if sitemap_entry.is_a?(Hash) && sitemap_entry[:comment].length.positive?
|
|
159
|
-
entry[:comment] = sitemap_entry[:comment]
|
|
160
|
-
entry[:highlight] = sitemap_entry[:highlight]
|
|
161
|
-
else
|
|
162
|
-
request = Base64.strict_decode64(request)
|
|
163
|
-
response = Base64.strict_decode64(response)
|
|
164
|
-
|
|
165
|
-
http_request_response = PWN::Plugins::Char.force_utf8("#{request}\r\n\r\n#{response}")
|
|
166
|
-
ai_analysis = PWN::AI::Introspection.reflect_on(
|
|
167
|
-
system_role_content: system_role_content,
|
|
168
|
-
request: http_request_response,
|
|
169
|
-
suppress_pii_warning: true
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
next if ai_analysis.nil? || ai_analysis.strip.empty?
|
|
173
|
-
|
|
174
|
-
entry[:comment] = ai_analysis
|
|
175
|
-
entry[:highlight] = get_highlight_color.call(ai_analysis: ai_analysis)
|
|
176
|
-
end
|
|
177
|
-
|
|
178
|
-
update_proxy_history(
|
|
179
|
-
burp_obj: burp_obj,
|
|
180
|
-
entry: entry
|
|
181
|
-
)
|
|
182
|
-
end
|
|
183
|
-
sleep Random.rand(30..60)
|
|
184
|
-
|
|
185
|
-
when :sitemap
|
|
186
|
-
proxy_history = get_proxy_history(burp_obj: burp_obj)
|
|
187
|
-
sitemap = get_sitemap(burp_obj: burp_obj)
|
|
188
|
-
sitemap.each do |entry|
|
|
189
|
-
next unless entry.key?(:comment) && entry[:comment].to_s.strip.empty?
|
|
190
|
-
|
|
191
|
-
request = entry[:request]
|
|
192
|
-
response = entry[:response]
|
|
193
|
-
host = entry[:http_service][:host]
|
|
194
|
-
port = entry[:http_service][:port]
|
|
195
|
-
protocol = entry[:http_service][:protocol]
|
|
196
|
-
next if request.nil? || response.nil? || host.nil? || port.nil? || protocol.nil?
|
|
197
|
-
|
|
198
|
-
proxy_history_entry = nil
|
|
199
|
-
if proxy_history.any?
|
|
200
|
-
proxy_history_entry = proxy_history.find do |proxy_entry|
|
|
201
|
-
next unless proxy_entry.key?(:http_service) && proxy_entry.key?(:request)
|
|
202
|
-
|
|
203
|
-
proxy_entry[:http_service][:host] == host &&
|
|
204
|
-
proxy_entry[:http_service][:port] == port &&
|
|
205
|
-
proxy_entry[:http_service][:protocol] == protocol &&
|
|
206
|
-
proxy_entry[:request] == entry[:request]
|
|
207
|
-
end
|
|
208
|
-
end
|
|
209
|
-
|
|
210
|
-
if proxy_history_entry.is_a?(Hash) && proxy_history_entry[:comment].length.positive?
|
|
211
|
-
entry[:comment] = proxy_history_entry[:comment]
|
|
212
|
-
entry[:highlight] = proxy_history_entry[:highlight]
|
|
213
|
-
else
|
|
214
|
-
request = Base64.strict_decode64(request)
|
|
215
|
-
response = Base64.strict_decode64(response)
|
|
216
|
-
http_request_response = PWN::Plugins::Char.force_utf8("#{request}\r\n\r\n#{response}")
|
|
217
|
-
ai_analysis = PWN::AI::Introspection.reflect_on(
|
|
218
|
-
system_role_content: system_role_content,
|
|
219
|
-
request: http_request_response,
|
|
220
|
-
suppress_pii_warning: true
|
|
221
|
-
)
|
|
222
|
-
|
|
223
|
-
next if ai_analysis.nil? || ai_analysis.strip.empty?
|
|
224
|
-
|
|
225
|
-
entry[:comment] = ai_analysis
|
|
226
|
-
entry[:highlight] = get_highlight_color.call(ai_analysis: ai_analysis)
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
update_sitemap(
|
|
230
|
-
burp_obj: burp_obj,
|
|
231
|
-
entry: entry
|
|
232
|
-
)
|
|
233
|
-
end
|
|
234
|
-
sleep Random.rand(60..90)
|
|
235
|
-
|
|
236
|
-
when :websocket_history
|
|
237
|
-
websocket_history = get_websocket_history(burp_obj: burp_obj)
|
|
238
|
-
websocket_history.each do |entry|
|
|
239
|
-
next unless entry.key?(:comment) && entry[:comment].to_s.strip.empty?
|
|
240
|
-
|
|
241
|
-
web_socket_id = entry[:web_socket_id]
|
|
242
|
-
direction = entry[:direction]
|
|
243
|
-
payload = entry[:payload]
|
|
244
|
-
next if web_socket_id.nil? || direction.nil? || payload.nil?
|
|
245
|
-
|
|
246
|
-
payload = Base64.strict_decode64(payload)
|
|
247
|
-
websocket_req = PWN::Plugins::Char.force_utf8("WebSocket ID: #{web_socket_id}\nDirection: #{direction}\nPayload:\n#{payload}")
|
|
248
|
-
ai_analysis = PWN::AI::Introspection.reflect_on(
|
|
249
|
-
system_role_content: system_role_content,
|
|
250
|
-
request: websocket_req,
|
|
251
|
-
suppress_pii_warning: true
|
|
252
|
-
)
|
|
253
|
-
|
|
254
|
-
next if ai_analysis.nil? || ai_analysis.strip.empty?
|
|
255
|
-
|
|
256
|
-
entry[:comment] = ai_analysis
|
|
257
|
-
entry[:highlight] = get_highlight_color.call(ai_analysis: ai_analysis)
|
|
258
|
-
|
|
259
|
-
update_websocket_history(
|
|
260
|
-
burp_obj: burp_obj,
|
|
261
|
-
entry: entry
|
|
262
|
-
)
|
|
263
|
-
end
|
|
264
|
-
sleep Random.rand(3..10)
|
|
265
|
-
end
|
|
266
|
-
end
|
|
267
|
-
rescue Errno::ECONNREFUSED
|
|
268
|
-
puts "BurpSuite:#{type} AI Introspection Thread >>> Terminating API Calls..."
|
|
269
|
-
rescue StandardError => e
|
|
270
|
-
puts "BurpSuite AI Introspection Thread Error: #{e}"
|
|
271
|
-
puts e.backtrace
|
|
272
|
-
raise e
|
|
273
|
-
ensure
|
|
274
|
-
puts "BurpSuite:#{type} AI Introspection Thread >>> Goodbye."
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
burp_obj[:introspection_threads] = introspection_thread_arr.push(introspection_thread)
|
|
278
|
-
end
|
|
279
|
-
|
|
280
|
-
burp_obj
|
|
281
|
-
rescue StandardError => e
|
|
282
|
-
raise e
|
|
283
|
-
end
|
|
284
|
-
|
|
285
|
-
# Supported Method Parameters::
|
|
286
|
-
# burp_obj1 = PWN::Plugins::BurpSuite.start(
|
|
287
|
-
# burp_jar_path: 'optional - path of burp suite pro jar file (defaults to /opt/burpsuite/burpsuite_pro.jar)',
|
|
288
|
-
# headless: 'optional - run burp headless if set to true',
|
|
289
|
-
# browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types',
|
|
290
|
-
# burp_ip: 'optional - IP address for the Burp proxy (defaults to 127.0.0.1)',
|
|
291
|
-
# burp_port: 'optional - port for the Burp proxy (defaults to a random unused port)',
|
|
292
|
-
# pwn_burp_ip: 'optional - IP address for the PWN Burp API (defaults to 127.0.0.1)',
|
|
293
|
-
# pwn_burp_port: 'optional - port for the PWN Burp API (defaults to a random unused port)'
|
|
294
|
-
# )
|
|
295
|
-
|
|
296
|
-
public_class_method def self.start(opts = {})
|
|
297
|
-
burp_jar_path = opts[:burp_jar_path] ||= '/opt/burpsuite/burpsuite-pro.jar'
|
|
298
|
-
raise "ERROR: #{burp_jar_path} not found." unless File.exist?(burp_jar_path)
|
|
299
|
-
|
|
300
|
-
raise 'ERROR: /opt/burpsuite/pwn-burp.jar not found. For more details about installing this extension, checkout https://github.com/0dayinc/pwn_burp' unless File.exist?('/opt/burpsuite/pwn-burp.jar')
|
|
301
|
-
|
|
302
|
-
burp_root = File.dirname(burp_jar_path)
|
|
303
|
-
|
|
304
|
-
headless = opts[:headless] || false
|
|
305
|
-
browser_type = opts[:browser_type] ||= :firefox
|
|
306
|
-
browser_type = browser_type.to_s.downcase.to_sym unless browser_type.is_a?(Symbol)
|
|
307
|
-
browser_type = :headless if headless
|
|
308
|
-
burp_ip = opts[:burp_ip] ||= '127.0.0.1'
|
|
309
|
-
burp_port = opts[:burp_port] ||= PWN::Plugins::Sock.get_random_unused_port
|
|
310
|
-
|
|
311
|
-
pwn_burp_ip = opts[:pwn_burp_ip] ||= '127.0.0.1'
|
|
312
|
-
pwn_burp_port = opts[:pwn_burp_port] ||= PWN::Plugins::Sock.get_random_unused_port
|
|
313
|
-
|
|
314
|
-
burp_cmd_string = 'java -Xms4G -Xmx16G'
|
|
315
|
-
burp_cmd_string = "#{burp_cmd_string} -Djava.awt.headless=true" if headless
|
|
316
|
-
burp_cmd_string = "#{burp_cmd_string} -Dproxy.address=#{burp_ip} -Dproxy.port=#{burp_port}"
|
|
317
|
-
burp_cmd_string = "#{burp_cmd_string} -Dserver.address=#{pwn_burp_ip} -Dserver.port=#{pwn_burp_port}"
|
|
318
|
-
burp_cmd_string = "#{burp_cmd_string} -jar #{burp_jar_path}"
|
|
319
|
-
|
|
320
|
-
# Construct burp_obj
|
|
321
|
-
burp_obj = {}
|
|
322
|
-
burp_obj[:pid] = Process.spawn(burp_cmd_string, pgroup: true)
|
|
323
|
-
browser_obj1 = PWN::Plugins::TransparentBrowser.open(browser_type: :rest)
|
|
324
|
-
rest_browser = browser_obj1[:browser]
|
|
325
|
-
|
|
326
|
-
burp_obj[:mitm_proxy] = "#{burp_ip}:#{burp_port}"
|
|
327
|
-
burp_obj[:mitm_rest_api] = "#{pwn_burp_ip}:#{pwn_burp_port}"
|
|
328
|
-
burp_obj[:rest_browser] = rest_browser
|
|
329
|
-
|
|
330
|
-
# Proxy always listens on localhost...use SSH tunneling if remote access is required
|
|
331
|
-
browser_obj2 = PWN::Plugins::TransparentBrowser.open(
|
|
332
|
-
browser_type: browser_type,
|
|
333
|
-
proxy: "http://#{burp_obj[:mitm_proxy]}",
|
|
334
|
-
devtools: true
|
|
335
|
-
)
|
|
336
|
-
|
|
337
|
-
burp_obj[:mitm_browser] = browser_obj2
|
|
338
|
-
|
|
339
|
-
# Wait for pwn_burp_port to open prior to returning burp_obj
|
|
340
|
-
loop do
|
|
341
|
-
s = TCPSocket.new(pwn_burp_ip, pwn_burp_port)
|
|
342
|
-
s.close
|
|
343
|
-
break
|
|
344
|
-
rescue Errno::ECONNREFUSED
|
|
345
|
-
print '.'
|
|
346
|
-
sleep 3
|
|
347
|
-
next
|
|
348
|
-
end
|
|
349
|
-
|
|
350
|
-
# Delete existing proxy listener and add new one
|
|
351
|
-
# in favor of weird update behavior in event the port is alread in use
|
|
352
|
-
# by another application which refuses to enable the listener even when
|
|
353
|
-
# the port is changed via the update method.
|
|
354
|
-
delete_proxy_listener(
|
|
355
|
-
burp_obj: burp_obj,
|
|
356
|
-
id: 0
|
|
357
|
-
)
|
|
358
|
-
|
|
359
|
-
add_proxy_listener(
|
|
360
|
-
burp_obj: burp_obj,
|
|
361
|
-
bindAddress: burp_ip,
|
|
362
|
-
port: burp_port,
|
|
363
|
-
enabled: true
|
|
364
|
-
)
|
|
365
|
-
|
|
366
|
-
burp_obj = init_introspection_thread(burp_obj: burp_obj, type: :sitemap)
|
|
367
|
-
burp_obj = init_introspection_thread(burp_obj: burp_obj, type: :proxy_history)
|
|
368
|
-
init_introspection_thread(burp_obj: burp_obj, type: :websocket_history)
|
|
369
|
-
rescue StandardError => e
|
|
370
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
371
|
-
raise e
|
|
372
|
-
end
|
|
373
|
-
|
|
374
|
-
# Supported Method Parameters::
|
|
375
|
-
# uri_in_scope = PWN::Plugins::BurpSuite.in_scope(
|
|
376
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
377
|
-
# uri: 'required - URI to determine if in scope'
|
|
378
|
-
# )
|
|
379
|
-
|
|
380
|
-
public_class_method def self.in_scope(opts = {})
|
|
381
|
-
burp_obj = opts[:burp_obj]
|
|
382
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
383
|
-
|
|
384
|
-
uri = opts[:uri]
|
|
385
|
-
raise 'ERROR: uri parameter is required' if uri.nil?
|
|
386
|
-
|
|
387
|
-
rest_browser = burp_obj[:rest_browser]
|
|
388
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
389
|
-
base64_encoded_uri = Base64.strict_encode64(uri.to_s.scrub.strip.chomp)
|
|
390
|
-
|
|
391
|
-
in_scope_resp = rest_browser.get(
|
|
392
|
-
"http://#{mitm_rest_api}/scope/#{base64_encoded_uri}",
|
|
393
|
-
content_type: 'application/json; charset=UTF8'
|
|
394
|
-
)
|
|
395
|
-
json_in_scope = JSON.parse(in_scope_resp, symbolize_names: true)
|
|
396
|
-
json_in_scope[:value]
|
|
397
|
-
rescue StandardError => e
|
|
398
|
-
raise e
|
|
399
|
-
end
|
|
400
|
-
|
|
401
|
-
# Supported Method Parameters::
|
|
402
|
-
# json_in_scope = PWN::Plugins::BurpSuite.add_to_scope(
|
|
403
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
404
|
-
# target_url: 'required - target url to add to scope'
|
|
405
|
-
# )
|
|
406
|
-
|
|
407
|
-
public_class_method def self.add_to_scope(opts = {})
|
|
408
|
-
burp_obj = opts[:burp_obj]
|
|
409
|
-
target_url = opts[:target_url]
|
|
410
|
-
rest_browser = burp_obj[:rest_browser]
|
|
411
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
412
|
-
|
|
413
|
-
post_body = { url: target_url }.to_json
|
|
414
|
-
|
|
415
|
-
in_scope = rest_browser.post("http://#{mitm_rest_api}/scope", post_body, content_type: 'application/json; charset=UTF8')
|
|
416
|
-
JSON.parse(in_scope, symbolize_names: true)
|
|
417
|
-
rescue StandardError => e
|
|
418
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
419
|
-
raise e
|
|
420
|
-
end
|
|
421
|
-
|
|
422
|
-
# Supported Method Parameters::
|
|
423
|
-
# json_spider = PWN::Plugins::BurpSuite.spider(
|
|
424
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
425
|
-
# target_url: 'required - target url to add to crawl / spider'
|
|
426
|
-
# )
|
|
427
|
-
|
|
428
|
-
public_class_method def self.spider(opts = {})
|
|
429
|
-
burp_obj = opts[:burp_obj]
|
|
430
|
-
target_url = opts[:target_url]
|
|
431
|
-
rest_browser = burp_obj[:rest_browser]
|
|
432
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
433
|
-
|
|
434
|
-
post_body = { url: target_url }.to_json
|
|
435
|
-
|
|
436
|
-
in_scope = rest_browser.post(
|
|
437
|
-
"http://#{mitm_rest_api}/spider",
|
|
438
|
-
post_body,
|
|
439
|
-
content_type: 'application/json; charset=UTF8'
|
|
440
|
-
)
|
|
441
|
-
spider_json = JSON.parse(in_scope, symbolize_names: true)
|
|
442
|
-
spider_id = spider_json[:id]
|
|
443
|
-
|
|
444
|
-
spider_status_json = {}
|
|
445
|
-
loop do
|
|
446
|
-
print '.'
|
|
447
|
-
spider_status_resp = rest_browser.get("http://#{mitm_rest_api}/spider/#{spider_id}")
|
|
448
|
-
spider_status_json = JSON.parse(spider_status_resp, symbolize_names: true)
|
|
449
|
-
spider_status = spider_status_json[:status]
|
|
450
|
-
case spider_status
|
|
451
|
-
when 'queued', 'running'
|
|
452
|
-
sleep 3
|
|
453
|
-
when 'failed', 'finished'
|
|
454
|
-
break
|
|
455
|
-
else
|
|
456
|
-
puts "Unknown spider status detected: #{spider_status}"
|
|
457
|
-
break
|
|
458
|
-
end
|
|
459
|
-
end
|
|
460
|
-
print "\n"
|
|
461
|
-
|
|
462
|
-
spider_json.merge!(spider_status_json)
|
|
463
|
-
rescue StandardError => e
|
|
464
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
465
|
-
raise e
|
|
466
|
-
end
|
|
467
|
-
|
|
468
|
-
# Supported Method Parameters::
|
|
469
|
-
# PWN::Plugins::BurpSuite.enable_proxy(
|
|
470
|
-
# burp_obj: 'required - burp_obj returned by #start method'
|
|
471
|
-
# )
|
|
472
|
-
|
|
473
|
-
public_class_method def self.enable_proxy(opts = {})
|
|
474
|
-
burp_obj = opts[:burp_obj]
|
|
475
|
-
rest_browser = burp_obj[:rest_browser]
|
|
476
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
477
|
-
|
|
478
|
-
enable_resp = rest_browser.post("http://#{mitm_rest_api}/proxy/intercept/enable", nil)
|
|
479
|
-
JSON.parse(enable_resp, symbolize_names: true)
|
|
480
|
-
rescue StandardError => e
|
|
481
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
482
|
-
raise e
|
|
483
|
-
end
|
|
484
|
-
|
|
485
|
-
# Supported Method Parameters::
|
|
486
|
-
# PWN::Plugins::BurpSuite.disable_proxy(
|
|
487
|
-
# burp_obj: 'required - burp_obj returned by #start method'
|
|
488
|
-
# )
|
|
489
|
-
|
|
490
|
-
public_class_method def self.disable_proxy(opts = {})
|
|
491
|
-
burp_obj = opts[:burp_obj]
|
|
492
|
-
rest_browser = burp_obj[:rest_browser]
|
|
493
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
494
|
-
|
|
495
|
-
disable_resp = rest_browser.post("http://#{mitm_rest_api}/proxy/intercept/disable", nil)
|
|
496
|
-
JSON.parse(disable_resp, symbolize_names: true)
|
|
497
|
-
rescue StandardError => e
|
|
498
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
499
|
-
raise e
|
|
500
|
-
end
|
|
501
|
-
|
|
502
|
-
# Supported Method Parameters::
|
|
503
|
-
# json_proxy_listeners = PWN::Plugins::BurpSuite.get_proxy_listeners(
|
|
504
|
-
# burp_obj: 'required - burp_obj returned by #start method'
|
|
505
|
-
# )
|
|
506
|
-
|
|
507
|
-
public_class_method def self.get_proxy_listeners(opts = {})
|
|
508
|
-
burp_obj = opts[:burp_obj]
|
|
509
|
-
rest_browser = burp_obj[:rest_browser]
|
|
510
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
511
|
-
|
|
512
|
-
listeners = rest_browser.get("http://#{mitm_rest_api}/proxy/listeners", content_type: 'application/json; charset=UTF8')
|
|
513
|
-
JSON.parse(listeners, symbolize_names: true)
|
|
514
|
-
rescue StandardError => e
|
|
515
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
516
|
-
raise e
|
|
517
|
-
end
|
|
518
|
-
|
|
519
|
-
# Supported Method Parameters::
|
|
520
|
-
# json_proxy_listener = PWN::Plugins::BurpSuite.add_proxy_listener(
|
|
521
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
522
|
-
# bindAddress: 'required - bind address for the proxy listener (e.g., "127.0.0.1")',
|
|
523
|
-
# port: 'required - port for the proxy listener (e.g., 8081)',
|
|
524
|
-
# enabled: 'optional - enable the listener (defaults to true)'
|
|
525
|
-
# )
|
|
526
|
-
|
|
527
|
-
public_class_method def self.add_proxy_listener(opts = {})
|
|
528
|
-
burp_obj = opts[:burp_obj]
|
|
529
|
-
rest_browser = burp_obj[:rest_browser]
|
|
530
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
531
|
-
bind_address = opts[:bindAddress]
|
|
532
|
-
raise 'ERROR: bindAddress parameter is required' if bind_address.nil?
|
|
533
|
-
|
|
534
|
-
port = opts[:port]
|
|
535
|
-
raise 'ERROR: port parameter is required' if port.nil?
|
|
536
|
-
|
|
537
|
-
enabled = opts[:enabled] != false # Default to true if not specified
|
|
538
|
-
|
|
539
|
-
proxy_listeners = get_proxy_listeners(burp_obj: burp_obj)
|
|
540
|
-
last_known_proxy_id = 0
|
|
541
|
-
last_known_proxy_id = proxy_listeners.last[:id].to_i if proxy_listeners.any?
|
|
542
|
-
next_id = last_known_proxy_id + 1
|
|
543
|
-
|
|
544
|
-
post_body = {
|
|
545
|
-
id: next_id.to_s,
|
|
546
|
-
bindAddress: bind_address,
|
|
547
|
-
port: port,
|
|
548
|
-
enabled: enabled
|
|
549
|
-
}.to_json
|
|
550
|
-
|
|
551
|
-
listener = rest_browser.post("http://#{mitm_rest_api}/proxy/listeners", post_body, content_type: 'application/json; charset=UTF8')
|
|
552
|
-
JSON.parse(listener, symbolize_names: true)
|
|
553
|
-
rescue StandardError => e
|
|
554
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
555
|
-
raise e
|
|
556
|
-
end
|
|
557
|
-
|
|
558
|
-
# Supported Method Parameters::
|
|
559
|
-
# json_proxy_listener = PWN::Plugins::BurpSuite.update_proxy_listener(
|
|
560
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
561
|
-
# id: 'optional - ID of the proxy listener (defaults to 0)',
|
|
562
|
-
# bindAddress: 'optional - bind address for the proxy listener (defaults to value of existing listener)',
|
|
563
|
-
# port: 'optional - port for the proxy listener (defaults to value of existing listener)',
|
|
564
|
-
# enabled: 'optional - enable or disable the listener (defaults to value of existing listener)'
|
|
565
|
-
# )
|
|
566
|
-
|
|
567
|
-
public_class_method def self.update_proxy_listener(opts = {})
|
|
568
|
-
burp_obj = opts[:burp_obj]
|
|
569
|
-
rest_browser = burp_obj[:rest_browser]
|
|
570
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
571
|
-
id = opts[:id] ||= 0
|
|
572
|
-
|
|
573
|
-
proxy_listeners = get_proxy_listeners(burp_obj: burp_obj)
|
|
574
|
-
listener_by_id = proxy_listeners.find { |listener| listener[:id].to_i == id.to_i }
|
|
575
|
-
raise "ERROR: No proxy listener found with ID #{id}" if listener_by_id.nil?
|
|
576
|
-
|
|
577
|
-
bind_address = opts[:bindAddress] ||= listener_by_id[:bindAddress]
|
|
578
|
-
port = opts[:port] ||= listener_by_id[:port]
|
|
579
|
-
enabled = opts[:enabled] ||= listener_by_id[:enabled]
|
|
580
|
-
|
|
581
|
-
post_body = {
|
|
582
|
-
id: id.to_s,
|
|
583
|
-
bindAddress: bind_address,
|
|
584
|
-
port: port,
|
|
585
|
-
enabled: enabled
|
|
586
|
-
}.to_json
|
|
587
|
-
|
|
588
|
-
listener = rest_browser.put("http://#{mitm_rest_api}/proxy/listeners/#{id}", post_body, content_type: 'application/json; charset=UTF8')
|
|
589
|
-
JSON.parse(listener, symbolize_names: true)
|
|
590
|
-
rescue StandardError => e
|
|
591
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
592
|
-
raise e
|
|
593
|
-
end
|
|
594
|
-
|
|
595
|
-
# Supported Method Parameters::
|
|
596
|
-
# PWN::Plugins::BurpSuite.delete_proxy_listener(
|
|
597
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
598
|
-
# id: 'optional - ID of the proxy listener (defaults to 0)'
|
|
599
|
-
# )
|
|
600
|
-
|
|
601
|
-
public_class_method def self.delete_proxy_listener(opts = {})
|
|
602
|
-
burp_obj = opts[:burp_obj]
|
|
603
|
-
rest_browser = burp_obj[:rest_browser]
|
|
604
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
605
|
-
id = opts[:id] ||= 0
|
|
606
|
-
proxy_listeners = get_proxy_listeners(burp_obj: burp_obj)
|
|
607
|
-
listener_by_id = proxy_listeners.find { |listener| listener[:id].to_i == id.to_i }
|
|
608
|
-
raise "ERROR: No proxy listener found with ID #{id}" if listener_by_id.nil?
|
|
609
|
-
|
|
610
|
-
rest_browser.delete("http://#{mitm_rest_api}/proxy/listeners/#{id}")
|
|
611
|
-
true # Return true to indicate successful deletion (or error if API fails)
|
|
612
|
-
rescue StandardError => e
|
|
613
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
614
|
-
raise e
|
|
615
|
-
end
|
|
616
|
-
|
|
617
|
-
# Supported Method Parameters::
|
|
618
|
-
# json_proxy_history = PWN::Plugins::BurpSuite.get_proxy_history(
|
|
619
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
620
|
-
# keyword: 'optional - keyword to filter proxy history entries (default: nil)',
|
|
621
|
-
# return_as: 'optional - :base64 or :har (defaults to :base64)'
|
|
622
|
-
# )
|
|
623
|
-
|
|
624
|
-
public_class_method def self.get_proxy_history(opts = {})
|
|
625
|
-
burp_obj = opts[:burp_obj]
|
|
626
|
-
rest_browser = burp_obj[:rest_browser]
|
|
627
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
628
|
-
keyword = opts[:keyword]
|
|
629
|
-
return_as = opts[:return_as] ||= :base64
|
|
630
|
-
|
|
631
|
-
rest_call = "http://#{mitm_rest_api}/proxy/history"
|
|
632
|
-
|
|
633
|
-
sitemap = rest_browser.get(
|
|
634
|
-
rest_call,
|
|
635
|
-
content_type: 'application/json; charset=UTF8'
|
|
636
|
-
)
|
|
637
|
-
|
|
638
|
-
sitemap_arr = JSON.parse(sitemap, symbolize_names: true)
|
|
639
|
-
|
|
640
|
-
if keyword
|
|
641
|
-
sitemap_arr = sitemap_arr.select do |site|
|
|
642
|
-
decoded_request = Base64.strict_decode64(site[:request])
|
|
643
|
-
decoded_request.include?(keyword)
|
|
644
|
-
end
|
|
645
|
-
end
|
|
646
|
-
|
|
647
|
-
if return_as == :har
|
|
648
|
-
# Convert to HAR format
|
|
649
|
-
har_entries = sitemap_arr.map do |site|
|
|
650
|
-
decoded_request = Base64.strict_decode64(site[:request])
|
|
651
|
-
|
|
652
|
-
# Parse request head and body
|
|
653
|
-
if decoded_request.include?("\r\n\r\n")
|
|
654
|
-
request_head, request_body = decoded_request.split("\r\n\r\n", 2)
|
|
655
|
-
else
|
|
656
|
-
request_head = decoded_request
|
|
657
|
-
request_body = ''
|
|
658
|
-
end
|
|
659
|
-
request_lines = request_head.split("\r\n")
|
|
660
|
-
request_line = request_lines.shift
|
|
661
|
-
method, full_path, http_version = request_line.split(' ', 3)
|
|
662
|
-
headers = {}
|
|
663
|
-
request_lines.each do |line|
|
|
664
|
-
next if line.empty?
|
|
665
|
-
|
|
666
|
-
key, value = line.split(': ', 2)
|
|
667
|
-
headers[key] = value if key && value
|
|
668
|
-
end
|
|
669
|
-
|
|
670
|
-
host = headers['Host'] || raise('No Host header found in request')
|
|
671
|
-
scheme = 'http' # Hardcoded as protocol is not available; consider enhancing if available in site
|
|
672
|
-
url = "#{scheme}://#{host}#{full_path}"
|
|
673
|
-
uri = URI.parse(url)
|
|
674
|
-
query_string = uri.query ? URI.decode_www_form(uri.query).map { |k, v| { name: k, value: v.to_s } } : []
|
|
675
|
-
|
|
676
|
-
request_headers_size = request_head.bytesize + 4 # Account for \r\n\r\n
|
|
677
|
-
request_body_size = request_body.bytesize
|
|
678
|
-
|
|
679
|
-
request_obj = {
|
|
680
|
-
method: method,
|
|
681
|
-
url: uri.to_s,
|
|
682
|
-
httpVersion: http_version,
|
|
683
|
-
headers: headers.map { |k, v| { name: k, value: v } },
|
|
684
|
-
queryString: query_string,
|
|
685
|
-
headersSize: request_headers_size,
|
|
686
|
-
bodySize: request_body_size
|
|
687
|
-
}
|
|
688
|
-
|
|
689
|
-
if request_body_size.positive?
|
|
690
|
-
mime_type = headers['Content-Type'] || 'application/octet-stream'
|
|
691
|
-
post_data = {
|
|
692
|
-
mimeType: mime_type,
|
|
693
|
-
text: request_body
|
|
694
|
-
}
|
|
695
|
-
post_data[:params] = URI.decode_www_form(request_body).map { |k, v| { name: k, value: v.to_s } } if mime_type.include?('x-www-form-urlencoded')
|
|
696
|
-
request_obj[:postData] = post_data
|
|
697
|
-
end
|
|
698
|
-
|
|
699
|
-
if site[:response]
|
|
700
|
-
decoded_response = Base64.strict_decode64(site[:response])
|
|
701
|
-
|
|
702
|
-
# Parse response head and body
|
|
703
|
-
if decoded_response.include?("\r\n\r\n")
|
|
704
|
-
response_head, response_body = decoded_response.split("\r\n\r\n", 2)
|
|
705
|
-
else
|
|
706
|
-
response_head = decoded_response
|
|
707
|
-
response_body = ''
|
|
708
|
-
end
|
|
709
|
-
response_lines = response_head.split("\r\n")
|
|
710
|
-
status_line = response_lines.shift
|
|
711
|
-
version, status_str, status_text = status_line.split(' ', 3)
|
|
712
|
-
status = status_str.to_i
|
|
713
|
-
status_text ||= ''
|
|
714
|
-
response_headers = {}
|
|
715
|
-
response_lines.each do |line|
|
|
716
|
-
next if line.empty?
|
|
717
|
-
|
|
718
|
-
key, value = line.split(': ', 2)
|
|
719
|
-
response_headers[key] = value if key && value
|
|
720
|
-
end
|
|
721
|
-
|
|
722
|
-
response_headers_size = response_head.bytesize + 4 # Account for \r\n\r\n
|
|
723
|
-
response_body_size = response_body.bytesize
|
|
724
|
-
mime_type = response_headers['Content-Type'] || 'text/plain'
|
|
725
|
-
|
|
726
|
-
response_obj = {
|
|
727
|
-
status: status,
|
|
728
|
-
statusText: status_text,
|
|
729
|
-
httpVersion: version,
|
|
730
|
-
headers: response_headers.map { |k, v| { name: k, value: v } },
|
|
731
|
-
content: {
|
|
732
|
-
size: response_body_size,
|
|
733
|
-
mimeType: mime_type,
|
|
734
|
-
text: response_body
|
|
735
|
-
},
|
|
736
|
-
redirectURL: response_headers['Location'] || '',
|
|
737
|
-
headersSize: response_headers_size,
|
|
738
|
-
bodySize: response_body_size
|
|
739
|
-
}
|
|
740
|
-
else
|
|
741
|
-
response_obj = {
|
|
742
|
-
status: 0,
|
|
743
|
-
statusText: 'No response',
|
|
744
|
-
httpVersion: 'unknown',
|
|
745
|
-
headers: [],
|
|
746
|
-
content: {
|
|
747
|
-
size: 0,
|
|
748
|
-
mimeType: 'text/plain',
|
|
749
|
-
text: ''
|
|
750
|
-
},
|
|
751
|
-
redirectURL: '',
|
|
752
|
-
headersSize: -1,
|
|
753
|
-
bodySize: 0
|
|
754
|
-
}
|
|
755
|
-
end
|
|
756
|
-
|
|
757
|
-
{
|
|
758
|
-
startedDateTime: Time.now.iso8601,
|
|
759
|
-
time: 0,
|
|
760
|
-
request: request_obj,
|
|
761
|
-
response: response_obj,
|
|
762
|
-
cache: {},
|
|
763
|
-
timings: {
|
|
764
|
-
send: 0,
|
|
765
|
-
wait: 0,
|
|
766
|
-
receive: 0
|
|
767
|
-
},
|
|
768
|
-
pageref: 'page_1'
|
|
769
|
-
}
|
|
770
|
-
end
|
|
771
|
-
|
|
772
|
-
har_log = {
|
|
773
|
-
log: {
|
|
774
|
-
version: '1.2',
|
|
775
|
-
creator: {
|
|
776
|
-
name: 'BurpSuite via PWN::Plugins::BurpSuite',
|
|
777
|
-
version: '1.0'
|
|
778
|
-
},
|
|
779
|
-
pages: [{
|
|
780
|
-
startedDateTime: Time.now.iso8601,
|
|
781
|
-
id: 'page_1',
|
|
782
|
-
title: 'Sitemap Export',
|
|
783
|
-
pageTimings: {}
|
|
784
|
-
}],
|
|
785
|
-
entries: har_entries
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
sitemap_arr = har_log
|
|
790
|
-
end
|
|
791
|
-
|
|
792
|
-
sitemap_arr.uniq
|
|
793
|
-
rescue StandardError => e
|
|
794
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
795
|
-
raise e
|
|
796
|
-
end
|
|
797
|
-
|
|
798
|
-
# Supported Method Parameters::
|
|
799
|
-
# json_proxy_history = PWN::Plugins::BurpSuite.update_proxy_history(
|
|
800
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
801
|
-
# entry: 'required - hash of the proxy history entry to update'
|
|
802
|
-
# )
|
|
803
|
-
|
|
804
|
-
public_class_method def self.update_proxy_history(opts = {})
|
|
805
|
-
burp_obj = opts[:burp_obj]
|
|
806
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
807
|
-
|
|
808
|
-
entry = opts[:entry]
|
|
809
|
-
raise 'ERROR: entry parameter is required and must be a hash' unless entry.is_a?(Hash)
|
|
810
|
-
|
|
811
|
-
id = entry[:id]
|
|
812
|
-
raise 'ERROR: id key value pair is required within entry hash' if id.nil?
|
|
813
|
-
|
|
814
|
-
rest_browser = burp_obj[:rest_browser]
|
|
815
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
816
|
-
|
|
817
|
-
# Only allow updating of comment and highlight fields
|
|
818
|
-
entry.delete(:request)
|
|
819
|
-
entry.delete(:response)
|
|
820
|
-
entry.delete(:http_service)
|
|
821
|
-
|
|
822
|
-
put_body = entry.to_json
|
|
823
|
-
|
|
824
|
-
proxy_history_resp = rest_browser.put(
|
|
825
|
-
"http://#{mitm_rest_api}/proxy/history/#{id}",
|
|
826
|
-
put_body,
|
|
827
|
-
content_type: 'application/json; charset=UTF8'
|
|
828
|
-
)
|
|
829
|
-
|
|
830
|
-
JSON.parse(proxy_history_resp, symbolize_names: true)
|
|
831
|
-
rescue StandardError => e
|
|
832
|
-
raise e
|
|
833
|
-
end
|
|
834
|
-
|
|
835
|
-
# Supported Method Parameters::
|
|
836
|
-
# json_web_socket_history = PWN::Plugins::BurpSuite.get_websocket_history(
|
|
837
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
838
|
-
# keyword: 'optional - keyword to filter websocket history entries (default: nil)'
|
|
839
|
-
# )
|
|
840
|
-
|
|
841
|
-
public_class_method def self.get_websocket_history(opts = {})
|
|
842
|
-
burp_obj = opts[:burp_obj]
|
|
843
|
-
rest_browser = burp_obj[:rest_browser]
|
|
844
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
845
|
-
keyword = opts[:keyword]
|
|
846
|
-
|
|
847
|
-
rest_call = "http://#{mitm_rest_api}/websocket/history"
|
|
848
|
-
|
|
849
|
-
sitemap = rest_browser.get(
|
|
850
|
-
rest_call,
|
|
851
|
-
content_type: 'application/json; charset=UTF8'
|
|
852
|
-
)
|
|
853
|
-
|
|
854
|
-
sitemap_arr = JSON.parse(sitemap, symbolize_names: true)
|
|
855
|
-
|
|
856
|
-
if keyword
|
|
857
|
-
sitemap_arr = sitemap_arr.select do |site|
|
|
858
|
-
decoded_request = Base64.strict_decode64(site[:request])
|
|
859
|
-
decoded_request.include?(keyword)
|
|
860
|
-
end
|
|
861
|
-
end
|
|
862
|
-
|
|
863
|
-
sitemap_arr.uniq
|
|
864
|
-
rescue StandardError => e
|
|
865
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
866
|
-
raise e
|
|
867
|
-
end
|
|
868
|
-
|
|
869
|
-
# Supported Method Parameters::
|
|
870
|
-
# json_proxy_history = PWN::Plugins::BurpSuite.update_proxy_history(
|
|
871
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
872
|
-
# entry: 'required - hash of the websocket history entry to update'
|
|
873
|
-
# )
|
|
874
|
-
|
|
875
|
-
public_class_method def self.update_websocket_history(opts = {})
|
|
876
|
-
burp_obj = opts[:burp_obj]
|
|
877
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
878
|
-
|
|
879
|
-
entry = opts[:entry]
|
|
880
|
-
raise 'ERROR: entry parameter is required and must be a hash' unless entry.is_a?(Hash)
|
|
881
|
-
|
|
882
|
-
id = entry[:id]
|
|
883
|
-
raise 'ERROR: id key value pair is required within entry hash' if id.nil?
|
|
884
|
-
|
|
885
|
-
rest_browser = burp_obj[:rest_browser]
|
|
886
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
887
|
-
|
|
888
|
-
# Only allow updating of comment and highlight fields
|
|
889
|
-
entry.delete(:web_socket_id)
|
|
890
|
-
entry.delete(:direction)
|
|
891
|
-
entry.delete(:payload)
|
|
892
|
-
|
|
893
|
-
put_body = entry.to_json
|
|
894
|
-
|
|
895
|
-
proxy_history_resp = rest_browser.put(
|
|
896
|
-
"http://#{mitm_rest_api}/websocket/history/#{id}",
|
|
897
|
-
put_body,
|
|
898
|
-
content_type: 'application/json; charset=UTF8'
|
|
899
|
-
)
|
|
900
|
-
|
|
901
|
-
JSON.parse(proxy_history_resp, symbolize_names: true)
|
|
902
|
-
rescue StandardError => e
|
|
903
|
-
raise e
|
|
904
|
-
end
|
|
905
|
-
|
|
906
|
-
# Supported Method Parameters::
|
|
907
|
-
# json_sitemap = PWN::Plugins::BurpSuite.get_sitemap(
|
|
908
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
909
|
-
# keyword: 'optional - keyword to filter sitemap entries (default: nil)',
|
|
910
|
-
# return_as: 'optional - :base64 or :har (defaults to :base64)'
|
|
911
|
-
# )
|
|
912
|
-
|
|
913
|
-
public_class_method def self.get_sitemap(opts = {})
|
|
914
|
-
burp_obj = opts[:burp_obj]
|
|
915
|
-
rest_browser = burp_obj[:rest_browser]
|
|
916
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
917
|
-
keyword = opts[:keyword]
|
|
918
|
-
return_as = opts[:return_as] ||= :base64
|
|
919
|
-
|
|
920
|
-
rest_call = "http://#{mitm_rest_api}/sitemap"
|
|
921
|
-
|
|
922
|
-
sitemap = rest_browser.get(
|
|
923
|
-
rest_call,
|
|
924
|
-
content_type: 'application/json; charset=UTF8'
|
|
925
|
-
)
|
|
926
|
-
|
|
927
|
-
sitemap_arr = JSON.parse(sitemap, symbolize_names: true)
|
|
928
|
-
|
|
929
|
-
if keyword
|
|
930
|
-
sitemap_arr = sitemap_arr.select do |site|
|
|
931
|
-
decoded_request = Base64.strict_decode64(site[:request])
|
|
932
|
-
decoded_request.include?(keyword)
|
|
933
|
-
end
|
|
934
|
-
end
|
|
935
|
-
|
|
936
|
-
if return_as == :har
|
|
937
|
-
# Convert to HAR format
|
|
938
|
-
har_entries = sitemap_arr.map do |site|
|
|
939
|
-
decoded_request = Base64.strict_decode64(site[:request])
|
|
940
|
-
|
|
941
|
-
# Parse request head and body
|
|
942
|
-
if decoded_request.include?("\r\n\r\n")
|
|
943
|
-
request_head, request_body = decoded_request.split("\r\n\r\n", 2)
|
|
944
|
-
else
|
|
945
|
-
request_head = decoded_request
|
|
946
|
-
request_body = ''
|
|
947
|
-
end
|
|
948
|
-
request_lines = request_head.split("\r\n")
|
|
949
|
-
request_line = request_lines.shift
|
|
950
|
-
method, full_path, http_version = request_line.split(' ', 3)
|
|
951
|
-
headers = {}
|
|
952
|
-
request_lines.each do |line|
|
|
953
|
-
next if line.empty?
|
|
954
|
-
|
|
955
|
-
key, value = line.split(': ', 2)
|
|
956
|
-
headers[key] = value if key && value
|
|
957
|
-
end
|
|
958
|
-
|
|
959
|
-
host = headers['Host'] || raise('No Host header found in request')
|
|
960
|
-
scheme = 'http' # Hardcoded as protocol is not available; consider enhancing if available in site
|
|
961
|
-
url = "#{scheme}://#{host}#{full_path}"
|
|
962
|
-
uri = URI.parse(url)
|
|
963
|
-
query_string = uri.query ? URI.decode_www_form(uri.query).map { |k, v| { name: k, value: v.to_s } } : []
|
|
964
|
-
|
|
965
|
-
request_headers_size = request_head.bytesize + 4 # Account for \r\n\r\n
|
|
966
|
-
request_body_size = request_body.bytesize
|
|
967
|
-
|
|
968
|
-
request_obj = {
|
|
969
|
-
method: method,
|
|
970
|
-
url: uri.to_s,
|
|
971
|
-
httpVersion: http_version,
|
|
972
|
-
headers: headers.map { |k, v| { name: k, value: v } },
|
|
973
|
-
queryString: query_string,
|
|
974
|
-
headersSize: request_headers_size,
|
|
975
|
-
bodySize: request_body_size
|
|
976
|
-
}
|
|
977
|
-
|
|
978
|
-
if request_body_size.positive?
|
|
979
|
-
mime_type = headers['Content-Type'] || 'application/octet-stream'
|
|
980
|
-
post_data = {
|
|
981
|
-
mimeType: mime_type,
|
|
982
|
-
text: request_body
|
|
983
|
-
}
|
|
984
|
-
post_data[:params] = URI.decode_www_form(request_body).map { |k, v| { name: k, value: v.to_s } } if mime_type.include?('x-www-form-urlencoded')
|
|
985
|
-
request_obj[:postData] = post_data
|
|
986
|
-
end
|
|
987
|
-
|
|
988
|
-
if site[:response]
|
|
989
|
-
decoded_response = Base64.strict_decode64(site[:response])
|
|
990
|
-
|
|
991
|
-
# Parse response head and body
|
|
992
|
-
if decoded_response.include?("\r\n\r\n")
|
|
993
|
-
response_head, response_body = decoded_response.split("\r\n\r\n", 2)
|
|
994
|
-
else
|
|
995
|
-
response_head = decoded_response
|
|
996
|
-
response_body = ''
|
|
997
|
-
end
|
|
998
|
-
response_lines = response_head.split("\r\n")
|
|
999
|
-
status_line = response_lines.shift
|
|
1000
|
-
version, status_str, status_text = status_line.split(' ', 3)
|
|
1001
|
-
status = status_str.to_i
|
|
1002
|
-
status_text ||= ''
|
|
1003
|
-
response_headers = {}
|
|
1004
|
-
response_lines.each do |line|
|
|
1005
|
-
next if line.empty?
|
|
1006
|
-
|
|
1007
|
-
key, value = line.split(': ', 2)
|
|
1008
|
-
response_headers[key] = value if key && value
|
|
1009
|
-
end
|
|
1010
|
-
|
|
1011
|
-
response_headers_size = response_head.bytesize + 4 # Account for \r\n\r\n
|
|
1012
|
-
response_body_size = response_body.bytesize
|
|
1013
|
-
mime_type = response_headers['Content-Type'] || 'text/plain'
|
|
1014
|
-
|
|
1015
|
-
response_obj = {
|
|
1016
|
-
status: status,
|
|
1017
|
-
statusText: status_text,
|
|
1018
|
-
httpVersion: version,
|
|
1019
|
-
headers: response_headers.map { |k, v| { name: k, value: v } },
|
|
1020
|
-
content: {
|
|
1021
|
-
size: response_body_size,
|
|
1022
|
-
mimeType: mime_type,
|
|
1023
|
-
text: response_body
|
|
1024
|
-
},
|
|
1025
|
-
redirectURL: response_headers['Location'] || '',
|
|
1026
|
-
headersSize: response_headers_size,
|
|
1027
|
-
bodySize: response_body_size
|
|
1028
|
-
}
|
|
1029
|
-
else
|
|
1030
|
-
response_obj = {
|
|
1031
|
-
status: 0,
|
|
1032
|
-
statusText: 'No response',
|
|
1033
|
-
httpVersion: 'unknown',
|
|
1034
|
-
headers: [],
|
|
1035
|
-
content: {
|
|
1036
|
-
size: 0,
|
|
1037
|
-
mimeType: 'text/plain',
|
|
1038
|
-
text: ''
|
|
1039
|
-
},
|
|
1040
|
-
redirectURL: '',
|
|
1041
|
-
headersSize: -1,
|
|
1042
|
-
bodySize: 0
|
|
1043
|
-
}
|
|
1044
|
-
end
|
|
1045
|
-
|
|
1046
|
-
{
|
|
1047
|
-
startedDateTime: Time.now.iso8601,
|
|
1048
|
-
time: 0,
|
|
1049
|
-
request: request_obj,
|
|
1050
|
-
response: response_obj,
|
|
1051
|
-
cache: {},
|
|
1052
|
-
timings: {
|
|
1053
|
-
send: 0,
|
|
1054
|
-
wait: 0,
|
|
1055
|
-
receive: 0
|
|
1056
|
-
},
|
|
1057
|
-
pageref: 'page_1'
|
|
1058
|
-
}
|
|
1059
|
-
end
|
|
1060
|
-
|
|
1061
|
-
har_log = {
|
|
1062
|
-
log: {
|
|
1063
|
-
version: '1.2',
|
|
1064
|
-
creator: {
|
|
1065
|
-
name: 'BurpSuite via PWN::Plugins::BurpSuite',
|
|
1066
|
-
version: '1.0'
|
|
1067
|
-
},
|
|
1068
|
-
pages: [{
|
|
1069
|
-
startedDateTime: Time.now.iso8601,
|
|
1070
|
-
id: 'page_1',
|
|
1071
|
-
title: 'Sitemap Export',
|
|
1072
|
-
pageTimings: {}
|
|
1073
|
-
}],
|
|
1074
|
-
entries: har_entries
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
sitemap_arr = har_log
|
|
1079
|
-
end
|
|
1080
|
-
|
|
1081
|
-
sitemap_arr.uniq
|
|
1082
|
-
rescue StandardError => e
|
|
1083
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
1084
|
-
raise e
|
|
1085
|
-
end
|
|
1086
|
-
|
|
1087
|
-
# Supported Method Parameters:
|
|
1088
|
-
# json_sitemap = PWN::Plugins::BurpSuite.add_to_sitemap(
|
|
1089
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1090
|
-
# sitemap: 'required - sitemap hash to add',
|
|
1091
|
-
# debug: 'optional - boolean to enable sitemap debugging (default: false)'
|
|
1092
|
-
# )
|
|
1093
|
-
#
|
|
1094
|
-
# Example:
|
|
1095
|
-
# json_sitemap = PWN::Plugins::BurpSuite.add_to_sitemap(
|
|
1096
|
-
# burp_obj: burp_obj,
|
|
1097
|
-
# sitemap: {
|
|
1098
|
-
# request: 'base64_encoded_request_string',
|
|
1099
|
-
# response: 'base64_encoded_response_string',
|
|
1100
|
-
# highlight: 'NONE'||'RED'||'ORANGE'||'YELLOW'||'GREEN'||'CYAN'||'BLUE'||'PINK'||'MAGENTA'||'GRAY',
|
|
1101
|
-
# comment: 'optional comment for the sitemap entry',
|
|
1102
|
-
# http_service: {
|
|
1103
|
-
# host: 'example.com',
|
|
1104
|
-
# port: 80,
|
|
1105
|
-
# protocol: 'http'
|
|
1106
|
-
# }
|
|
1107
|
-
# }
|
|
1108
|
-
|
|
1109
|
-
public_class_method def self.add_to_sitemap(opts = {})
|
|
1110
|
-
burp_obj = opts[:burp_obj]
|
|
1111
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1112
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1113
|
-
sitemap = opts[:sitemap] ||= {}
|
|
1114
|
-
debug = opts[:debug] || false
|
|
1115
|
-
|
|
1116
|
-
rest_client = rest_browser::Request
|
|
1117
|
-
response = rest_client.execute(
|
|
1118
|
-
method: :post,
|
|
1119
|
-
url: "http://#{mitm_rest_api}/sitemap",
|
|
1120
|
-
payload: sitemap.to_json,
|
|
1121
|
-
headers: { content_type: 'application/json; charset=UTF-8' },
|
|
1122
|
-
timeout: 10
|
|
1123
|
-
)
|
|
1124
|
-
|
|
1125
|
-
if debug
|
|
1126
|
-
puts "\nSubmitted:"
|
|
1127
|
-
puts sitemap.inspect
|
|
1128
|
-
print 'Press Enter to continue...'
|
|
1129
|
-
gets
|
|
1130
|
-
end
|
|
1131
|
-
# Return response body (assumed to be JSON)
|
|
1132
|
-
JSON.parse(response.body, symbolize_names: true)
|
|
1133
|
-
rescue RestClient::ExceptionWithResponse => e
|
|
1134
|
-
puts "ERROR: Failed to add to sitemap: #{e.message}"
|
|
1135
|
-
puts "HTTP error adding to sitemap: Status #{e.response.code}, Response: #{e.response.body}" if e.respond_to?(:response) && e.response.respond_to?(:code) && e.response.respond_to?(:body)
|
|
1136
|
-
rescue StandardError => e
|
|
1137
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
1138
|
-
raise e
|
|
1139
|
-
end
|
|
1140
|
-
|
|
1141
|
-
# Supported Method Parameters::
|
|
1142
|
-
# json_sitemap = PWN::Plugins::BurpSuite.update_sitemap(
|
|
1143
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1144
|
-
# entry: 'required - hash of the sitemap entry to update'
|
|
1145
|
-
# )
|
|
1146
|
-
|
|
1147
|
-
public_class_method def self.update_sitemap(opts = {})
|
|
1148
|
-
burp_obj = opts[:burp_obj]
|
|
1149
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1150
|
-
|
|
1151
|
-
entry = opts[:entry]
|
|
1152
|
-
raise 'ERROR: entry parameter is required and must be a hash' unless entry.is_a?(Hash)
|
|
1153
|
-
|
|
1154
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1155
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1156
|
-
|
|
1157
|
-
# Only allow updating of comment and highlight fields
|
|
1158
|
-
# NOTE we need the request as its used to identify the sitemap entry to update
|
|
1159
|
-
entry.delete(:response)
|
|
1160
|
-
entry.delete(:http_service)
|
|
1161
|
-
|
|
1162
|
-
put_body = entry.to_json
|
|
1163
|
-
|
|
1164
|
-
sitemap_resp = rest_browser.put(
|
|
1165
|
-
"http://#{mitm_rest_api}/sitemap",
|
|
1166
|
-
put_body,
|
|
1167
|
-
content_type: 'application/json; charset=UTF8'
|
|
1168
|
-
)
|
|
1169
|
-
|
|
1170
|
-
JSON.parse(sitemap_resp, symbolize_names: true)
|
|
1171
|
-
rescue StandardError => e
|
|
1172
|
-
raise e
|
|
1173
|
-
end
|
|
1174
|
-
|
|
1175
|
-
# Supported Method Parameters:
|
|
1176
|
-
# json_sitemap = PWN::Plugins::BurpSuite.import_openapi_to_sitemap(
|
|
1177
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1178
|
-
# openapi_spec: 'required - path to OpenAPI JSON or YAML specification file',
|
|
1179
|
-
# additional_http_headers: 'optional - hash of additional HTTP headers to include in requests (default: {})',
|
|
1180
|
-
# highlight: 'optional - highlight color for the sitemap entry (default: "NONE")',
|
|
1181
|
-
# comment: 'optional - comment for the sitemap entry (default: "")',
|
|
1182
|
-
# debug: 'optional - boolean to enable debug logging (default: false)'
|
|
1183
|
-
# )
|
|
1184
|
-
public_class_method def self.import_openapi_to_sitemap(opts = {})
|
|
1185
|
-
burp_obj = opts[:burp_obj]
|
|
1186
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1187
|
-
|
|
1188
|
-
openapi_spec = opts[:openapi_spec]
|
|
1189
|
-
raise 'ERROR: openapi_spec parameter is required' if openapi_spec.nil?
|
|
1190
|
-
|
|
1191
|
-
additional_http_headers = opts[:additional_http_headers] ||= {}
|
|
1192
|
-
raise 'ERROR: additional_http_headers must be a Hash' unless additional_http_headers.is_a?(Hash)
|
|
1193
|
-
|
|
1194
|
-
highlight = opts[:highlight] ||= 'NONE'
|
|
1195
|
-
comment = opts[:comment].to_s.scrub
|
|
1196
|
-
|
|
1197
|
-
debug = opts[:debug] || false
|
|
1198
|
-
|
|
1199
|
-
openapi_spec_root = File.dirname(openapi_spec)
|
|
1200
|
-
Dir.chdir(openapi_spec_root)
|
|
1201
|
-
|
|
1202
|
-
# Parse the OpenAPI JSON or YAML specification file
|
|
1203
|
-
# If the openapi_spec is YAML, convert it to JSON
|
|
1204
|
-
openapi = if openapi_spec.end_with?('.json')
|
|
1205
|
-
JSON.parse(File.read(openapi_spec), symbolize_names: true)
|
|
1206
|
-
elsif openapi_spec.end_with?('.yaml', '.yml')
|
|
1207
|
-
YAML.safe_load_file(openapi_spec, permitted_classes: [Symbol, Date, Time], aliases: true, symbolize_names: true)
|
|
1208
|
-
else
|
|
1209
|
-
raise "ERROR: Unsupported file extension for #{openapi_spec}. Expected .json, .yaml, or .yml."
|
|
1210
|
-
end
|
|
1211
|
-
|
|
1212
|
-
# Initialize result array
|
|
1213
|
-
sitemap_arr = []
|
|
1214
|
-
|
|
1215
|
-
# Get servers; default to empty array if not present
|
|
1216
|
-
servers = openapi[:servers].is_a?(Array) ? openapi[:servers] : []
|
|
1217
|
-
if servers.empty?
|
|
1218
|
-
warn("No servers defined in #{openapi_spec}. Using default server 'http://localhost'.")
|
|
1219
|
-
servers = [{ url: 'http://localhost', description: 'Default server' }]
|
|
1220
|
-
end
|
|
1221
|
-
|
|
1222
|
-
# Valid HTTP methods for validation
|
|
1223
|
-
valid_methods = %w[get post put patch delete head options trace connect]
|
|
1224
|
-
|
|
1225
|
-
# Helper lambda to resolve $ref in schemas
|
|
1226
|
-
resolve_ref = lambda do |openapi, ref|
|
|
1227
|
-
return nil unless ref&.start_with?('#/')
|
|
1228
|
-
|
|
1229
|
-
parts = ref.sub('#/', '').split('/')
|
|
1230
|
-
resolved = openapi
|
|
1231
|
-
parts.each do |part|
|
|
1232
|
-
resolved = resolved[part.to_sym]
|
|
1233
|
-
return nil unless resolved
|
|
1234
|
-
end
|
|
1235
|
-
resolved
|
|
1236
|
-
end
|
|
1237
|
-
|
|
1238
|
-
# Iterate through each server
|
|
1239
|
-
servers.each do |server|
|
|
1240
|
-
server_url = server[:url]
|
|
1241
|
-
unless server_url.is_a?(String)
|
|
1242
|
-
warn("[ERROR] Invalid server URL type '#{server_url.class}' in #{openapi_spec}: Expected String, got #{server_url.inspect}")
|
|
1243
|
-
next
|
|
1244
|
-
end
|
|
1245
|
-
|
|
1246
|
-
begin
|
|
1247
|
-
uri = URI.parse(server_url)
|
|
1248
|
-
host = uri.host
|
|
1249
|
-
port = uri.port
|
|
1250
|
-
protocol = uri.scheme
|
|
1251
|
-
server_path = uri.path&.sub(%r{^/+}, '')&.sub(%r{/+$}, '') || ''
|
|
1252
|
-
|
|
1253
|
-
warn("[DEBUG] Processing server: #{server_url}, host: #{host}, port: #{port}, protocol: #{protocol}, server_path: #{server_path}") if debug
|
|
1254
|
-
|
|
1255
|
-
# Iterate through each path and its methods
|
|
1256
|
-
openapi[:paths]&.each do |path, methods|
|
|
1257
|
-
# Convert path to string, handling different types
|
|
1258
|
-
path_str = case path
|
|
1259
|
-
when Symbol, String
|
|
1260
|
-
path.to_s
|
|
1261
|
-
else
|
|
1262
|
-
warn("[ERROR] Invalid path type '#{path.class}' in #{openapi_spec}: Expected Symbol or String, got #{path.inspect}")
|
|
1263
|
-
'/' # Fallback to root path
|
|
1264
|
-
end
|
|
1265
|
-
|
|
1266
|
-
# Construct full path by prepending server path if present
|
|
1267
|
-
full_path = server_path.empty? ? path_str : "/#{server_path}/#{path_str.sub(%r{^/+}, '')}".gsub(%r{/+}, '/')
|
|
1268
|
-
|
|
1269
|
-
# Initialize path-level parameters
|
|
1270
|
-
path_parameters = []
|
|
1271
|
-
|
|
1272
|
-
# Process methods based on type
|
|
1273
|
-
operations = []
|
|
1274
|
-
if methods.is_a?(Hash)
|
|
1275
|
-
# Extract path-level parameters
|
|
1276
|
-
path_parameters = methods[:parameters].is_a?(Array) ? methods[:parameters] : []
|
|
1277
|
-
warn("[DEBUG] Path-level parameters for #{full_path}: #{path_parameters.inspect}") if debug && !path_parameters.empty?
|
|
1278
|
-
|
|
1279
|
-
# Collect operations for valid HTTP methods
|
|
1280
|
-
methods.each do |method, details|
|
|
1281
|
-
method_str = case method
|
|
1282
|
-
when Symbol, String
|
|
1283
|
-
method.to_s.downcase
|
|
1284
|
-
else
|
|
1285
|
-
warn("[ERROR] Invalid method type '#{method.class}' for path '#{full_path}' in #{openapi_spec}: Expected Symbol or String, got #{method.inspect}")
|
|
1286
|
-
nil
|
|
1287
|
-
end
|
|
1288
|
-
|
|
1289
|
-
next unless method_str && valid_methods.include?(method_str)
|
|
1290
|
-
|
|
1291
|
-
operations << { method: method_str, details: details }
|
|
1292
|
-
end
|
|
1293
|
-
elsif methods.is_a?(Array)
|
|
1294
|
-
warn("[DEBUG] Methods is an array for path '#{full_path}' in #{openapi_spec}: #{methods.inspect}") if debug
|
|
1295
|
-
|
|
1296
|
-
# Look for parameters in the array
|
|
1297
|
-
param_entry = methods.find { |m| m.is_a?(Hash) && m[:parameters].is_a?(Array) }
|
|
1298
|
-
path_parameters = param_entry[:parameters] if param_entry
|
|
1299
|
-
warn("[DEBUG] Path-level parameters for #{full_path}: #{path_parameters.inspect}") if debug && !path_parameters.empty?
|
|
1300
|
-
|
|
1301
|
-
# Collect operations from array elements
|
|
1302
|
-
methods.each do |op|
|
|
1303
|
-
next unless op.is_a?(Hash)
|
|
1304
|
-
|
|
1305
|
-
# Infer method from operationId or other indicators
|
|
1306
|
-
method_str = if op[:operationId].is_a?(String)
|
|
1307
|
-
op_id = op[:operationId].downcase
|
|
1308
|
-
valid_methods.find { |m| op_id.start_with?(m) }
|
|
1309
|
-
elsif op[:method].is_a?(String) || op[:method].is_a?(Symbol)
|
|
1310
|
-
op[:method].to_s.downcase if valid_methods.include?(op[:method].to_s.downcase)
|
|
1311
|
-
end
|
|
1312
|
-
|
|
1313
|
-
if method_str
|
|
1314
|
-
operations << { method: method_str, details: op }
|
|
1315
|
-
else
|
|
1316
|
-
warn("[ERROR] Could not infer valid HTTP method for operation #{op.inspect} in path '#{full_path}' in #{openapi_spec}")
|
|
1317
|
-
end
|
|
1318
|
-
end
|
|
1319
|
-
else
|
|
1320
|
-
warn("[ERROR] Invalid methods type '#{methods.class}' for path '#{full_path}' in #{openapi_spec}: Expected Hash or Array, got #{methods.inspect}")
|
|
1321
|
-
end
|
|
1322
|
-
|
|
1323
|
-
# Process each operation
|
|
1324
|
-
operations.each do |op|
|
|
1325
|
-
method_str = op[:method]
|
|
1326
|
-
details = op[:details]
|
|
1327
|
-
|
|
1328
|
-
# Handle details based on type
|
|
1329
|
-
operation = case details
|
|
1330
|
-
when Hash
|
|
1331
|
-
details
|
|
1332
|
-
when Array
|
|
1333
|
-
# Find the first hash with responses, or use empty hash
|
|
1334
|
-
selected = details.find { |d| d.is_a?(Hash) && d[:responses].is_a?(Hash) }
|
|
1335
|
-
if selected
|
|
1336
|
-
selected
|
|
1337
|
-
else
|
|
1338
|
-
warn("[ERROR] No valid operation hash found in array for #{method_str.upcase} #{full_path} in #{openapi_spec}: Got #{details.inspect}")
|
|
1339
|
-
{}
|
|
1340
|
-
end
|
|
1341
|
-
else
|
|
1342
|
-
warn("[ERROR] Invalid details type '#{details.class}' for #{method_str.upcase} #{full_path} in #{openapi_spec}: Expected Hash or Array, got #{details.inspect}")
|
|
1343
|
-
{}
|
|
1344
|
-
end
|
|
1345
|
-
|
|
1346
|
-
# Skip if operation is empty (indicating invalid details)
|
|
1347
|
-
if operation.empty?
|
|
1348
|
-
warn("[DEBUG] Skipping #{method_str.upcase} #{full_path} due to invalid operation data") if debug
|
|
1349
|
-
next
|
|
1350
|
-
end
|
|
1351
|
-
|
|
1352
|
-
# Skip if no valid responses
|
|
1353
|
-
unless operation[:responses].is_a?(Hash)
|
|
1354
|
-
warn("[ERROR] No valid responses for #{method_str.upcase} #{full_path} in #{openapi_spec}: Expected Hash, got #{operation[:responses].inspect}")
|
|
1355
|
-
next
|
|
1356
|
-
end
|
|
1357
|
-
|
|
1358
|
-
begin
|
|
1359
|
-
# Construct HTTP request headers
|
|
1360
|
-
request_headers = {
|
|
1361
|
-
host: host
|
|
1362
|
-
}
|
|
1363
|
-
request_headers.merge!(additional_http_headers)
|
|
1364
|
-
|
|
1365
|
-
# Combine path-level and operation-level parameters
|
|
1366
|
-
operation_parameters = operation[:parameters].is_a?(Array) ? operation[:parameters] : []
|
|
1367
|
-
all_parameters = path_parameters + operation_parameters
|
|
1368
|
-
warn("[DEBUG] All parameters for #{method_str.upcase} #{full_path}: #{all_parameters.inspect}") if debug && !all_parameters.empty?
|
|
1369
|
-
|
|
1370
|
-
# Determine response code from operation[:responses].keys
|
|
1371
|
-
fallback_response_code = 200
|
|
1372
|
-
response_keys = operation[:responses].keys
|
|
1373
|
-
response_key = response_keys.find { |key| key.to_s.to_i.between?(100, 599) } || fallback_response_code.to_s
|
|
1374
|
-
response_code = response_key.to_s.to_i
|
|
1375
|
-
|
|
1376
|
-
# Construct response body from operation responses schema example, schema $ref example, etc.
|
|
1377
|
-
response_obj = operation[:responses][response_key] || {}
|
|
1378
|
-
content = response_obj[:content] || {}
|
|
1379
|
-
content_type = content.keys.first&.to_s || 'text/plain'
|
|
1380
|
-
|
|
1381
|
-
response_body = ''
|
|
1382
|
-
unless [204, 304].include?(response_code)
|
|
1383
|
-
content_obj = content[content_type.to_sym] || {}
|
|
1384
|
-
example = content_obj[:example]
|
|
1385
|
-
if example.nil? && content_obj[:examples].is_a?(Hash)
|
|
1386
|
-
ex_key = content_obj[:examples].keys.first
|
|
1387
|
-
if ex_key
|
|
1388
|
-
ex = content_obj[:examples][ex_key]
|
|
1389
|
-
if ex[:$ref]
|
|
1390
|
-
resolved_ex = resolve_ref.call(openapi, ex[:$ref])
|
|
1391
|
-
example = resolved_ex[:value] if resolved_ex
|
|
1392
|
-
else
|
|
1393
|
-
example = ex[:value]
|
|
1394
|
-
end
|
|
1395
|
-
end
|
|
1396
|
-
end
|
|
1397
|
-
|
|
1398
|
-
if example.nil?
|
|
1399
|
-
schema = content_obj[:schema]
|
|
1400
|
-
if schema
|
|
1401
|
-
if schema[:$ref]
|
|
1402
|
-
ref = schema[:$ref]
|
|
1403
|
-
if ref.start_with?('#/')
|
|
1404
|
-
parts = ref.sub('#/', '').split('/')
|
|
1405
|
-
resolved = openapi
|
|
1406
|
-
parts.each do |part|
|
|
1407
|
-
resolved = resolved[part.to_sym]
|
|
1408
|
-
break unless resolved
|
|
1409
|
-
end
|
|
1410
|
-
schema = resolved if resolved
|
|
1411
|
-
end
|
|
1412
|
-
end
|
|
1413
|
-
|
|
1414
|
-
example = schema[:example]
|
|
1415
|
-
if example.nil? && schema[:examples].is_a?(Hash)
|
|
1416
|
-
ex_key = schema[:examples].keys.first
|
|
1417
|
-
if ex_key
|
|
1418
|
-
ex = schema[:examples][ex_key]
|
|
1419
|
-
if ex[:$ref]
|
|
1420
|
-
resolved_ex = resolve_ref.call(openapi, ex[:$ref])
|
|
1421
|
-
example = resolved_ex[:value] if resolved_ex
|
|
1422
|
-
else
|
|
1423
|
-
example = ex[:value]
|
|
1424
|
-
end
|
|
1425
|
-
end
|
|
1426
|
-
end
|
|
1427
|
-
end
|
|
1428
|
-
end
|
|
1429
|
-
|
|
1430
|
-
response_body = example || response_obj[:description] || "INFO: Unable to resolve response body from #{openapi_spec} => { 'http_method': '#{method_str.upcase}', 'path': '#{full_path}', 'response_code': '#{response_code}' }"
|
|
1431
|
-
end
|
|
1432
|
-
|
|
1433
|
-
# Try to extract query samples from response example if it's a links object
|
|
1434
|
-
query_hash = nil
|
|
1435
|
-
if response_body.is_a?(Hash) && response_body[:links]
|
|
1436
|
-
href = response_body.dig(:links, :self, :href)
|
|
1437
|
-
# href ||= response_body[:links].values.first&.dig(:href) rescue nil
|
|
1438
|
-
if href.nil? && response_body[:links].is_a?(Hash) && !response_body[:links].empty?
|
|
1439
|
-
first_value = response_body[:links].values.first
|
|
1440
|
-
href = first_value[:href] if first_value.is_a?(Hash)
|
|
1441
|
-
end
|
|
1442
|
-
if href
|
|
1443
|
-
begin
|
|
1444
|
-
parsed_uri = URI.parse(href)
|
|
1445
|
-
query_hash = URI.decode_www_form(parsed_uri.query).to_h if parsed_uri.path.end_with?(path_str) && parsed_uri.query
|
|
1446
|
-
rescue URI::InvalidURIError => e
|
|
1447
|
-
warn("[DEBUG] Invalid href in response example: #{href} - #{e.message}") if debug
|
|
1448
|
-
end
|
|
1449
|
-
end
|
|
1450
|
-
end
|
|
1451
|
-
|
|
1452
|
-
# Process path parameters for substitution
|
|
1453
|
-
request_path = full_path.dup
|
|
1454
|
-
query_params = []
|
|
1455
|
-
|
|
1456
|
-
all_parameters.each do |param|
|
|
1457
|
-
next unless param.is_a?(Hash) && param[:name] && param[:in]
|
|
1458
|
-
|
|
1459
|
-
param_name = param[:name].to_s
|
|
1460
|
-
|
|
1461
|
-
# Get param_value with precedence: param.examples > param.example > schema.examples > schema.example > 'FUZZ'
|
|
1462
|
-
param_value = if param[:examples].is_a?(Hash) && !param[:examples].empty?
|
|
1463
|
-
first_ex = param[:examples].values.first
|
|
1464
|
-
if first_ex.is_a?(Hash)
|
|
1465
|
-
if first_ex[:$ref]
|
|
1466
|
-
# Resolve $ref for example if present
|
|
1467
|
-
resolved_ex = resolve_ref.call(openapi, first_ex[:$ref])
|
|
1468
|
-
resolved_ex[:value] if resolved_ex
|
|
1469
|
-
else
|
|
1470
|
-
first_ex[:value]
|
|
1471
|
-
end
|
|
1472
|
-
else
|
|
1473
|
-
first_ex
|
|
1474
|
-
end || 'FUZZ'
|
|
1475
|
-
elsif param.key?(:example)
|
|
1476
|
-
param[:example]
|
|
1477
|
-
else
|
|
1478
|
-
schema = param[:schema]
|
|
1479
|
-
if schema
|
|
1480
|
-
if schema[:$ref]
|
|
1481
|
-
resolved_schema = resolve_ref.call(openapi, schema[:$ref])
|
|
1482
|
-
schema = resolved_schema if resolved_schema
|
|
1483
|
-
end
|
|
1484
|
-
if schema[:examples].is_a?(Hash) && !schema[:examples].empty?
|
|
1485
|
-
first_ex = schema[:examples].values.first
|
|
1486
|
-
if first_ex.is_a?(Hash)
|
|
1487
|
-
if first_ex[:$ref]
|
|
1488
|
-
resolved_ex = resolve_ref.call(openapi, first_ex[:$ref])
|
|
1489
|
-
resolved_ex[:value] if resolved_ex
|
|
1490
|
-
else
|
|
1491
|
-
first_ex[:value]
|
|
1492
|
-
end
|
|
1493
|
-
else
|
|
1494
|
-
first_ex
|
|
1495
|
-
end || 'FUZZ'
|
|
1496
|
-
elsif schema.key?(:example)
|
|
1497
|
-
schema[:example]
|
|
1498
|
-
else
|
|
1499
|
-
'FUZZ'
|
|
1500
|
-
end
|
|
1501
|
-
else
|
|
1502
|
-
'FUZZ'
|
|
1503
|
-
end
|
|
1504
|
-
end
|
|
1505
|
-
|
|
1506
|
-
# If still 'FUZZ' and it's a query param, try to get from response example query_hash
|
|
1507
|
-
param_value = query_hash[param_name] if param_value == 'FUZZ' && param[:in] == 'query' && query_hash&.key?(param_name)
|
|
1508
|
-
|
|
1509
|
-
case param[:in]
|
|
1510
|
-
when 'header'
|
|
1511
|
-
# Aggregate remaining HTTP header names from spec,
|
|
1512
|
-
# reference as keys, and assign their respective
|
|
1513
|
-
# values to the request_headers hash
|
|
1514
|
-
param_key = param_name.downcase
|
|
1515
|
-
request_headers[param_key] = param_value.to_s
|
|
1516
|
-
when 'path'
|
|
1517
|
-
# Substitute path parameter with the resolved value
|
|
1518
|
-
request_path.gsub!("{#{param_name}}", param_value.to_s)
|
|
1519
|
-
when 'query'
|
|
1520
|
-
# Collect query parameters
|
|
1521
|
-
query_params.push("#{URI.encode_www_form_component(param_name)}=#{URI.encode_www_form_component(param_value.to_s)}")
|
|
1522
|
-
end
|
|
1523
|
-
end
|
|
1524
|
-
|
|
1525
|
-
# Append query parameters to path if any
|
|
1526
|
-
request_path += "?#{query_params.join('&')}" if query_params.any?
|
|
1527
|
-
|
|
1528
|
-
# Construct request lines, including all headers
|
|
1529
|
-
request_lines = [
|
|
1530
|
-
"#{method_str.upcase} #{request_path} HTTP/1.1"
|
|
1531
|
-
]
|
|
1532
|
-
request_headers.each do |key, value|
|
|
1533
|
-
# Capitalize header keys (e.g., 'host' to 'Host', 'authorization' to 'Authorization')
|
|
1534
|
-
header_key = key.to_s.split('-').map(&:capitalize).join('-')
|
|
1535
|
-
request_lines.push("#{header_key}: #{value}")
|
|
1536
|
-
end
|
|
1537
|
-
request_lines << '' << '' # Add blank lines for HTTP request body separation
|
|
1538
|
-
|
|
1539
|
-
request = request_lines.join("\r\n")
|
|
1540
|
-
encoded_request = Base64.strict_encode64(request)
|
|
1541
|
-
|
|
1542
|
-
response_status = case response_code
|
|
1543
|
-
when 200 then '200 OK'
|
|
1544
|
-
when 201 then '201 Created'
|
|
1545
|
-
when 204 then '204 No Content'
|
|
1546
|
-
when 301 then '301 Moved Permanently'
|
|
1547
|
-
when 302 then '302 Found'
|
|
1548
|
-
when 303 then '303 See Other'
|
|
1549
|
-
when 304 then '304 Not Modified'
|
|
1550
|
-
when 307 then '307 Temporary Redirect'
|
|
1551
|
-
when 308 then '308 Permanent Redirect'
|
|
1552
|
-
when 400 then '400 Bad Request'
|
|
1553
|
-
when 401 then '401 Unauthorized'
|
|
1554
|
-
when 403 then '403 Forbidden'
|
|
1555
|
-
when 404 then '404 Not Found'
|
|
1556
|
-
when 500 then '500 Internal Server Error'
|
|
1557
|
-
when 502 then '502 Bad Gateway'
|
|
1558
|
-
when 503 then '503 Service Unavailable'
|
|
1559
|
-
when 504 then '504 Gateway Timeout'
|
|
1560
|
-
else "#{fallback_response_code} OK"
|
|
1561
|
-
end
|
|
1562
|
-
|
|
1563
|
-
# Serialize response_body based on content_type
|
|
1564
|
-
if content_type =~ /json/i && (response_body.is_a?(Hash) || response_body.is_a?(Array))
|
|
1565
|
-
response_body = JSON.generate(response_body)
|
|
1566
|
-
else
|
|
1567
|
-
response_body = response_body.to_s
|
|
1568
|
-
end
|
|
1569
|
-
|
|
1570
|
-
response_lines = [
|
|
1571
|
-
"HTTP/1.1 #{response_status}",
|
|
1572
|
-
"Content-Type: #{content_type}",
|
|
1573
|
-
"Content-Length: #{response_body.length}",
|
|
1574
|
-
'',
|
|
1575
|
-
response_body
|
|
1576
|
-
]
|
|
1577
|
-
response = response_lines.join("\r\n")
|
|
1578
|
-
encoded_response = Base64.strict_encode64(response)
|
|
1579
|
-
|
|
1580
|
-
# Build the hash for this endpoint
|
|
1581
|
-
sitemap_hash = {
|
|
1582
|
-
request: encoded_request,
|
|
1583
|
-
response: encoded_response,
|
|
1584
|
-
highlight: highlight.to_s.upcase,
|
|
1585
|
-
comment: comment,
|
|
1586
|
-
http_service: {
|
|
1587
|
-
host: host,
|
|
1588
|
-
port: port,
|
|
1589
|
-
protocol: protocol
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
# Add to the results array
|
|
1594
|
-
sitemap_arr.push(sitemap_hash)
|
|
1595
|
-
warn("[DEBUG] Added sitemap entry for #{method_str.upcase} #{request_path} on #{server_url} with headers #{request_headers.inspect}") if debug
|
|
1596
|
-
rescue StandardError => e
|
|
1597
|
-
warn("[ERROR] Failed to process #{method_str.upcase} #{full_path} on #{server_url}: #{e.message}")
|
|
1598
|
-
warn("[DEBUG] Operation: #{operation.inspect}, Parameters: #{all_parameters.inspect}, Headers: #{request_headers.inspect}") if debug
|
|
1599
|
-
end
|
|
1600
|
-
end
|
|
1601
|
-
end
|
|
1602
|
-
rescue URI::InvalidURIError => e
|
|
1603
|
-
warn("[ERROR] Invalid server URL '#{server_url}' in #{openapi_spec}: #{e.message}")
|
|
1604
|
-
end
|
|
1605
|
-
end
|
|
1606
|
-
|
|
1607
|
-
sitemap_arr.each do |sitemap|
|
|
1608
|
-
add_to_sitemap(burp_obj: burp_obj, sitemap: sitemap)
|
|
1609
|
-
rescue RestClient::ExceptionWithResponse => e
|
|
1610
|
-
puts e.message
|
|
1611
|
-
next
|
|
1612
|
-
end
|
|
1613
|
-
|
|
1614
|
-
sitemap_arr
|
|
1615
|
-
rescue StandardError => e
|
|
1616
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
1617
|
-
raise e
|
|
1618
|
-
end
|
|
1619
|
-
|
|
1620
|
-
# Supported Method Parameters::
|
|
1621
|
-
# active_scan_url_arr = PWN::Plugins::BurpSuite.active_scan(
|
|
1622
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1623
|
-
# target_url: 'required - target url to scan in sitemap (should be loaded & authenticated w/ burp_obj[:mitm_browser])',
|
|
1624
|
-
# exclude_paths: 'optional - array of paths to exclude from active scan (default: [])'
|
|
1625
|
-
# )
|
|
1626
|
-
|
|
1627
|
-
public_class_method def self.active_scan(opts = {})
|
|
1628
|
-
burp_obj = opts[:burp_obj]
|
|
1629
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1630
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1631
|
-
target_url = opts[:target_url].to_s.scrub.strip.chomp
|
|
1632
|
-
raise 'ERROR: target_url parameter is required' if target_url.empty?
|
|
1633
|
-
|
|
1634
|
-
exclude_paths = opts[:exclude_paths] ||= []
|
|
1635
|
-
|
|
1636
|
-
target_scheme = URI.parse(target_url).scheme
|
|
1637
|
-
target_host = URI.parse(target_url).host
|
|
1638
|
-
target_path = URI.parse(target_url).path
|
|
1639
|
-
target_port = URI.parse(target_url).port.to_i
|
|
1640
|
-
active_scan_url_arr = []
|
|
1641
|
-
|
|
1642
|
-
json_sitemap = get_sitemap(burp_obj: burp_obj, target_url: target_url)
|
|
1643
|
-
json_sitemap.uniq.each do |site|
|
|
1644
|
-
# Skip if the site does not have a request or http_service
|
|
1645
|
-
next if site[:request].empty?
|
|
1646
|
-
|
|
1647
|
-
json_req = site[:request]
|
|
1648
|
-
b64_decoded_req = Base64.strict_decode64(json_req)
|
|
1649
|
-
json_path = b64_decoded_req.split[1].to_s.scrub.strip.chomp
|
|
1650
|
-
next if exclude_paths.include?(json_path)
|
|
1651
|
-
|
|
1652
|
-
json_query = json_path.split('?')[1].to_s.scrub.strip.chomp
|
|
1653
|
-
|
|
1654
|
-
json_http_svc = site[:http_service]
|
|
1655
|
-
json_protocol = json_http_svc[:protocol]
|
|
1656
|
-
json_host = json_http_svc[:host].to_s.scrub.strip.chomp
|
|
1657
|
-
json_port = json_http_svc[:port].to_i
|
|
1658
|
-
|
|
1659
|
-
json_uri = format_uri_from_sitemap_resp(
|
|
1660
|
-
scheme: json_protocol,
|
|
1661
|
-
host: json_host,
|
|
1662
|
-
port: json_port,
|
|
1663
|
-
path: json_path,
|
|
1664
|
-
query: json_query
|
|
1665
|
-
)
|
|
1666
|
-
|
|
1667
|
-
uri_in_scope = in_scope(
|
|
1668
|
-
burp_obj: burp_obj,
|
|
1669
|
-
uri: json_uri
|
|
1670
|
-
)
|
|
1671
|
-
|
|
1672
|
-
puts "Skipping #{json_uri} - not in scope. Check out #{self}.help >> #add_to_scope method" unless uri_in_scope
|
|
1673
|
-
next unless uri_in_scope
|
|
1674
|
-
|
|
1675
|
-
# If the protocol is HTTPS, set use_https to true
|
|
1676
|
-
use_https = false
|
|
1677
|
-
use_https = true if json_protocol == 'https'
|
|
1678
|
-
|
|
1679
|
-
print "Adding #{json_uri} to Active Scan"
|
|
1680
|
-
active_scan_url_arr.push(json_uri)
|
|
1681
|
-
post_body = {
|
|
1682
|
-
host: json_host,
|
|
1683
|
-
port: json_port,
|
|
1684
|
-
use_https: use_https,
|
|
1685
|
-
request: json_req
|
|
1686
|
-
}.to_json
|
|
1687
|
-
# Kick off an active scan for each given page in the json_sitemap results
|
|
1688
|
-
resp = rest_browser.post(
|
|
1689
|
-
"http://#{mitm_rest_api}/scan/active",
|
|
1690
|
-
post_body,
|
|
1691
|
-
content_type: 'application/json'
|
|
1692
|
-
)
|
|
1693
|
-
puts " => #{resp.code}"
|
|
1694
|
-
rescue RestClient::ExceptionWithResponse => e
|
|
1695
|
-
puts " => #{e.response.code}" if e.respond_to?(:response) && e.response
|
|
1696
|
-
next
|
|
1697
|
-
end
|
|
1698
|
-
|
|
1699
|
-
# Wait for scan completion
|
|
1700
|
-
loop do
|
|
1701
|
-
scan_queue = rest_browser.get("http://#{mitm_rest_api}/scan/active")
|
|
1702
|
-
json_scan_queue = JSON.parse(scan_queue, symbolize_names: true)
|
|
1703
|
-
break if json_scan_queue.all? { |scan| scan[:status] == 'finished' }
|
|
1704
|
-
|
|
1705
|
-
puts "\n\n\n"
|
|
1706
|
-
puts '-' * 90
|
|
1707
|
-
json_scan_queue.each do |scan|
|
|
1708
|
-
puts "Target ID: #{scan[:id]}, Request Count: #{scan[:request_count]}, Progress: #{scan[:percent_complete]}%, Status: #{scan[:status]}"
|
|
1709
|
-
end
|
|
1710
|
-
|
|
1711
|
-
sleep 30
|
|
1712
|
-
end
|
|
1713
|
-
# scan_queue_total = json_scan_queue.count
|
|
1714
|
-
# json_scan_queue.each do |scan_item|
|
|
1715
|
-
# this_scan_item_id = scan_item[:id]
|
|
1716
|
-
# until scan_item[:status] == 'finished'
|
|
1717
|
-
# scan_item_resp = rest_browser.get("http://#{mitm_rest_api}/scan/active/#{this_scan_item_id}")
|
|
1718
|
-
# scan_item = JSON.parse(scan_item_resp, symbolize_names: true)
|
|
1719
|
-
# scan_status = scan_item[:status]
|
|
1720
|
-
# puts "Target ID ##{this_scan_item_id} of ##{scan_queue_total}| #{scan_status}"
|
|
1721
|
-
# sleep 3
|
|
1722
|
-
# end
|
|
1723
|
-
# puts "Target ID ##{this_scan_item_id} of ##{scan_queue_total}| 100% complete\n"
|
|
1724
|
-
# end
|
|
1725
|
-
|
|
1726
|
-
active_scan_url_arr # Return array of targeted URIs to pass to #generate_scan_report method
|
|
1727
|
-
rescue StandardError => e
|
|
1728
|
-
# stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
1729
|
-
puts e.backtrace
|
|
1730
|
-
raise e
|
|
1731
|
-
end
|
|
1732
|
-
|
|
1733
|
-
# Supported Method Parameters::
|
|
1734
|
-
# json_scan_issues = PWN::Plugins::BurpSuite.get_scan_issues(
|
|
1735
|
-
# burp_obj: 'required - burp_obj returned by #start method'
|
|
1736
|
-
# )
|
|
1737
|
-
|
|
1738
|
-
public_class_method def self.get_scan_issues(opts = {})
|
|
1739
|
-
burp_obj = opts[:burp_obj]
|
|
1740
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1741
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1742
|
-
|
|
1743
|
-
rest_client = rest_browser::Request
|
|
1744
|
-
scan_issues = rest_client.execute(
|
|
1745
|
-
method: :get,
|
|
1746
|
-
url: "http://#{mitm_rest_api}/scanissues",
|
|
1747
|
-
timeout: 540
|
|
1748
|
-
)
|
|
1749
|
-
JSON.parse(scan_issues, symbolize_names: true)
|
|
1750
|
-
rescue StandardError => e
|
|
1751
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
1752
|
-
raise e
|
|
1753
|
-
end
|
|
1754
|
-
|
|
1755
|
-
# Supported Method Parameters::
|
|
1756
|
-
# repeater_id = PWN::Plugins::BurpSuite.add_repeater_tab(
|
|
1757
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1758
|
-
# name: 'required - name of the repeater tab (max 30 characters)',
|
|
1759
|
-
# request: 'optional - base64 encoded HTTP request string'
|
|
1760
|
-
# )
|
|
1761
|
-
|
|
1762
|
-
public_class_method def self.add_repeater_tab(opts = {})
|
|
1763
|
-
burp_obj = opts[:burp_obj]
|
|
1764
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1765
|
-
|
|
1766
|
-
name = opts[:name]
|
|
1767
|
-
raise 'ERROR: name parameter is required' if name.nil?
|
|
1768
|
-
|
|
1769
|
-
request = opts[:request]
|
|
1770
|
-
raise 'ERROR: request parameter is required' if request.nil?
|
|
1771
|
-
|
|
1772
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1773
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1774
|
-
|
|
1775
|
-
post_body = {
|
|
1776
|
-
name: name[0..29],
|
|
1777
|
-
request: request
|
|
1778
|
-
}.to_json
|
|
1779
|
-
|
|
1780
|
-
repeater_resp = rest_browser.post(
|
|
1781
|
-
"http://#{mitm_rest_api}/repeater",
|
|
1782
|
-
post_body,
|
|
1783
|
-
content_type: 'application/json; charset=UTF8'
|
|
1784
|
-
)
|
|
1785
|
-
|
|
1786
|
-
repeater_resp = JSON.parse(repeater_resp, symbolize_names: true)
|
|
1787
|
-
{ id: repeater_resp[:value] }
|
|
1788
|
-
rescue StandardError => e
|
|
1789
|
-
raise e
|
|
1790
|
-
end
|
|
1791
|
-
|
|
1792
|
-
# Supported Method Parameters::
|
|
1793
|
-
# repeater_tabs = PWN::Plugins::BurpSuite.get_all_repeater_tabs(
|
|
1794
|
-
# burp_obj: 'required - burp_obj returned by #start method'
|
|
1795
|
-
# )
|
|
1796
|
-
|
|
1797
|
-
public_class_method def self.get_all_repeater_tabs(opts = {})
|
|
1798
|
-
burp_obj = opts[:burp_obj]
|
|
1799
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1800
|
-
|
|
1801
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1802
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1803
|
-
|
|
1804
|
-
repeater_resp = rest_browser.get(
|
|
1805
|
-
"http://#{mitm_rest_api}/repeater",
|
|
1806
|
-
content_type: 'application/json; charset=UTF8'
|
|
1807
|
-
)
|
|
1808
|
-
|
|
1809
|
-
JSON.parse(repeater_resp, symbolize_names: true)
|
|
1810
|
-
rescue StandardError => e
|
|
1811
|
-
raise e
|
|
1812
|
-
end
|
|
1813
|
-
|
|
1814
|
-
# Supported Method Parameters::
|
|
1815
|
-
# repeater_tab = PWN::Plugins::BurpSuite.get_repeater_tab(
|
|
1816
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1817
|
-
# id: 'required - id of the repeater tab to get'
|
|
1818
|
-
# )
|
|
1819
|
-
|
|
1820
|
-
public_class_method def self.get_repeater_tab(opts = {})
|
|
1821
|
-
burp_obj = opts[:burp_obj]
|
|
1822
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1823
|
-
|
|
1824
|
-
id = opts[:id]
|
|
1825
|
-
raise 'ERROR: id parameter is required' if id.nil?
|
|
1826
|
-
|
|
1827
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1828
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1829
|
-
|
|
1830
|
-
repeater_resp = rest_browser.get(
|
|
1831
|
-
"http://#{mitm_rest_api}/repeater/#{id}",
|
|
1832
|
-
content_type: 'application/json; charset=UTF8'
|
|
1833
|
-
)
|
|
1834
|
-
|
|
1835
|
-
JSON.parse(repeater_resp, symbolize_names: true)
|
|
1836
|
-
rescue StandardError => e
|
|
1837
|
-
raise e
|
|
1838
|
-
end
|
|
1839
|
-
|
|
1840
|
-
# Supported Method Parameters::
|
|
1841
|
-
# repeater_resp = PWN::Plugins::BurpSuite.send_repeater_request(
|
|
1842
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1843
|
-
# id: 'required - id of the repeater tab to send'
|
|
1844
|
-
# )
|
|
1845
|
-
|
|
1846
|
-
public_class_method def self.send_repeater_request(opts = {})
|
|
1847
|
-
burp_obj = opts[:burp_obj]
|
|
1848
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1849
|
-
|
|
1850
|
-
id = opts[:id]
|
|
1851
|
-
raise 'ERROR: id parameter is required' if id.nil?
|
|
1852
|
-
|
|
1853
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1854
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1855
|
-
|
|
1856
|
-
repeater_resp = rest_browser.post(
|
|
1857
|
-
"http://#{mitm_rest_api}/repeater/#{id}/send",
|
|
1858
|
-
content_type: 'application/json; charset=UTF8'
|
|
1859
|
-
)
|
|
1860
|
-
|
|
1861
|
-
JSON.parse(repeater_resp, symbolize_names: true)
|
|
1862
|
-
rescue StandardError => e
|
|
1863
|
-
raise e
|
|
1864
|
-
end
|
|
1865
|
-
|
|
1866
|
-
# Supported Method Parameters::
|
|
1867
|
-
# repeater_obj = PWN::Plugins::BurpSuite.update_repeater_tab(
|
|
1868
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1869
|
-
# id: 'required - id of the repeater tab to update',
|
|
1870
|
-
# name: 'required - name of the repeater tab (max 30 characters)',
|
|
1871
|
-
# request: 'required - base64 encoded HTTP request string'
|
|
1872
|
-
# )
|
|
1873
|
-
|
|
1874
|
-
public_class_method def self.update_repeater_tab(opts = {})
|
|
1875
|
-
burp_obj = opts[:burp_obj]
|
|
1876
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1877
|
-
|
|
1878
|
-
id = opts[:id]
|
|
1879
|
-
raise 'ERROR: id parameter is required' if id.nil?
|
|
1880
|
-
|
|
1881
|
-
name = opts[:name]
|
|
1882
|
-
raise 'ERROR: name parameter is required' if name.nil?
|
|
1883
|
-
|
|
1884
|
-
request = opts[:request]
|
|
1885
|
-
raise 'ERROR: request parameter is required' if request.nil?
|
|
1886
|
-
|
|
1887
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1888
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1889
|
-
|
|
1890
|
-
put_body = {
|
|
1891
|
-
name: name[0..29],
|
|
1892
|
-
request: request
|
|
1893
|
-
}.to_json
|
|
1894
|
-
|
|
1895
|
-
repeater_resp = rest_browser.put(
|
|
1896
|
-
"http://#{mitm_rest_api}/repeater/#{id}",
|
|
1897
|
-
put_body,
|
|
1898
|
-
content_type: 'application/json; charset=UTF8'
|
|
1899
|
-
)
|
|
1900
|
-
|
|
1901
|
-
JSON.parse(repeater_resp, symbolize_names: true)
|
|
1902
|
-
rescue StandardError => e
|
|
1903
|
-
raise e
|
|
1904
|
-
end
|
|
1905
|
-
|
|
1906
|
-
# Supported Method Parameters::
|
|
1907
|
-
# uri_in_scope = PWN::Plugins::BurpSuite.delete_repeater_tab(
|
|
1908
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1909
|
-
# id: 'required - id of the repeater tab to delete'
|
|
1910
|
-
# )
|
|
1911
|
-
|
|
1912
|
-
public_class_method def self.delete_repeater_tab(opts = {})
|
|
1913
|
-
burp_obj = opts[:burp_obj]
|
|
1914
|
-
raise 'ERROR: burp_obj parameter is required' unless burp_obj.is_a?(Hash)
|
|
1915
|
-
|
|
1916
|
-
id = opts[:id]
|
|
1917
|
-
raise 'ERROR: id parameter is required' if id.nil?
|
|
1918
|
-
|
|
1919
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1920
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1921
|
-
|
|
1922
|
-
rest_browser.delete(
|
|
1923
|
-
"http://#{mitm_rest_api}/repeater/#{id}",
|
|
1924
|
-
content_type: 'application/json; charset=UTF8'
|
|
1925
|
-
)
|
|
1926
|
-
|
|
1927
|
-
{ id: id }
|
|
1928
|
-
rescue StandardError => e
|
|
1929
|
-
raise e
|
|
1930
|
-
end
|
|
1931
|
-
|
|
1932
|
-
# Supported Method Parameters::
|
|
1933
|
-
# PWN::Plugins::BurpSuite.generate_scan_report(
|
|
1934
|
-
# burp_obj: 'required - burp_obj returned by #start method',
|
|
1935
|
-
# target_url: 'required - target_url passed to #active_scan method',
|
|
1936
|
-
# output_dir: 'required - directory to save the report',
|
|
1937
|
-
# report_type: required - <:html|:xml>'
|
|
1938
|
-
# )
|
|
1939
|
-
|
|
1940
|
-
public_class_method def self.generate_scan_report(opts = {})
|
|
1941
|
-
burp_obj = opts[:burp_obj]
|
|
1942
|
-
target_url = opts[:target_url]
|
|
1943
|
-
rest_browser = burp_obj[:rest_browser]
|
|
1944
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
1945
|
-
output_dir = opts[:output_dir]
|
|
1946
|
-
raise "ERROR: #{output_dir} does not exist." unless Dir.exist?(output_dir)
|
|
1947
|
-
|
|
1948
|
-
report_type = opts[:report_type]
|
|
1949
|
-
|
|
1950
|
-
valid_report_types_arr = %i[html xml]
|
|
1951
|
-
raise "ERROR: INVALID Report Type => #{report_type}" unless valid_report_types_arr.include?(report_type)
|
|
1952
|
-
|
|
1953
|
-
case report_type
|
|
1954
|
-
when :html
|
|
1955
|
-
report_path = "#{output_dir}/burp_active_scan_results.html"
|
|
1956
|
-
when :xml
|
|
1957
|
-
report_path = "#{output_dir}/burp_active_scan_results.xml"
|
|
1958
|
-
end
|
|
1959
|
-
|
|
1960
|
-
scheme = URI.parse(target_url).scheme
|
|
1961
|
-
host = URI.parse(target_url).host
|
|
1962
|
-
port = URI.parse(target_url).port
|
|
1963
|
-
path = URI.parse(target_url).path
|
|
1964
|
-
query = URI.parse(target_url).query
|
|
1965
|
-
|
|
1966
|
-
target_domain = format_uri_from_sitemap_resp(
|
|
1967
|
-
scheme: scheme,
|
|
1968
|
-
host: host,
|
|
1969
|
-
port: port,
|
|
1970
|
-
path: path,
|
|
1971
|
-
query: query
|
|
1972
|
-
)
|
|
1973
|
-
|
|
1974
|
-
puts "Generating #{report_type} report for #{target_domain}..."
|
|
1975
|
-
report_url = Base64.strict_encode64(target_domain)
|
|
1976
|
-
# Ready scanreport API call in pwn_burp to support HTML & XML report generation
|
|
1977
|
-
report_resp = rest_browser.get(
|
|
1978
|
-
"http://#{mitm_rest_api}/scanreport/#{report_type.to_s.upcase}/#{report_url}"
|
|
1979
|
-
)
|
|
1980
|
-
|
|
1981
|
-
File.open(report_path, 'w') do |f|
|
|
1982
|
-
f.puts(report_resp.body.gsub("\r\n", "\n"))
|
|
1983
|
-
end
|
|
1984
|
-
rescue RestClient::BadRequest => e
|
|
1985
|
-
puts e.response
|
|
1986
|
-
rescue StandardError => e
|
|
1987
|
-
stop(burp_obj: burp_obj) unless burp_obj.nil?
|
|
1988
|
-
raise e
|
|
1989
|
-
end
|
|
1990
|
-
|
|
1991
|
-
# Supported Method Parameters::
|
|
1992
|
-
# PWN::Plugins::BurpSuite.update_burp_jar(
|
|
1993
|
-
# )
|
|
1994
|
-
|
|
1995
|
-
public_class_method def self.update_burp_jar
|
|
1996
|
-
# TODO: Do this if PortSwigger ever decides to includes this functionality as a CLI argument.
|
|
1997
|
-
end
|
|
1998
|
-
|
|
1999
|
-
# Supported Method Parameters::
|
|
2000
|
-
# PWN::Plugins::BurpSuite.stop(
|
|
2001
|
-
# burp_obj: 'required - burp_obj returned by #start method'
|
|
2002
|
-
# )
|
|
2003
|
-
|
|
2004
|
-
public_class_method def self.stop(opts = {})
|
|
2005
|
-
burp_obj = opts[:burp_obj]
|
|
2006
|
-
|
|
2007
|
-
browser_obj = burp_obj[:mitm_browser]
|
|
2008
|
-
rest_browser = burp_obj[:rest_browser]
|
|
2009
|
-
mitm_rest_api = burp_obj[:mitm_rest_api]
|
|
2010
|
-
introspection_thread_arr = burp_obj[:introspection_threads]
|
|
2011
|
-
introspection_thread_arr.each(&:kill) if introspection_thread_arr.is_a?(Array) && introspection_thread_arr.any?
|
|
2012
|
-
# introspection_thread.kill unless introspection_thread.nil?
|
|
2013
|
-
|
|
2014
|
-
PWN::Plugins::TransparentBrowser.close(browser_obj: browser_obj)
|
|
2015
|
-
rest_browser.post("http://#{mitm_rest_api}/shutdown", '')
|
|
2016
|
-
|
|
2017
|
-
burp_obj = nil
|
|
2018
|
-
rescue StandardError => e
|
|
2019
|
-
raise e
|
|
2020
|
-
end
|
|
2021
|
-
|
|
2022
|
-
# Author(s):: 0day Inc. <support@0dayinc.com>
|
|
2023
|
-
|
|
2024
|
-
public_class_method def self.authors
|
|
2025
|
-
"AUTHOR(S):
|
|
2026
|
-
0day Inc. <support@0dayinc.com>
|
|
2027
|
-
"
|
|
2028
|
-
end
|
|
2029
|
-
|
|
2030
|
-
# Display Usage for this Module
|
|
2031
|
-
|
|
2032
|
-
public_class_method def self.help
|
|
2033
|
-
puts "USAGE:
|
|
2034
|
-
burp_obj1 = #{self}.start(
|
|
2035
|
-
burp_jar_path: 'optional - path of burp suite pro jar file (defaults to /opt/burpsuite/burpsuite_pro.jar)',
|
|
2036
|
-
headless: 'optional - run headless if set to true',
|
|
2037
|
-
browser_type: 'optional - defaults to :firefox. See PWN::Plugins::TransparentBrowser.help for a list of types'
|
|
2038
|
-
)
|
|
2039
|
-
|
|
2040
|
-
uri_in_scope = #{self}.in_scope(
|
|
2041
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2042
|
-
uri: 'required - URI to determine if in scope'
|
|
2043
|
-
)
|
|
2044
|
-
|
|
2045
|
-
json_in_scope = #{self}.add_to_scope(
|
|
2046
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2047
|
-
target_url: 'required - target url to add to scope'
|
|
2048
|
-
)
|
|
2049
|
-
|
|
2050
|
-
json_spider = #{self}.spider(
|
|
2051
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2052
|
-
target_url: 'required - target url to spider in scope'
|
|
2053
|
-
)
|
|
2054
|
-
|
|
2055
|
-
#{self}.enable_proxy(
|
|
2056
|
-
burp_obj: 'required - burp_obj returned by #start method'
|
|
2057
|
-
)
|
|
2058
|
-
|
|
2059
|
-
#{self}.disable_proxy(
|
|
2060
|
-
burp_obj: 'required - burp_obj returned by #start method'
|
|
2061
|
-
)
|
|
2062
|
-
|
|
2063
|
-
#{self}.get_proxy_listeners(
|
|
2064
|
-
burp_obj: 'required - burp_obj returned by #start method'
|
|
2065
|
-
)
|
|
2066
|
-
|
|
2067
|
-
json_proxy_listener = #{self}.add_proxy_listener(
|
|
2068
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2069
|
-
bindAddress: 'required - bind address for the proxy listener (e.g., \"127.0.0.1\")',
|
|
2070
|
-
port: 'required - port for the proxy listener (e.g., 8081)',
|
|
2071
|
-
enabled: 'optional - enable the listener (defaults to true)'
|
|
2072
|
-
)
|
|
2073
|
-
|
|
2074
|
-
json_proxy_listener = #{self}.update_proxy_listener(
|
|
2075
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2076
|
-
id: 'optional - ID of the proxy listener (defaults to 0)',
|
|
2077
|
-
bindAddress: 'optional - bind address for the proxy listener (defaults to value of existing listener)',
|
|
2078
|
-
port: 'optional - port for the proxy listener (defaults to value of existing listener)',
|
|
2079
|
-
enabled: 'optional - enable the listener (defaults to value of existing listener)'
|
|
2080
|
-
)
|
|
2081
|
-
|
|
2082
|
-
#{self}.delete_proxy_listener(
|
|
2083
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2084
|
-
id: 'optional - ID of the proxy listener (defaults to 0)'
|
|
2085
|
-
)
|
|
2086
|
-
|
|
2087
|
-
json_proxy_history = #{self}.get_proxy_history(
|
|
2088
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2089
|
-
keyword: 'optional - keyword to filter proxy history results (default: nil)',
|
|
2090
|
-
return_as: 'optional - :base64 or :har (defaults to :base64)'
|
|
2091
|
-
)
|
|
2092
|
-
|
|
2093
|
-
json_proxy_history = #{self}.update_proxy_history(
|
|
2094
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2095
|
-
entry: 'required - proxy history entry hash to update'
|
|
2096
|
-
)
|
|
2097
|
-
|
|
2098
|
-
json_proxy_history = #{self}.get_websocket_history(
|
|
2099
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2100
|
-
keyword: 'optional - keyword to filter websocket history results (default: nil)'
|
|
2101
|
-
)
|
|
2102
|
-
|
|
2103
|
-
json_proxy_history = #{self}.update_websocket_history(
|
|
2104
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2105
|
-
entry: 'required - websocket history entry hash to update'
|
|
2106
|
-
)
|
|
2107
|
-
|
|
2108
|
-
json_sitemap = #{self}.get_sitemap(
|
|
2109
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2110
|
-
keyword: 'optional - keyword to filter sitemap results (default: nil)',
|
|
2111
|
-
return_as: 'optional - :base64 or :har (defaults to :base64)'
|
|
2112
|
-
)
|
|
2113
|
-
|
|
2114
|
-
json_sitemap = #{self}.add_to_sitemap(
|
|
2115
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2116
|
-
sitemap: 'required - sitemap hash to add',
|
|
2117
|
-
debug: 'optional - boolean to enable sitemap debugging (default: false)'
|
|
2118
|
-
)
|
|
2119
|
-
|
|
2120
|
-
Example:
|
|
2121
|
-
json_sitemap = #{self}.add_to_sitemap(
|
|
2122
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2123
|
-
sitemap: {
|
|
2124
|
-
request: 'base64_encoded_request_string',
|
|
2125
|
-
response: 'base64_encoded_response_string',
|
|
2126
|
-
highlight: 'NONE'||'RED'||'ORANGE'||'YELLOW'||'GREEN'||'CYAN'||'BLUE'||'PINK'||'MAGENTA'||'GRAY',
|
|
2127
|
-
comment: 'optional comment for the sitemap entry',
|
|
2128
|
-
http_service: {
|
|
2129
|
-
host: 'example.com',
|
|
2130
|
-
port: 80,
|
|
2131
|
-
protocol: 'http'
|
|
2132
|
-
}
|
|
2133
|
-
}
|
|
2134
|
-
)
|
|
2135
|
-
|
|
2136
|
-
json_sitemap = #{self}.update_sitemap(
|
|
2137
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2138
|
-
entry: 'required - sitemap entry hash to update'
|
|
2139
|
-
)
|
|
2140
|
-
|
|
2141
|
-
json_sitemap = #{self}.import_openapi_to_sitemap(
|
|
2142
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2143
|
-
openapi_spec: 'required - path to OpenAPI JSON or YAML specification file',
|
|
2144
|
-
additional_http_headers: 'optional - hash of additional HTTP headers to include in requests (default: {})',
|
|
2145
|
-
debug: 'optional - boolean to enable debug logging (default: false)',
|
|
2146
|
-
highlight: 'optional - highlight color for the sitemap entry (default: \"NONE\")',
|
|
2147
|
-
comment: 'optional - comment for the sitemap entry (default: \"\")',
|
|
2148
|
-
)
|
|
2149
|
-
|
|
2150
|
-
active_scan_url_arr = #{self}.active_scan(
|
|
2151
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2152
|
-
target_url: 'required - target url to scan in sitemap (should be loaded & authenticated w/ burp_obj[:mitm_browser])',
|
|
2153
|
-
exclude_paths: 'optional - array of paths to exclude from active scan (default: [])'
|
|
2154
|
-
)
|
|
2155
|
-
|
|
2156
|
-
json_scan_issues = #{self}.get_scan_issues(
|
|
2157
|
-
burp_obj: 'required - burp_obj returned by #start method'
|
|
2158
|
-
).to_json
|
|
2159
|
-
|
|
2160
|
-
repeater_id = #{self}.add_repeater_tab(
|
|
2161
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2162
|
-
name: 'required - name of the repeater tab (max 30 characters)',
|
|
2163
|
-
request: 'optional - base64 encoded HTTP request string'
|
|
2164
|
-
)
|
|
2165
|
-
|
|
2166
|
-
repeater_tabs = #{self}.get_all_repeater_tabs(
|
|
2167
|
-
burp_obj: 'required - burp_obj returned by #start method'
|
|
2168
|
-
)
|
|
2169
|
-
|
|
2170
|
-
repeater_tab = #{self}.get_repeater_tab(
|
|
2171
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2172
|
-
id: 'required - id of the repeater tab to get'
|
|
2173
|
-
)
|
|
2174
|
-
|
|
2175
|
-
repeater_resp = #{self}.send_repeater_request(
|
|
2176
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2177
|
-
id: 'required - id of the repeater tab to send'
|
|
2178
|
-
)
|
|
2179
|
-
|
|
2180
|
-
repeater_obj = #{self}.update_repeater_tab(
|
|
2181
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2182
|
-
id: 'required - id of the repeater tab to update',
|
|
2183
|
-
name: 'required - name of the repeater tab (max 30 characters)',
|
|
2184
|
-
request: 'required - base64 encoded HTTP request string'
|
|
2185
|
-
)
|
|
2186
|
-
|
|
2187
|
-
repeater_obj = #{self}.delete_repeater_tab(
|
|
2188
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2189
|
-
id: 'required - id of the repeater tab to delete'
|
|
2190
|
-
)
|
|
2191
|
-
|
|
2192
|
-
#{self}.generate_scan_report(
|
|
2193
|
-
burp_obj: 'required - burp_obj returned by #start method',
|
|
2194
|
-
target_url: 'required - target_url passed to #active_scan method',
|
|
2195
|
-
output_dir: 'required - directory to save the report',
|
|
2196
|
-
report_type: 'required - <:html|:xml>'
|
|
2197
|
-
)
|
|
2198
|
-
|
|
2199
|
-
#{self}.stop(
|
|
2200
|
-
burp_obj: 'required - burp_obj returned by #start method'
|
|
2201
|
-
)
|
|
2202
|
-
|
|
2203
|
-
#{self}.authors
|
|
2204
|
-
"
|
|
2205
|
-
end
|
|
2206
|
-
end
|
|
2207
|
-
end
|
|
2208
|
-
end
|