├── .github ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md ├── .gitignore ├── .gitmodules ├── .travis.yml ├── LICENSE.md ├── README.md ├── bin └── sandmap ├── data ├── modules │ ├── awesome.mod │ ├── host_discovery.mod │ ├── nse_broadcast.mod │ ├── nse_citrix.mod │ ├── nse_databases.mod │ ├── nse_dns-dhcp.mod │ ├── nse_external.mod │ ├── nse_ftp.mod │ ├── nse_hadoop.mod │ ├── nse_http-cve.mod │ ├── nse_http-protocol.mod │ ├── nse_http-services.mod │ ├── nse_mail.mod │ ├── nse_oracle.mod │ ├── nse_other-auth.mod │ ├── nse_other-discovery.mod │ ├── nse_other-network.mod │ ├── nse_other-services.mod │ ├── nse_other-version.mod │ ├── nse_remote-access.mod │ ├── nse_smb-vuln.mod │ ├── nse_smb.mod │ ├── nse_snmp.mod │ ├── nse_socks.mod │ ├── nse_ssl.mod │ ├── nse_vuln-scanners.mod │ ├── nse_whois.mod │ ├── os_detection.mod │ ├── port_scan.mod │ ├── service_detection.mod │ └── zenmap.mod └── output │ └── .gitkeep ├── etc ├── main.cfg └── sandmap-completion ├── lib ├── cli_distributor ├── cli_help ├── cli_show ├── init_cli ├── init_config ├── init_module ├── init_search ├── init_session ├── load_modules ├── module_help ├── module_info ├── module_show ├── set_config └── show_config ├── log └── .gitkeep ├── setup.sh ├── src ├── __init__ ├── helpers ├── import └── settings ├── static ├── img │ └── sandmap_blackarch.png └── man8 │ └── sandmap.8 ├── templates ├── sample.cfg └── sample.mod └── tmp └── .gitkeep /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at trimstray@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | > _A real community, however, exists only when its members interact in a meaningful way that deepens their understanding of each other and leads to learning._ 4 | 5 | If you would like to support this project, have an interesting idea how to improve the operation of this tool, or if you found some errors - fork this, add your fixes, and add a pull request of your branch to the **master branch**. 6 | 7 | ## Using the issue tracker 8 | 9 | The [issue tracker](https://github.com/trimstray/sandmap/issues) is 10 | the preferred channel for bug reports, features requests and submitting pull requests, but please respect the following restrictions: 11 | 12 | * Please **do not** use the issue tracker for personal support requests (use 13 | [Stack Overflow](https://stackoverflow.com) or IRC) 14 | 15 | * Please **do not** derail or troll issues. Keep the discussion on topic and 16 | respect the opinions of others 17 | 18 | ## Bash style 19 | 20 | I would like you to stick to certain standards of writing in bash. I realize that it is not easy and time-consuming if you have certain habits. I do not expect 100% compliance and adherence to good practices, however, I would like you to try to use certain principles. 21 | 22 | The following should help: 23 | 24 | - [http://wiki.bash-hackers.org/](http://wiki.bash-hackers.org/) 25 | - [https://google.github.io/styleguide/shell.xml](https://google.github.io/styleguide/shell.xml) 26 | - [https://github.com/progrium/bashstyle](https://github.com/progrium/bashstyl) 27 | - [http://kvz.io/blog/2013/11/21/bash-best-practices/](http://kvz.io/blog/2013/11/21/bash-best-practices/) 28 | 29 | ## Shellcheck 30 | 31 | One of the requirements before approving your changes is to check them with the **shellcheck** utility. If the returned errors are not critical (eg. [SC2154](https://github.com/koalaman/shellcheck/wiki/SC2154)) you can use the `shellcheck disable=SC2154` design. 32 | 33 | ## Signature of commit 34 | 35 | Moving forward all commits to this project must include a "signed-off-by" line indicating the name and email address of the contributor signing off on the change. To enable signatures add the following lines to `.git/hooks/prepare-commit-msg` : 36 | 37 | ``` 38 | SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/- signed-off-by: \1/p') 39 | grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 40 | ``` 41 | 42 | ## Pull requests 43 | 44 | When creating a pull request, please heed the following: 45 | 46 | - Base your code on the latest master branch to avoid manual merges 47 | - Code review may ensue in order to help shape your proposal 48 | - Explain the problem and your proposed solution 49 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # This is where the result of the script output. 2 | log/* 3 | !/log/.gitkeep 4 | 5 | # Temporary files. 6 | tmp/* 7 | !/tmp/.gitkeep 8 | 9 | # Not tracking module config files. 10 | data/modules/*.cfg 11 | 12 | # Nmap output scans. 13 | data/output/* 14 | !/data/output/.gitkeep 15 | 16 | # Temporary files. 17 | tmp/.static* 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "data/nse_external/vulscan"] 2 | path = data/nse_external/vulscan 3 | url = https://github.com/scipag/vulscan.git 4 | [submodule "data/nse_external/vulners"] 5 | path = data/nse_external/vulners 6 | url = https://github.com/vulnersCom/nmap-vulners.git 7 | [submodule "data/nse_external/s4n7h0"] 8 | path = data/nse_external/s4n7h0 9 | url = https://github.com/s4n7h0/NSE 10 | [submodule "data/nse_external/michenriksen"] 11 | path = data/nse_external/michenriksen 12 | url = https://github.com/michenriksen/nmap-scripts.git 13 | [submodule "data/nse_external/httprecon-nse"] 14 | path = data/nse_external/httprecon-nse 15 | url = https://github.com/scipag/httprecon-nse.git 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | branches: 2 | only: 3 | - master 4 | - testing 5 | 6 | language: bash 7 | 8 | sudo: required 9 | dist: trusty 10 | 11 | before_install: 12 | - sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse" 13 | - sudo apt-get -qq update 14 | - sudo apt-get -t trusty-backports install shellcheck 15 | 16 | ### --> https://github.com/travis-ci/travis-ci/issues/9484 17 | # - curl -sSL "https://ftp-master.debian.org/keys/archive-key-7.0.asc" | sudo -E apt-key add - 18 | # - echo "deb http://ftp.us.debian.org/debian unstable main contrib non-free" | sudo tee -a /etc/apt/sources.list > /dev/null 19 | # - sudo apt-get update 20 | # - sudo apt-get install shellcheck 21 | ### --> 22 | 23 | # after_success: 24 | # - test $TRAVIS_PULL_REQUEST = false && git push 25 | 26 | script: 27 | - shellcheck --version 28 | - shellcheck -s bash -e 1072,1094 -x src/* -x lib/* bin/sandmap 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

sandmap

2 | 3 |

4 | 5 | Travis-CI 6 | 7 | 8 | Version 9 | 10 | 11 | Rawsec's CyberSecurity Inventory 12 | 13 | 14 | BlackArch Repository 15 | 16 | 17 | License 18 | 19 |

20 | 21 |
22 | Description 23 | • How To Use 24 | • Command Line 25 | • Configuration 26 | • Requirements 27 | • Other 28 | • Contributing 29 | • License 30 | • Wiki 31 |
32 | 33 |
34 | 35 |

36 | Master 37 |

38 | 39 |
40 | 41 | ## Description 42 | 43 | `sandmap` is a tool supporting network and system reconnaissance using the massive **Nmap engine**. It provides a user-friendly interface, automates and speeds up scanning and allows you to easily use many advanced scanning techniques. 44 | 45 | ### Key Features 46 | 47 | - simple **CLI** with the ability to run pure **Nmap engine** 48 | - predefined scans included in the **modules** 49 | - support **Nmap Scripting Engine** (NSE) with scripts arguments 50 | - **TOR** support (with proxychains) 51 | - multiple scans at one time 52 | - at this point: **31** modules with **459** scan profiles 53 | 54 | ## How To Use 55 | 56 | It's simple: 57 | 58 | ```bash 59 | # Clone this repository 60 | git clone --recursive https://github.com/trimstray/sandmap 61 | 62 | # Go into the repository 63 | cd sandmap 64 | 65 | # Install 66 | ./setup.sh install 67 | 68 | # Run the app 69 | sandmap 70 | ``` 71 | 72 | > * symlink to `bin/sandmap` is placed in `/usr/local/bin` 73 | > * man page is placed in `/usr/local/man/man8` 74 | 75 | ## Command Line 76 | 77 | Before using the `sandmap` read the **Command Line** introduction. 78 | 79 | ## Configuration 80 | 81 | The `etc/main.cfg` configuration file has the following structure: 82 | 83 | ```bash 84 | # shellcheck shell=bash 85 | 86 | # Specifies the default destination. 87 | # Examples: 88 | # - dest="127.0.0.1,8.8.8.8" 89 | dest="127.0.0.1" 90 | 91 | # Specifies the extended Nmap parameters. 92 | # Examples: 93 | # - params="--script ssl-ccs-injection -p 443" 94 | params="" 95 | 96 | # Specifies the default output type and path. 97 | # Examples: 98 | # - report="xml" 99 | report="" 100 | 101 | # Specifies the TOR connection. 102 | # Examples: 103 | # - tor="true" 104 | tor="" 105 | 106 | # Specifies the terminal type. 107 | # Examples: 108 | # - terminal="internal" 109 | terminal="internal" 110 | ``` 111 | 112 | ## Requirements 113 | 114 | `sandmap` uses external utilities to be installed before running: 115 | 116 | - [nmap](https://nmap.org/) 117 | - [xterm](https://invisible-island.net/xterm/) 118 | - [proxychains](http://proxychains.sourceforge.net/) 119 | 120 | This tool working with: 121 | 122 | - **GNU/Linux** (testing on Debian and CentOS) 123 | - **Bash** (testing on 4.4.19) 124 | - **Nmap** (testing on 7.70) 125 | 126 | Also you will need **root access**. 127 | 128 | ## Other 129 | 130 | ### Modules 131 | 132 | Available modules: **31** 133 | Available scan profiles: **459** 134 | 135 | > If you want to create your own modules, take a look **[this](https://github.com/trimstray/sandmap/wiki/Modules)**. 136 | 137 | ### Project architecture 138 | 139 | See **[this](https://github.com/trimstray/sandmap/wiki/Project-architecture)**. 140 | 141 | ## Contributing 142 | 143 | See **[this](.github/CONTRIBUTING.md)**. 144 | 145 | ## License 146 | 147 | GPLv3 : 148 | 149 | **Free software, Yeah!** 150 | -------------------------------------------------------------------------------- /bin/sandmap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ### BEG SCRIPT INFO 4 | # 5 | # Header: 6 | # 7 | # fname : "sandmap" 8 | # cdate : "14.03.2018" 9 | # author : "Michał Żurawski " 10 | # tab_size : "2" 11 | # soft_tabs : "yes" 12 | # 13 | # Description: 14 | # 15 | # See README.md file for more information. 16 | # 17 | # License: 18 | # 19 | # sandmap, Copyright (C) 2018 Michał Żurawski 20 | # 21 | # This program is free software: you can redistribute it and/or modify 22 | # it under the terms of the GNU General Public License as published by 23 | # the Free Software Foundation, either version 3 of the License, or 24 | # (at your option) any later version. 25 | # 26 | # This program is distributed in the hope that it will be useful, 27 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | # GNU General Public License for more details. 30 | # 31 | # You should have received a copy of the GNU General Public License 32 | # along with this program. If not, see . 33 | # 34 | ### END SCRIPT INFO 35 | 36 | 37 | # The array that store call parameters. 38 | # shellcheck disable=SC2034 39 | __init_params=() 40 | __script_params=("$@") 41 | 42 | # Store the name of the script and directory call. 43 | readonly _init_name="$(basename "$0")" 44 | readonly _init_directory="$(dirname "$(readlink -f "$0")")" 45 | 46 | # Set root directory. 47 | readonly _rel="${_init_directory}/.." 48 | 49 | # Directory structure. 50 | # shellcheck disable=SC2154 51 | readonly _src="${_rel}/src" 52 | readonly _lib="${_rel}/lib" 53 | readonly _cfg="${_rel}/etc" 54 | readonly _tmp="${_rel}/tmp" 55 | readonly _dat="${_rel}/data" 56 | readonly _out="${_dat}/output" 57 | readonly _nse="${_dat}/nse_external" 58 | 59 | # shellcheck disable=SC1090,SC1091 60 | source "${_src}/settings" 61 | # shellcheck disable=SC1090 62 | source "${_src}/helpers" 63 | # shellcheck disable=SC1090 64 | source "${_src}/__init__" 65 | 66 | 67 | # We pass arguments to the __main__ function. 68 | # It is required if you want to run on arguments type $1, $2, ... 69 | __main__ "${__script_params[@]}" 70 | 71 | _exit_ "0" 72 | -------------------------------------------------------------------------------- /data/modules/awesome.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: awesome() 7 | # 8 | # Description: 9 | # Awesome Nmap predefined commands module. 10 | # 11 | # Usage: 12 | # awesome 13 | # 14 | # Examples: 15 | # awesome 16 | # 17 | 18 | function awesome() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="awesome" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="Awesome Nmap predefined commands module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | Awesome Nmap predefined commands module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "Show only open ports;\ 113 | ;open_ports;-F --open" \ 114 | # 115 | "Base scan;\ 116 | ;base_scan;-sU -sT -p U:53,T:22,25,80,110,443" \ 117 | # 118 | "Top 25 ports;\ 119 | ;top_25;--top-ports 20" \ 120 | ) 121 | 122 | # shellcheck disable=SC2034,SC2154 123 | _module_show=(\ 124 | "${module_name}" \ 125 | "${#_module_commands[@]}" \ 126 | "${author}" \ 127 | "${contact}" \ 128 | "${description}" \ 129 | ) 130 | 131 | # shellcheck disable=SC2034 132 | export _module_opts=(\ 133 | "$_module_help") 134 | 135 | return $_STATE 136 | 137 | } 138 | -------------------------------------------------------------------------------- /data/modules/host_discovery.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: host_discovery() 7 | # 8 | # Description: 9 | # Nmap Host Discovery module. 10 | # 11 | # Usage: 12 | # host_discovery 13 | # 14 | # Examples: 15 | # host_discovery 16 | # 17 | 18 | function host_discovery() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="host_discovery" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | version="1.0" 40 | description="Nmap Host Discovery module" 41 | 42 | # shellcheck disable=SC2034,SC2154 43 | _module_cfg="${_modules}/${module_name}.cfg" 44 | 45 | touch "$_module_cfg" 46 | 47 | # shellcheck disable=SC2034,SC2154 48 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 49 | Module" "${module_name}") 50 | 51 | _module_help+=$(printf "%s" " 52 | 53 | Description 54 | ----------- 55 | 56 | Nmap does host discovery and then performs a port 57 | scan against each host it determines is online. 58 | 59 | Commands 60 | -------- 61 | 62 | help display module or NSE help 63 | show display module or profile info 64 | config show module configuration 65 | set set module variable value 66 | use reuse module (changed env) 67 | pushd |init|show|flush command line commands stack 68 | search search key in all commands 69 | init [--args] run profile 70 | 71 | Options: 72 | 73 | key value 74 | profile alias or id 75 | 76 | ") 77 | 78 | # shellcheck disable=SC2154 79 | if [[ "$_mstate" -eq 0 ]] ; then 80 | 81 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 82 | 83 | # shellcheck disable=SC1090 84 | source "$_module_cfg" 85 | 86 | else 87 | 88 | # shellcheck disable=SC2034 89 | _module_variables=() 90 | 91 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 92 | 93 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 94 | 95 | fi 96 | 97 | _mstate=1 98 | 99 | fi 100 | 101 | else 102 | 103 | # shellcheck disable=SC1090 104 | source "$_module_cfg" 105 | 106 | fi 107 | 108 | # In the given commands you can use variables from the CLI config 109 | # command or the etc/main.cfg file. 110 | 111 | # ---------------------------------------------------------------------------------------\n 112 | 113 | # shellcheck disable=SC2034 114 | _module_commands=(\ 115 | # 116 | "https://nmap.org/book/man-host-discovery.html;\ 117 | ;list_scan;-sL" \ 118 | # 119 | "https://nmap.org/book/man-host-discovery.html;\ 120 | ;ping_scan;-sP" \ 121 | # 122 | "https://nmap.org/book/man-host-discovery.html;\ 123 | ;no_port_scan;-sn" \ 124 | # 125 | "https://nmap.org/book/man-host-discovery.html;\ 126 | ;no_ping;-Pn" \ 127 | # 128 | "https://nmap.org/book/man-host-discovery.html;\ 129 | ;tcp_syn_ping;-PS" \ 130 | # 131 | "https://nmap.org/book/man-host-discovery.html;\ 132 | ;tcp_ack_ping;-PA" \ 133 | # 134 | "https://nmap.org/book/man-host-discovery.html;\ 135 | ;udp_ping;-PU" \ 136 | # 137 | "https://nmap.org/book/man-host-discovery.html;\ 138 | ;sctp_init_ping;-PY" \ 139 | # 140 | "https://nmap.org/book/man-host-discovery.html;\ 141 | ;arp_ping;-PR" \ 142 | # 143 | "https://nmap.org/book/man-host-discovery.html;\ 144 | ;icmp_ping-1;-PE" \ 145 | # 146 | "https://nmap.org/book/man-host-discovery.html;\ 147 | ;icmp_ping-2;-PP" \ 148 | # 149 | "https://nmap.org/book/man-host-discovery.html;\ 150 | ;icmp_ping-3;-PM" \ 151 | ) 152 | 153 | # shellcheck disable=SC2034,SC2154 154 | _module_show=(\ 155 | "${module_name}" \ 156 | "${#_module_commands[@]}" \ 157 | "${author}" \ 158 | "${contact}" \ 159 | "${description}" \ 160 | ) 161 | 162 | # shellcheck disable=SC2034 163 | export _module_opts=(\ 164 | "$_module_help") 165 | 166 | return $_STATE 167 | 168 | } 169 | -------------------------------------------------------------------------------- /data/modules/nse_broadcast.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_broadcast() 7 | # 8 | # Description: 9 | # NSE Broadcast Module. 10 | # 11 | # Usage: 12 | # nse_broadcast 13 | # 14 | # Examples: 15 | # nse_broadcast 16 | # 17 | 18 | function nse_broadcast() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_broadcast" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Broadcast Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Broadcast Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/broadcast-avahi-dos.html;\ 113 | ;broadcast-avahi-dos;--script=broadcast-avahi-dos;\ 114 | \"broadcast-avahi-dos.wait=20s\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/broadcast-db2-discover.html;\ 117 | ;broadcast-db2-discover;--script=db2-discover" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/broadcast-dhcp-discover.html;\ 120 | ;broadcast-dhcp-discover;--script=broadcast-dhcp-discover;\ 121 | \"broadcast-dhcp-discover.timeout=10s\"" \ 122 | # 123 | "https://nmap.org/nsedoc/scripts/broadcast-dhcp6-discover.html;\ 124 | ;broadcast-dhcp6-discover;--script=broadcast-dhcp6-discover -6" \ 125 | # 126 | "https://nmap.org/nsedoc/scripts/broadcast-dns-service-discovery.html;\ 127 | ;broadcast-dns-service-discovery;--script=broadcast-dns-service-discovery" \ 128 | # 129 | "https://nmap.org/nsedoc/scripts/broadcast-dropbox-listener.html;\ 130 | ;broadcast-dropbox-listener;--script=broadcast-dropbox-listener" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/broadcast-eigrp-discovery.html;\ 133 | ;broadcast-eigrp-discovery;--script=broadcast-eigrp-discovery;\ 134 | \"broadcast-eigrp-discovery.kparams=101000\",\"broadcast-eigrp-discovery.as=224.0.0.10\",\ 135 | \"broadcast-eigrp-discovery.interface\",\"broadcast-eigrp-discovery.timeout=10s\"" \ 136 | # 137 | "https://nmap.org/nsedoc/scripts/broadcast-igmp-discovery.html;\ 138 | ;broadcast-igmp-discovery;--script=broadcast-igmp-discovery;\ 139 | \"broadcast-igmp-discovery.mgroupnamesdb\",\"broadcast-igmp-discovery.version=2\",\ 140 | \"broadcast-igmp-discovery.timeout=5s\",\"broadcast-igmp-discovery.interface\"" \ 141 | # 142 | "https://nmap.org/nsedoc/scripts/broadcast-listener.html;\ 143 | ;broadcast-listener;--script=broadcast-listener;\ 144 | \"broadcast-listener.timeout=30s\"" \ 145 | # 146 | "https://nmap.org/nsedoc/scripts/broadcast-ms-sql-discover.html;\ 147 | ;broadcast-ms-sql-discover;--script=broadcast-ms-sql-discover" \ 148 | # 149 | "https://nmap.org/nsedoc/scripts/broadcast-netbios-master-browser.html;\ 150 | ;broadcast-netbios-master-browser;--script=broadcast-netbios-master-browser" \ 151 | # 152 | "https://nmap.org/nsedoc/scripts/broadcast-novell-locate.html;\ 153 | ;broadcast-novell-locate;--script=broadcast-novell-locate" \ 154 | # 155 | "https://nmap.org/nsedoc/scripts/broadcast-ospf2-discover.html;\ 156 | ;broadcast-ospf2-discover;--script=broadcast-ospf2-discover;\ 157 | \"broadcast-ospf2-discover.md5_key\",\"broadcast-ospf2-discover.router_id=0.0.0.1\",\ 158 | \"broadcast-ospf2-discover.timeout=10s\",\"broadcast-ospf2-discover.interface\"" \ 159 | # 160 | "https://nmap.org/nsedoc/scripts/broadcast-ping.html;\ 161 | ;broadcast-ping;--script=broadcast-ping;\ 162 | \"broadcast-ping.timeout=3s\",\"broadcast-ping.num_probes=1\",\ 163 | \"broadcast-ping.interface\"" \ 164 | # 165 | "https://nmap.org/nsedoc/scripts/broadcast-pppoe-discover.html;\ 166 | ;broadcast-pppoe-discover;--script=broadcast-pppoe-discover" \ 167 | # 168 | "https://nmap.org/nsedoc/scripts/broadcast-rip-discover.html;\ 169 | ;broadcast-rip-discover;--script=broadcast-rip-discover;\ 170 | \"broadcast-rip-discover.timeout=5s\"" \ 171 | # 172 | "https://nmap.org/nsedoc/scripts/broadcast-ripng-discover.html;\ 173 | ;broadcast-ripng-discover;--script=broadcast-ripng-discover;\ 174 | \"broadcast-ripng-discover.timeout=5s\"" \ 175 | # 176 | "https://nmap.org/nsedoc/scripts/broadcast-upnp-info.html;\ 177 | ;broadcast-upnp-info;--script=broadcast-upnp-info" \ 178 | # 179 | "https://nmap.org/nsedoc/scripts/broadcast-db2-discover.html;\ 180 | ;broadcast-wake-on-lan;--script=broadcast-wake-on-lan;\ 181 | \"broadcast-wake-on-lan.address\",\"broadcast-wake-on-lan.MAC\"" \ 182 | ) 183 | 184 | # shellcheck disable=SC2034,SC2154 185 | _module_show=(\ 186 | "${module_name}" \ 187 | "${#_module_commands[@]}" \ 188 | "${author}" \ 189 | "${contact}" \ 190 | "${description}" \ 191 | ) 192 | 193 | # shellcheck disable=SC2034 194 | export _module_opts=(\ 195 | "$_module_help") 196 | 197 | return $_STATE 198 | 199 | } 200 | -------------------------------------------------------------------------------- /data/modules/nse_citrix.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_citrix() 7 | # 8 | # Description: 9 | # NSE Citrix Service Module. 10 | # 11 | # Usage: 12 | # nse_citrix 13 | # 14 | # Examples: 15 | # nse_citrix 16 | # 17 | 18 | function nse_citrix() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_citrix" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Citrix Service Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Citrix Service Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/citrix-brute-xml.html;\ 113 | ;citrix-brute-xml;--script=citrix-brute-xml;\ 114 | \"userdb\",\"passdb\",\"ntdomain\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/citrix-enum-apps-xml.html;\ 117 | ;citrix-enum-apps-xml;--script=citrix-enum-apps-xml" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/citrix-enum-apps.html;\ 120 | ;citrix-enum-apps;--script=citrix-enum-apps" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/citrix-enum-servers-xml.html;\ 123 | ;citrix-enum-servers-xml;--script=citrix-enum-servers-xml" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/citrix-enum-servers.html;\ 126 | ;citrix-enum-servers;--script=citrix-enum-servers" \ 127 | ) 128 | 129 | # shellcheck disable=SC2034,SC2154 130 | _module_show=(\ 131 | "${module_name}" \ 132 | "${#_module_commands[@]}" \ 133 | "${author}" \ 134 | "${contact}" \ 135 | "${description}" \ 136 | ) 137 | 138 | # shellcheck disable=SC2034 139 | export _module_opts=(\ 140 | "$_module_help") 141 | 142 | return $_STATE 143 | 144 | } 145 | -------------------------------------------------------------------------------- /data/modules/nse_databases.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_databases() 7 | # 8 | # Description: 9 | # NSE Databases Service Module. 10 | # 11 | # Usage: 12 | # nse_databases 13 | # 14 | # Examples: 15 | # nse_databases 16 | # 17 | 18 | function nse_databases() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_databases" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Databases Service Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Databases Service Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/couchdb-databases.html;\ 113 | ;couchdb-databases;--script=couchdb-databases" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/couchdb-stats.html;\ 116 | ;couchdb-stats;--script=couchdb-stats" \ 117 | # 118 | "https://nmap.org/nsedoc/scripts/db2-das-info.html;\ 119 | ;db2-das-info;--script=db2-das-info" \ 120 | # 121 | "https://nmap.org/nsedoc/scripts/membase-brute.html;\ 122 | ;membase-brute;--script=membase-brute;\ 123 | \"membase-brute.bucketname\"" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/membase-http-info.html;\ 126 | ;membase-http-info;--script=membase-http-info" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/mongodb-brute.html;\ 129 | ;mongodb-brute;--script=mongodb-brute;\ 130 | \"mongodb-brute.db=admin\"" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/mongodb-databases.html;\ 133 | ;mongodb-databases;--script=mongodb-databases" \ 134 | # 135 | "https://nmap.org/nsedoc/scripts/mongodb-info.html;\ 136 | ;mongodb-info;--script=mongodb-info;\ 137 | \"mongodb-info.db=admin\"" \ 138 | # 139 | "https://nmap.org/nsedoc/scripts/ms-sql-brute.html;\ 140 | ;ms-sql-brute;--script=ms-sql-brute;\ 141 | \"ms-sql-brute.ignore-lockout\",\"ms-sql-brute.brute-windows-accounts\"" \ 142 | # 143 | "https://nmap.org/nsedoc/scripts/ms-sql-config.html;\ 144 | ;ms-sql-config;--script=ms-sql-config;\ 145 | \"ms-sql-config.showall\"" \ 146 | # 147 | "https://nmap.org/nsedoc/scripts/ms-sql-dac.html;\ 148 | ;ms-sql-dac;--script=ms-sql-dac" \ 149 | # 150 | "https://nmap.org/nsedoc/scripts/ms-sql-dump-hashes.html;\ 151 | ;ms-sql-dump-hashes;--script=ms-sql-dump-hashes;\ 152 | \"ms-sql-dump-hashes.dir\"" \ 153 | # 154 | "https://nmap.org/nsedoc/scripts/ms-sql-empty-password.html;\ 155 | ;ms-sql-empty-password;--script=ms-sql-empty-password" \ 156 | # 157 | "https://nmap.org/nsedoc/scripts/ms-sql-hasdbaccess.html;\ 158 | ;ms-sql-hasdbaccess;--script=ms-sql-hasdbaccess;\ 159 | \"ms-sql-hasdbaccess.limit=5\"" \ 160 | # 161 | "https://nmap.org/nsedoc/scripts/ms-sql-info.html;\ 162 | ;ms-sql-info;--script=ms-sql-info" \ 163 | # 164 | "https://nmap.org/nsedoc/scripts/ms-sql-ntlm-info.html;\ 165 | ;ms-sql-ntlm-info;--script=ms-sql-ntlm-info" \ 166 | # 167 | "https://nmap.org/nsedoc/scripts/ms-sql-query.html;\ 168 | ;ms-sql-query;--script=ms-sql-query;\ 169 | \"mssql.database=tempdb\",\"ms-sql-query.query\"" \ 170 | # 171 | "https://nmap.org/nsedoc/scripts/ms-sql-tables.html;\ 172 | ;ms-sql-tables;--script=ms-sql-tables;\ 173 | \"ms-sql-tables.keywords\",\"ms-sql-tables.maxdb=5\",\ 174 | \"ms-sql-tables.maxtables=5\"" \ 175 | # 176 | "https://nmap.org/nsedoc/scripts/ms-sql-xp-cmdshell.html;\ 177 | ;ms-sql-xp-cmdshell;--script=ms-sql-xp-cmdshell;\ 178 | \"ms-sql-xp-cmdshell.cmd\"" \ 179 | # 180 | "https://nmap.org/nsedoc/scripts/mysql-audit.html;\ 181 | ;mysql-audit;--script=mysql-audit;\ 182 | \"mysql-audit.password\",\"mysql-audit.username\",\ 183 | \"mysql-audit.filename\"" \ 184 | # 185 | "https://nmap.org/nsedoc/scripts/mysql-brute.html;\ 186 | ;mysql-brute;--script=mysql-brute;\ 187 | \"mysql-brute.timeout=5s\"" \ 188 | # 189 | "https://nmap.org/nsedoc/scripts/mysql-databases.html;\ 190 | ;mysql-databases;--script=mysql-databases;\ 191 | \"mysqluser\",\"mysqlpass\"" \ 192 | # 193 | "https://nmap.org/nsedoc/scripts/mysql-dump-hashes.html;\ 194 | ;mysql-dump-hashes;--script=mysql-dump-hashes;\ 195 | \"username\",\"password\"" \ 196 | # 197 | "https://nmap.org/nsedoc/scripts/mysql-empty-password.html;\ 198 | ;mysql-empty-password;--script=mysql-empty-password" \ 199 | # 200 | "https://nmap.org/nsedoc/scripts/mysql-enum.html;\ 201 | ;mysql-enum;--script=mysql-enum;\ 202 | \"mysql-enum.timeout=5s\"" \ 203 | # 204 | "https://nmap.org/nsedoc/scripts/mysql-info.html;\ 205 | ;mysql-info;--script=mysql-info" \ 206 | # 207 | "https://nmap.org/nsedoc/scripts/mysql-query.html;\ 208 | ;mysql-query;--script=mysql-query;\ 209 | \"mysql-query.noheaders=false\",\"mysql-query.query\",\ 210 | \"mysql-query.username\",\"mysql-query.password\"" \ 211 | # 212 | "https://nmap.org/nsedoc/scripts/mysql-users.html;\ 213 | ;mysql-users;--script=mysql-users;\ 214 | \"mysqluser\",\"mysqlpass\"" \ 215 | # 216 | "https://nmap.org/nsedoc/scripts/mysql-variables.html;\ 217 | ;mysql-variables;--script=mysql-variables;\ 218 | \"mysqluser\",\"mysqlpass\"" \ 219 | # 220 | "https://nmap.org/nsedoc/scripts/mysql-vuln-cve2012-2122.html;\ 221 | ;mysql-vuln-cve2012-2122;--script=mysql-vuln-cve2012-2122;\ 222 | \"mysql-vuln-cve2012-2122.pass=nmapFTW\",\"mysql-vuln-cve2012-2122.user=root\",\ 223 | \"mysql-vuln-cve2012-2122.iterations=1500\",\"mysql-vuln-cve2012-2122.socket_timeout=5s\"" \ 224 | # 225 | "https://nmap.org/nsedoc/scripts/pgsql-brute.html;\ 226 | ;pgsql-brute;--script=pgsql-brute;\ 227 | \"pgsql.version,pgsql.nossl\"" \ 228 | ) 229 | 230 | # shellcheck disable=SC2034,SC2154 231 | _module_show=(\ 232 | "${module_name}" \ 233 | "${#_module_commands[@]}" \ 234 | "${author}" \ 235 | "${contact}" \ 236 | "${description}" \ 237 | ) 238 | 239 | # shellcheck disable=SC2034 240 | export _module_opts=(\ 241 | "$_module_help") 242 | 243 | return $_STATE 244 | 245 | } 246 | -------------------------------------------------------------------------------- /data/modules/nse_dns-dhcp.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_dns-dhcp() 7 | # 8 | # Description: 9 | # NSE DNS and DHCP Module. 10 | # 11 | # Usage: 12 | # nse_dns-dhcp 13 | # 14 | # Examples: 15 | # nse_dns-dhcp 16 | # 17 | 18 | function nse_dns-dhcp() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_dns-dhcp" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE DNS and DHCP Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE DNS and DHCP Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/asn-query.html;\ 113 | ;asn-query;--script=asn-query;\ 114 | \"dns\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/dns-blacklist.html;\ 117 | ;dns-blacklist;--script=dns-blacklist;\ 118 | \"dns-blacklist.services=all\",\"dns-blacklist.ip\",\ 119 | \"dns-blacklist.list\",\"dns-blacklist.category=all\",\ 120 | \"dns-blacklist.mode=long\"" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/dns-brute.html;\ 123 | ;dns-brute;--script=dns-brute;\ 124 | \"dns-brute.threads=5\",\"dns-brute.srvlist=nselib/data/dns-srv-names\",\ 125 | \"dns-brute.hostlist=nselib/data/vhosts-default.lst\",\"dns-brute.srv\",\ 126 | \"dns-brute.domain\"" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/dns-cache-snoop.html;\ 129 | ;dns-cache-snoop;--script=dns-cache-snoop.nse;\ 130 | \"dns-cache-snoop.mode=nonrecursive\",\"dns-cache-snoop.domains\"" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/dns-check-zone.html;\ 133 | ;dns-check-zone;--script=dns-check-zone;\ 134 | \"dns-check-zone.domain\"" \ 135 | # 136 | "https://nmap.org/nsedoc/scripts/dns-client-subnet-scan.html;\ 137 | ;dns-client-subnet-scan;--script=dns-client-subnet-scan;\ 138 | \"dns-client-subnet-scan.domain\",\"dns-client-subnet-scan.mask=24\",\ 139 | \"dns-client-subnet-scan.nameserver=host.ip\",\"dns-client-subnet-scan.address\"" \ 140 | # 141 | "https://nmap.org/nsedoc/scripts/dns-fuzz.html;\ 142 | ;dns-fuzz;--script=dns-fuzz;\ 143 | \"dns-fuzz.timelimit=10m\"" \ 144 | # 145 | "https://nmap.org/nsedoc/scripts/dns-ip6-arpa-scan.html;\ 146 | ;dns-ip6-arpa-scan;--script=dns-ip6-arpa-scan;\ 147 | \"prefix\",\"mask\"" \ 148 | # 149 | "https://nmap.org/nsedoc/scripts/dns-nsec-enum.html;\ 150 | ;dns-nsec-enum;--script=dns-nsec-enum;\ 151 | \"dns-nsec-enum.domains\"" \ 152 | # 153 | "https://nmap.org/nsedoc/scripts/dns-nsec3-enum.html;\ 154 | ;dns-nsec3-enum;--script=dns-nsec3-enum;\ 155 | \"dns-nsec3-enum.domains\",\"dns-nsec3-enum.timelimit=30m\"" \ 156 | # 157 | "https://nmap.org/nsedoc/scripts/dns-nsid.html;\ 158 | ;dns-nsid;--script=dns-nsid" \ 159 | # 160 | "https://nmap.org/nsedoc/scripts/dns-random-srcport.html;\ 161 | ;dns-random-srcport;--script=dns-random-srcport" \ 162 | # 163 | "https://nmap.org/nsedoc/scripts/dns-random-txid.html;\ 164 | ;dns-random-txid;--script=dns-random-txid" \ 165 | # 166 | "https://nmap.org/nsedoc/scripts/dns-recursion.html;\ 167 | ;dns-recursion;--script=dns-recursion" \ 168 | # 169 | "https://nmap.org/nsedoc/scripts/dns-service-discovery.html;\ 170 | ;dns-service-discovery;--script=dns-service-discovery" \ 171 | # 172 | "https://nmap.org/nsedoc/scripts/dns-srv-enum.html;\ 173 | ;dns-srv-enum;--script=dns-srv-enum;\ 174 | \"dns-srv-enum.domain\",\"dns-srv-enum.filter=all\"" \ 175 | # 176 | "https://nmap.org/nsedoc/scripts/dns-update.html;\ 177 | ;dns-update;--script=dns-update;\ 178 | \"dns-update.test\",\"dns-update.ip\",\"dns-update.hostname\"" \ 179 | # 180 | "https://nmap.org/nsedoc/scripts/dns-zone-transfer.html;\ 181 | ;dns-zone-transfer;--script=dns-zone-transfer;\ 182 | \"dns-zone-transfer.port=53\",\"dns-zone-transfer.server\",\ 183 | \"dns-zone-transfer.domain\"" \ 184 | # 185 | "https://nmap.org/nsedoc/scripts/fcrdns.html;\ 186 | ;fcrdns;--script=fcrdns" \ 187 | # 188 | "https://nmap.org/nsedoc/scripts/hostmap-bfk.html;\ 189 | ;hostmap-bfk;--script=hostmap-bfk;\ 190 | \"hostmap-bfk.prefix\"" \ 191 | # 192 | "https://nmap.org/nsedoc/scripts/hostmap-crtsh.html;\ 193 | ;hostmap-crtsh;--script=hostmap-crtsh;\ 194 | \"hostmap.prefix\"" \ 195 | # 196 | "https://nmap.org/nsedoc/scripts/hostmap-ip2hosts.html;\ 197 | ;hostmap-ip2hosts;--script=hostmap-ip2hosts;\ 198 | \"hostmap.prefix\"" \ 199 | # 200 | "https://nmap.org/nsedoc/scripts/hostmap-robtex.html;\ 201 | ;hostmap-robtex;--script=hostmap-robtex" \ 202 | # 203 | "https://nmap.org/nsedoc/scripts/llmnr-resolve.html;\ 204 | ;llmnr-resolve;--script=llmnr-resolve;\ 205 | \"llmnr-resolve.timeout=3s\",\"llmnr-resolve.hostname\"" \ 206 | # 207 | "https://nmap.org/nsedoc/scripts/dhcp-discover.html;\ 208 | ;dhcp-discover;--script=dhcp-discover;\ 209 | \"randomize_mac\",\"requests\",\"dhcptype=DHCPINFORM\"" \ 210 | # 211 | "https://nmap.org/nsedoc/scripts/http-robtex-reverse-ip.html;\ 212 | ;http-robtex-reverse-ip;--script=http-robtex-reverse-ip;\ 213 | \"http-robtex-reverse-ip.host\"" \ 214 | # 215 | "https://nmap.org/nsedoc/scripts/http-robtex-shared-ns.html;\ 216 | ;http-robtex-shared-ns;--script=http-robtex-shared-ns" \ 217 | ) 218 | 219 | # shellcheck disable=SC2034,SC2154 220 | _module_show=(\ 221 | "${module_name}" \ 222 | "${#_module_commands[@]}" \ 223 | "${author}" \ 224 | "${contact}" \ 225 | "${description}" \ 226 | ) 227 | 228 | # shellcheck disable=SC2034 229 | export _module_opts=(\ 230 | "$_module_help") 231 | 232 | return $_STATE 233 | 234 | } 235 | -------------------------------------------------------------------------------- /data/modules/nse_external.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_external() 7 | # 8 | # Description: 9 | # NSE External scripts (eg. from github). 10 | # 11 | # Usage: 12 | # nse_external 13 | # 14 | # Examples: 15 | # nse_external 16 | # 17 | 18 | function nse_external() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_external" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE External scripts (eg. from github)" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE External scripts (eg. from github). 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://github.com/vulnersCom/nmap-vulners;\ 113 | ;vulners-script;--script=${_nse}/vulners/vulners.nse;\ 114 | \"mincvss\"" \ 115 | # 116 | "https://github.com/scipag/vulscan;\ 117 | ;vulscan-script;--script=${_nse}/vulscan/vulscan.nse;\ 118 | \"vulscandb\"" \ 119 | # 120 | "https://github.com/s4n7h0/NSE;\ 121 | ;http-nikto-scan;--script=${_nse}/s4n7h0/http-nikto-scan.nse;\ 122 | \"http-nikto-scan.display=off\"" \ 123 | # 124 | "https://github.com/s4n7h0/NSE;\ 125 | ;http-shellshock;--script=${_nse}/s4n7h0/http-shellshock.nse;\ 126 | \"http-shockshock.depth=20\",\"http-shockshock.cookie\",\ 127 | \"http-shellshock.startpath=/\",\"http-shellshock.uri\"" \ 128 | # 129 | "https://github.com/scipag/httprecon-nse;\ 130 | ;httprecon-nse;--script=${_nse}/httprecon-nse/httprecon.nse" \ 131 | # 132 | "https://github.com/michenriksen/nmap-scripts;\ 133 | ;http-apache-server-status;--script=${_nse}/michenriksen/http-apache-server-status.nse" \ 134 | ) 135 | 136 | # shellcheck disable=SC2034,SC2154 137 | _module_show=(\ 138 | "${module_name}" \ 139 | "${#_module_commands[@]}" \ 140 | "${author}" \ 141 | "${contact}" \ 142 | "${description}" \ 143 | ) 144 | 145 | # shellcheck disable=SC2034 146 | export _module_opts=(\ 147 | "$_module_help") 148 | 149 | return $_STATE 150 | 151 | } 152 | -------------------------------------------------------------------------------- /data/modules/nse_ftp.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_ftp() 7 | # 8 | # Description: 9 | # NSE FTP Service Module. 10 | # 11 | # Usage: 12 | # nse_ftp 13 | # 14 | # Examples: 15 | # nse_ftp 16 | # 17 | 18 | function nse_ftp() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_ftp" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE FTP Service Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE FTP Service Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/ftp-anon.html;\ 113 | ;ftp-anon;--script=ftp-anon;\ 114 | \"ftp-anon.maxlist=20\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/ftp-bounce.html;\ 117 | ;ftp-bounce;--script=ftp-bounce;\ 118 | \"ftp-bounce.password=IEUser@\",\"ftp-bounce.username=anonymous\",\ 119 | \"ftp-bounce.checkhost=scanme.nmap.org\"" \ 120 | # 121 | "https://nmap.org/nsedoc/scripts/ftp-brute.html;\ 122 | ;ftp-brute;--script=ftp-brute;\ 123 | \"ftp-brute.timeout=5s\"" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/ftp-libopie.html;\ 126 | ;ftp-libopie;--script=ftp-libopie" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/ftp-proftpd-backdoor.html;\ 129 | ;ftp-proftpd-backdoor;--script=ftp-proftpd-backdoor;\ 130 | \"ftp-proftpd-backdoor.cmd=id\"" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/ftp-syst.html;\ 133 | ;ftp-syst;--script=ftp-syst" \ 134 | # 135 | "https://nmap.org/nsedoc/scripts/ftp-vsftpd-backdoor.html;\ 136 | ;ftp-vsftpd-backdoor;--script=ftp-vsftpd-backdoor;\ 137 | \"ftp-vsftpd-backdoor.cmd=id\"" \ 138 | # 139 | "https://nmap.org/nsedoc/scripts/ftp-vuln-cve2010-4221.html;\ 140 | ;ftp-vuln-cve2010-4221;--script=ftp-vuln-cve2010-4221" \ 141 | # 142 | "https://nmap.org/nsedoc/scripts/tftp-enum.html;\ 143 | ;tftp-enum;--script=tftp-enum;\ 144 | \"filelist\"" \ 145 | ) 146 | 147 | # shellcheck disable=SC2034,SC2154 148 | _module_show=(\ 149 | "${module_name}" \ 150 | "${#_module_commands[@]}" \ 151 | "${author}" \ 152 | "${contact}" \ 153 | "${description}" \ 154 | ) 155 | 156 | # shellcheck disable=SC2034 157 | export _module_opts=(\ 158 | "$_module_help") 159 | 160 | return $_STATE 161 | 162 | } 163 | -------------------------------------------------------------------------------- /data/modules/nse_hadoop.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_hadoop() 7 | # 8 | # Description: 9 | # NSE Hadoop Services Module. 10 | # 11 | # Usage: 12 | # nse_hadoop 13 | # 14 | # Examples: 15 | # nse_hadoop 16 | # 17 | 18 | function nse_hadoop() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_hadoop" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Hadoop Services Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Hadoop Services Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/hadoop-datanode-info.html;\ 113 | ;hadoop-datanode-info;--script=hadoop-datanode-info" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/hadoop-jobtracker-info.html;\ 116 | ;hadoop-jobtracker-info;--script=hadoop-jobtracker-info;\ 117 | \"hadoop-jobtracker-info.userinfo=false\"" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/hadoop-namenode-info.html;\ 120 | ;hadoop-namenode-info;--script=hadoop-namenode-info" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/hadoop-secondary-namenode-info.html;\ 123 | ;hadoop-secondary-namenode-info;--script=hadoop-secondary-namenode-info" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/hadoop-tasktracker-info.html;\ 126 | ;hadoop-tasktracker-info;--script=hadoop-tasktracker-info" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/hbase-master-info.html;\ 129 | ;hbase-master-info;--script=hbase-master-info" \ 130 | # 131 | "https://nmap.org/nsedoc/scripts/hbase-region-info.html;\ 132 | ;hbase-region-info;--script=hbase-region-info" \ 133 | ) 134 | 135 | # shellcheck disable=SC2034,SC2154 136 | _module_show=(\ 137 | "${module_name}" \ 138 | "${#_module_commands[@]}" \ 139 | "${author}" \ 140 | "${contact}" \ 141 | "${description}" \ 142 | ) 143 | 144 | # shellcheck disable=SC2034 145 | export _module_opts=(\ 146 | "$_module_help") 147 | 148 | return $_STATE 149 | 150 | } 151 | -------------------------------------------------------------------------------- /data/modules/nse_http-cve.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_http-cve() 7 | # 8 | # Description: 9 | # NSE HTTP Vulnerability CVE Module. 10 | # 11 | # Usage: 12 | # nse_http-cve 13 | # 14 | # Examples: 15 | # nse_http-cve 16 | # 17 | 18 | function nse_http-cve() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_http-cve" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE HTTP Vulnerability CVE Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE HTTP Vulnerability CVE Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2006-3392.html;\ 113 | ;http-vuln-cve2006-3392;--script=http-vuln-cve2006-3392;\ 114 | \"http-vuln-cve2006-3392.file=/etc/passwd\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2009-3960.html;\ 117 | ;http-vuln-cve2009-3960;--script=http-vuln-cve2009-3960;\ 118 | \"http-vuln-cve2009-3960.root/\",\"http-vuln-cve2009-3960.readfile=/etc/passwd\"" \ 119 | # 120 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2010-0738.html;\ 121 | ;http-vuln-cve2010-0738;--script=http-vuln-cve2010-0738;\ 122 | \"http-vuln-cve2010-0738.paths={\"/jmx-console/\"}\"" \ 123 | # 124 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2010-2861.html;\ 125 | ;http-vuln-cve2010-2861;--script=http-vuln-cve2010-2861" \ 126 | # 127 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2011-3192.html;\ 128 | ;http-vuln-cve2011-3192;--script=http-vuln-cve2011-3192;\ 129 | \"http-vuln-cve2011-3192.path\",\"http-vuln-cve2011-3192.hostname\"" \ 130 | # 131 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2011-3368.html;\ 132 | ;http-vuln-cve2011-3368;--script=http-vuln-cve2011-3368;\ 133 | \"http-vuln-cve2011-3368.prefix\"" \ 134 | # 135 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2012-1823.html;\ 136 | ;http-vuln-cve2012-1823;--script=http-vuln-cve2012-1823;\ 137 | \"http-vuln-cve2012-1823.uri=/index.php\",\"http-vuln-cve2012-1823.cmd=uname -a\"" \ 138 | # 139 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2013-0156.html;\ 140 | ;http-vuln-cve2013-0156;--script=http-vuln-cve2013-0156;\ 141 | \"http-vuln-cve2013-0156.uri=/\"" \ 142 | # 143 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2013-6786.html;\ 144 | ;http-vuln-cve2013-6786;--script=http-vuln-cve2013-6786" \ 145 | # 146 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2013-7091.html;\ 147 | ;http-vuln-cve2013-7091;--script=http-vuln-cve2013-7091;\ 148 | \"http-vuln-cve2013-7091.uri=/zimbra\"" \ 149 | # 150 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2014-2126.html;\ 151 | ;http-vuln-cve2014-2126;--script=http-vuln-cve2014-2126" \ 152 | # 153 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2014-2127.html;\ 154 | ;http-vuln-cve2014-2127;--script=http-vuln-cve2014-2127" \ 155 | # 156 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2014-2128.html;\ 157 | ;http-vuln-cve2014-2128;--script=http-vuln-cve2014-2128" \ 158 | # 159 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2014-2129.html;\ 160 | ;http-vuln-cve2014-2129;--script=http-vuln-cve2014-2129" \ 161 | # 162 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2014-3704.html;\ 163 | ;http-vuln-cve2014-3704;--script=http-vuln-cve2014-3704;\ 164 | \"http-vuln-cve2014-3704.uri=/\",\"http-vuln-cve2014-3704.cmd\",\ 165 | \"http-vuln-cve2014-3704.cleanup=true\"" \ 166 | # 167 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2014-8877.html;\ 168 | ;http-vuln-cve2014-8877;--script=http-vuln-cve2014-8877;\ 169 | \"http-vuln-cve2014-8877.cmd\",\"http-vuln-cve2014-8877.uri=/\"" \ 170 | # 171 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2015-1427.html;\ 172 | ;http-vuln-cve2015-1427;--script=http-vuln-cve2015-1427;\ 173 | \"command\",\"invasive\"" \ 174 | # 175 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2015-1635.html;\ 176 | ;http-vuln-cve2015-1635;--script=http-vuln-cve2015-1635;\ 177 | \"http-vuln-cve2015-1635.uri=/\"" \ 178 | # 179 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2017-1001000.html;\ 180 | ;http-vuln-cve2017-1001000;--script=http-vuln-cve2017-1001000;\ 181 | \"http-vuln-cve2017-1001000.uri=/\"" \ 182 | # 183 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2017-5638.html;\ 184 | ;http-vuln-cve2017-5638;--script=http-vuln-cve2017-5638;\ 185 | \"http-vuln-cve2017-5638.path=/\",\"http-vuln-cve2017-5638.method=GET\"" \ 186 | # 187 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2017-5689.html;\ 188 | ;http-vuln-cve2017-5689;--script=http-vuln-cve2017-5689" \ 189 | # 190 | "https://nmap.org/nsedoc/scripts/http-vuln-cve2017-8917.html;\ 191 | ;http-vuln-cve2017-8917;--script=http-vuln-cve2017-8917;\ 192 | \"http-vuln-cve2017-8917.uri\"" \ 193 | ) 194 | 195 | # shellcheck disable=SC2034,SC2154 196 | _module_show=(\ 197 | "${module_name}" \ 198 | "${#_module_commands[@]}" \ 199 | "${author}" \ 200 | "${contact}" \ 201 | "${description}" \ 202 | ) 203 | 204 | # shellcheck disable=SC2034 205 | export _module_opts=(\ 206 | "$_module_help") 207 | 208 | return $_STATE 209 | 210 | } 211 | -------------------------------------------------------------------------------- /data/modules/nse_http-services.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_http-services() 7 | # 8 | # Description: 9 | # NSE HTTP Services Module. 10 | # 11 | # Usage: 12 | # nse_http-services 13 | # 14 | # Examples: 15 | # nse_http-services 16 | # 17 | 18 | function nse_http-services() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_http-services" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE HTTP Services Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE HTTP Services Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/http-apache-negotiation.html;\ 113 | ;http-apache-negotiation;--script=http-apache-negotiation;\ 114 | \"http-apache-negotiation.root=/\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/http-apache-server-status.html;\ 117 | ;http-apache-server-status;--script=http-apache-server-status" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/http-aspnet-debug.html;\ 120 | ;http-aspnet-debug;--script=http-aspnet-debug;\ 121 | \"http-aspnet-debug.path=/\"" \ 122 | # 123 | "https://nmap.org/nsedoc/scripts/http-awstatstotals-exec.html;\ 124 | ;http-awstatstotals-exec;--script=http-awstatstotals-exec;\ 125 | \"http-awstatstotals-exec.uri=index.php\",\"http-awstatstotals-exec.cmd=whoami\",\ 126 | \"http-awstatstotals-exec.outfile\"" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/http-bigip-cookie.html;\ 129 | ;http-bigip-cookie;--script=http-bigip-cookie;\ 130 | \"http-bigip-cookie.path=/\"" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/http-cakephp-version.html;\ 133 | ;http-cakephp-version;--script=http-cakephp-version" \ 134 | # 135 | "https://nmap.org/nsedoc/scripts/http-dlink-backdoor.html;\ 136 | ;http-dlink-backdoor;--script=http-dlink-backdoor" \ 137 | # 138 | "https://nmap.org/nsedoc/scripts/http-drupal-enum.html;\ 139 | ;http-drupal-enum;--script=http-drupal-enum;\ 140 | \"http-drupal-enum.themes_path\",\"http-drupal-enum.number=100\",\ 141 | \"http-drupal-enum.type=all.choose\",\"http-drupal-enum.root=/\",\ 142 | \"http-drupal-enum.modules_path\"" \ 143 | # 144 | "https://nmap.org/nsedoc/scripts/http-drupal-enum-users.html;\ 145 | ;http-drupal-enum-users;--script=http-drupal-enum-users;\ 146 | \"http-drupal-enum-users.root=100\"" \ 147 | # 148 | "https://nmap.org/nsedoc/scripts/http-git.html;\ 149 | ;http-git;--script=http-git;\ 150 | \"http-git.root=/\"" \ 151 | # 152 | "https://nmap.org/nsedoc/scripts/http-iis-short-name-brute.html;\ 153 | ;http-iis-short-name-brute;--script=http-iis-short-name-brute" \ 154 | # 155 | "https://nmap.org/nsedoc/scripts/http-iis-webdav-vuln.html;\ 156 | ;http-iis-webdav-vuln;--script=http-iis-webdav-vuln;\ 157 | \"basefolder\",\"folderdb\",\"webdavfolder\"" \ 158 | # 159 | "https://nmap.org/nsedoc/scripts/http-joomla-brute.html;\ 160 | ;http-joomla-brute;--script=http-joomla-brute;\ 161 | \"http-joomla-brute.uservar=username\",\"http-joomla-brute.threads=3\",\ 162 | \"http-joomla-brute.uri=/administrator/index.php\",\"http-joomla-brute.hostname\",\ 163 | \"http-joomla-brute.passvar=passwd\"" \ 164 | # 165 | "https://nmap.org/nsedoc/scripts/http-jsonp-detection.html;\ 166 | ;http-jsonp-detection;--script=http-jsonp-detection;\ 167 | \"http-jsonp-detection.path=/\"" \ 168 | # 169 | "https://nmap.org/nsedoc/scripts/http-malware-host.html;\ 170 | ;http-malware-host;--script=http-malware-host" \ 171 | # 172 | "https://nmap.org/nsedoc/scripts/http-passwd.html;\ 173 | ;http-passwd;--script=http-passwd;\ 174 | \"http-passwd.root=/\"" \ 175 | # 176 | "https://nmap.org/nsedoc/scripts/http-php-version.html;\ 177 | ;http-php-version;--script=http-php-version" \ 178 | # 179 | "https://nmap.org/nsedoc/scripts/http-phpmyadmin-dir-traversal.html;\ 180 | ;http-phpmyadmin-dir-traversal;--script=http-phpmyadmin-dir-traversal;\ 181 | \"http-phpmyadmin-dir-traversal.dir=/phpMyAdmin-2.6.4-pl1/\",\ 182 | \"http-phpmyadmin-dir-traversal.file=../../../../../etc/passwd\",\ 183 | \"http-phpmyadmin-dir-traversal.outfile\"" \ 184 | # 185 | "https://nmap.org/nsedoc/scripts/http-robots.txt.html;\ 186 | ;http-robots;--script=http-robots.txt" \ 187 | # 188 | "https://nmap.org/nsedoc/scripts/http-tplink-dir-traversal.html;\ 189 | ;http-tplink-dir-traversal;--script=http-tplink-dir-traversal;\ 190 | \"http-tplink-dir-traversal.rfile=/etc/passwd\",\"http-tplink-dir-traversal.outfile\"" \ 191 | # 192 | "https://nmap.org/nsedoc/scripts/http-virustotal.html;\ 193 | ;http-virustotal;--script=http-virustotal;\ 194 | \"http-virustotal.checksum\",\"http-virustotal.apikey\",\ 195 | \"http-virustotal.upload=false\",\"http-virustotal.filename\"" \ 196 | # 197 | "https://nmap.org/nsedoc/scripts/http-vmware-path-vuln.html;\ 198 | ;http-vmware-path-vuln;--script=http-vmware-path-vuln" \ 199 | # 200 | "https://nmap.org/nsedoc/scripts/http-waf-detect.html;\ 201 | ;http-waf-detect;--script=http-waf-detect;\ 202 | \"http-waf-detect.uri\",\"http-waf-detect.aggro\",\ 203 | \"http-waf-detect.detectBodyChanges\"" \ 204 | # 205 | "https://nmap.org/nsedoc/scripts/http-waf-fingerprint.html;\ 206 | ;http-waf-fingerprint;--script=http-waf-fingerprint;\ 207 | \"http-waf-fingerprint.root=/\",\"http-waf-fingerprint.intensive\"" \ 208 | # 209 | "https://nmap.org/nsedoc/scripts/http-webdav-scan.html;\ 210 | ;http-webdav-scan;--script=http-webdav-scan;\ 211 | \"http-webdav-scan.path=/\"" \ 212 | # 213 | "https://nmap.org/nsedoc/scripts/http-wordpress-brute.html;\ 214 | ;http-wordpress-brute;--script=http-wordpress-brute;\ 215 | \"http-wordpress-brute.threads=3\",\"http-wordpress-brute.uri=/wp-login.php\",\ 216 | \"http-wordpress-brute.uservar=log\",\"http-wordpress-brute.hostname\",\ 217 | \"http-wordpress-brute.passvar=pwd\"" \ 218 | # 219 | "https://nmap.org/nsedoc/scripts/http-wordpress-enum.html;\ 220 | ;http-wordpress-enum;--script=http-wordpress-enum;\ 221 | \"http-wordpress-enum.type=all\",\"http-wordpress-enum.search-limit=100\",\ 222 | \"http-wordpress-enum.root=/\",\"http-wordpress-enum.check-latest=false\"" \ 223 | # 224 | "https://nmap.org/nsedoc/scripts/http-wordpress-users.html;\ 225 | ;http-wordpress-users;--script=http-wordpress-users;\ 226 | \"http-wordpress-users.out\",\"http-wordpress-users.basepath=/\",\ 227 | \"http-wordpress-users.limit=25\"" \ 228 | ) 229 | 230 | # shellcheck disable=SC2034,SC2154 231 | _module_show=(\ 232 | "${module_name}" \ 233 | "${#_module_commands[@]}" \ 234 | "${author}" \ 235 | "${contact}" \ 236 | "${description}" \ 237 | ) 238 | 239 | # shellcheck disable=SC2034 240 | export _module_opts=(\ 241 | "$_module_help") 242 | 243 | return $_STATE 244 | 245 | } 246 | -------------------------------------------------------------------------------- /data/modules/nse_mail.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_mail() 7 | # 8 | # Description: 9 | # NSE Mail Services Module. 10 | # 11 | # Usage: 12 | # nse_mail 13 | # 14 | # Examples: 15 | # nse_mail 16 | # 17 | 18 | function nse_mail() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_mail" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Mail Services Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Mail Services Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/imap-brute.html;\ 113 | ;imap-brute;--script=imap-brute;\ 114 | \"imap-brute.auth\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/imap-capabilities.html;\ 117 | ;imap-capabilities;--script=imap-capabilities" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/imap-ntlm-info.html;\ 120 | ;imap-ntlm-info;--script=imap-ntlm-info" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/pop3-brute.html;\ 123 | ;pop3-brute;--script=pop3-brute;\ 124 | \"pop3loginmethod=USER\"" \ 125 | # 126 | "https://nmap.org/nsedoc/scripts/pop3-capabilities.html;\ 127 | ;pop3-capabilities;--script=pop3-capabilities" \ 128 | # 129 | "https://nmap.org/nsedoc/scripts/pop3-ntlm-info.html;\ 130 | ;pop3-ntlm-info;--script=pop3-ntlm-info" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/smtp-brute.html;\ 133 | ;smtp-brute;--script=smtp-brute;\ 134 | \"smtp-brute.auth\"" \ 135 | # 136 | "https://nmap.org/nsedoc/scripts/smtp-commands.html;\ 137 | ;smtp-commands;--script=smtp-commands;\ 138 | \"smtp-commands.domain\"" \ 139 | # 140 | "https://nmap.org/nsedoc/scripts/smtp-enum-users.html;\ 141 | ;smtp-enum-users;--script=smtp-enum-users;\ 142 | \"smtp-enum-users.domain\",\"smtp-enum-users.methods\"" \ 143 | # 144 | "https://nmap.org/nsedoc/scripts/smtp-ntlm-info.html;\ 145 | ;smtp-ntlm-info;--script=smtp-ntlm-info" \ 146 | # 147 | "https://nmap.org/nsedoc/scripts/smtp-open-relay.html;\ 148 | ;smtp-open-relay;--script=smtp-open-relay;\ 149 | \"smtp-open-relay.ip\",\"smtp-open-relay.to=relaytest\",\ 150 | \"smtp-open-relay.domain=nmap.scanme.org\",\"smtp-open-relay.from=antispam\"" \ 151 | # 152 | "https://nmap.org/nsedoc/scripts/smtp-strangeport.html;\ 153 | ;smtp-strangeport;--script=smtp-strangeport" \ 154 | # 155 | "https://nmap.org/nsedoc/scripts/smtp-vuln-cve2010-4344.html;\ 156 | ;smtp-vuln-cve2010-4344;--script=smtp-vuln-cve2010-4344;\ 157 | \"exploit.cmd\",\"smtp-vuln-cve2010-4344.mailto\",\ 158 | \"smtp-vuln-cve2010-4344.mailfrom\",\"smtp-vuln-cve2010-4344.exploit\"" \ 159 | # 160 | "https://nmap.org/nsedoc/scripts/smtp-vuln-cve2011-1720.html;\ 161 | ;smtp-vuln-cve2011-1720;--script=smtp-vuln-cve2011-1720" \ 162 | # 163 | "https://nmap.org/nsedoc/scripts/smtp-vuln-cve2011-1764.html;\ 164 | ;smtp-vuln-cve2011-1764;--script=smtp-vuln-cve2011-1764;\ 165 | \"smtp-vuln-cve2011-1764.mailto\",\"smtp-vuln-cve2011-1764.mailfrom\"" \ 166 | ) 167 | 168 | # shellcheck disable=SC2034,SC2154 169 | _module_show=(\ 170 | "${module_name}" \ 171 | "${#_module_commands[@]}" \ 172 | "${author}" \ 173 | "${contact}" \ 174 | "${description}" \ 175 | ) 176 | 177 | # shellcheck disable=SC2034 178 | export _module_opts=(\ 179 | "$_module_help") 180 | 181 | return $_STATE 182 | 183 | } 184 | -------------------------------------------------------------------------------- /data/modules/nse_oracle.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_oracle() 7 | # 8 | # Description: 9 | # NSE Oracle Services Module. 10 | # 11 | # Usage: 12 | # nse_oracle 13 | # 14 | # Examples: 15 | # nse_oracle 16 | # 17 | 18 | function nse_oracle() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_oracle" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Oracle Services Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Oracle Services Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/oracle-brute-stealth.html;\ 113 | ;oracle-brute-stealth;--script=oracle-brute-stealth;\ 114 | \"oracle-brute-stealth.johnfile\",\"oracle-brute-stealth.accounts\",\ 115 | \"oracle-brute-stealth.sid\",\"oracle-brute-stealth.nodefault\"" \ 116 | # 117 | "https://nmap.org/nsedoc/scripts/oracle-brute.html;\ 118 | ;oracle-brute;--script=oracle-brute;\ 119 | \"oracle-brute.sid\",\"oracle-brute.nodefault\"" \ 120 | # 121 | "https://nmap.org/nsedoc/scripts/oracle-enum-users.html;\ 122 | ;oracle-enum-users;--script=oracle-enum-users;\ 123 | \"oracle-enum-users.sid\"" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/oracle-sid-brute.html;\ 126 | ;oracle-sid-brute;--script=oracle-sid-brute;\ 127 | \"oraclesids\"" \ 128 | # 129 | "https://nmap.org/nsedoc/scripts/oracle-tns-version.html;\ 130 | ;oracle-tns-version;--script=oracle-tns-version" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/ovs-agent-version.html;\ 133 | ;ovs-agent-version;--script=ovs-agent-version" \ 134 | ) 135 | 136 | # shellcheck disable=SC2034,SC2154 137 | _module_show=(\ 138 | "${module_name}" \ 139 | "${#_module_commands[@]}" \ 140 | "${author}" \ 141 | "${contact}" \ 142 | "${description}" \ 143 | ) 144 | 145 | # shellcheck disable=SC2034 146 | export _module_opts=(\ 147 | "$_module_help") 148 | 149 | return $_STATE 150 | 151 | } 152 | -------------------------------------------------------------------------------- /data/modules/nse_other-auth.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_other-auth() 7 | # 8 | # Description: 9 | # NSE Other Auth Module. 10 | # 11 | # Usage: 12 | # nse_other-auth 13 | # 14 | # Examples: 15 | # nse_other-auth 16 | # 17 | 18 | function nse_other-auth() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_other-auth" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Other Auth Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Other Auth Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/creds-summary.html;\ 113 | ;creds-summary;--script=creds-summary" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/krb5-enum-users.html;\ 116 | ;krb5-enum-users;--script=krb5-enum-users;\ 117 | \"krb5-enum-users.realm\"" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/x11-access.html;\ 120 | ;x11-access;--script=x11-access" \ 121 | ) 122 | 123 | # shellcheck disable=SC2034,SC2154 124 | _module_show=(\ 125 | "${module_name}" \ 126 | "${#_module_commands[@]}" \ 127 | "${author}" \ 128 | "${contact}" \ 129 | "${description}" \ 130 | ) 131 | 132 | # shellcheck disable=SC2034 133 | export _module_opts=(\ 134 | "$_module_help") 135 | 136 | return $_STATE 137 | 138 | } 139 | -------------------------------------------------------------------------------- /data/modules/nse_other-discovery.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_other-discovery() 7 | # 8 | # Description: 9 | # NSE Other Discovery Module. 10 | # 11 | # Usage: 12 | # nse_other-discovery 13 | # 14 | # Examples: 15 | # nse_other-discovery 16 | # 17 | 18 | function nse_other-discovery() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_other-discovery" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Other Discovery Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Other Discovery Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/banner.html;\ 113 | ;banner;--script=banner;\ 114 | \"banner.timeout=5s\",\"banner.ports\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/duplicates.html;\ 117 | ;duplicates;--script=duplicates" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/lltd-discovery.html;\ 120 | ;lltd-discovery;--script=lltd-discovery;\ 121 | \"lltd-discovery.interface\",\"lltd-discovery.timeout=30s\"" \ 122 | ) 123 | 124 | # shellcheck disable=SC2034,SC2154 125 | _module_show=(\ 126 | "${module_name}" \ 127 | "${#_module_commands[@]}" \ 128 | "${author}" \ 129 | "${contact}" \ 130 | "${description}" \ 131 | ) 132 | 133 | # shellcheck disable=SC2034 134 | export _module_opts=(\ 135 | "$_module_help") 136 | 137 | return $_STATE 138 | 139 | } 140 | -------------------------------------------------------------------------------- /data/modules/nse_other-network.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_other-network() 7 | # 8 | # Description: 9 | # NSE Other Network Module. 10 | # 11 | # Usage: 12 | # nse_other-network 13 | # 14 | # Examples: 15 | # nse_other-network 16 | # 17 | 18 | function nse_other-network() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_other-network" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Other Network Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Other Network Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/address-info.html;\ 113 | ;address-info;--script=address-info" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/firewall-bypass.html;\ 116 | ;firewall-bypass;--script=firewall-bypass;\ 117 | \"firewall-bypass.helper=ftp\",\"firewall-bypass.targetport\",\ 118 | \"firewall-bypass.helperport\"" \ 119 | # 120 | "https://nmap.org/nsedoc/scripts/ip-forwarding.html;\ 121 | ;ip-forwarding;--script=ip-forwarding;\ 122 | \"ip-forwarding.target\"" \ 123 | # 124 | "https://nmap.org/nsedoc/scripts/ip-geolocation-geoplugin.html;\ 125 | ;ip-geolocation-geoplugin;--script=ip-geolocation-geoplugin" \ 126 | # 127 | "https://nmap.org/nsedoc/scripts/ip-geolocation-ipinfodb.html;\ 128 | ;ip-geolocation-ipinfodb;--script=ip-geolocation-ipinfodb;\ 129 | \"ip-geolocation-ipinfodb.apikey\"" \ 130 | # 131 | "https://nmap.org/nsedoc/scripts/ip-geolocation-map-bing.html;\ 132 | ;ip-geolocation-map-bing;--script=ip-geolocation-map-bing;\ 133 | \"ip-geolocation-map-bing.format\",\"ip-geolocation-map-bing.size\",\ 134 | \"ip-geolocation-map-bing.marker_style\",\"ip-geolocation-map-bing.map_path\",\ 135 | \"ip-geolocation-map-bing.language=en\",\"ip-geolocation-map-bing.layer=Road\",\ 136 | \"ip-geolocation-map-bing.api_key\",\"ip-geolocation-map-bing.center\"" \ 137 | # 138 | "https://nmap.org/nsedoc/scripts/ip-geolocation-map-google.html;\ 139 | ;ip-geolocation-map-google;--script=ip-geolocation-map-google;\ 140 | \"ip-geolocation-map-google.layer=roadmap\",\"ip-geolocation-map-google.map_path\",\ 141 | \"ip-geolocation-map-google.format=png\",\"ip-geolocation-map-google.api_key\",\ 142 | \"ip-geolocation-map-google.scale=1\",\"ip-geolocation-map-google.marker_style\",\ 143 | \"ip-geolocation-map-google.center\",\"ip-geolocation-map-google.size=640x480\",\ 144 | \"ip-geolocation-map-google.language=en\"" \ 145 | # 146 | "https://nmap.org/nsedoc/scripts/ip-geolocation-map-kml.html;\ 147 | ;ip-geolocation-map-kml;--script=ip-geolocation-map-kml;\ 148 | \"ip-geolocation-map-kml.map_path\"" \ 149 | # 150 | "https://nmap.org/nsedoc/scripts/ip-geolocation-maxmind.html;\ 151 | ;ip-geolocation-maxmind;--script=ip-geolocation-maxmind;\ 152 | \"maxmind_db\"" \ 153 | # 154 | "https://nmap.org/nsedoc/scripts/ip-https-discover.html;\ 155 | ;ip-https-discover;--script=ip-https-discover" \ 156 | # 157 | "https://nmap.org/nsedoc/scripts/ipv6-multicast-mld-list.html;\ 158 | ;ipv6-multicast-mld-list;--script=ipv6-multicast-mld-list;\ 159 | \"ipv6-multicast-mld-list.timeout=10s\",\"ipv6-multicast-mld-list.interface\"" \ 160 | # 161 | "https://nmap.org/nsedoc/scripts/ipv6-node-info.html;\ 162 | ;ipv6-node-info;--script=ipv6-node-info" \ 163 | # 164 | "https://nmap.org/nsedoc/scripts/ipv6-ra-flood.html;\ 165 | ;ipv6-ra-flood;--script=ipv6-ra-flood;\ 166 | \"ipv6-ra-flood.interface\",\"ipv6-ra-flood.timeout=30s\"" \ 167 | # 168 | "https://nmap.org/nsedoc/scripts/mrinfo.html;\ 169 | ;mrinfo;--script=mrinfo;\ 170 | \"mrinfo.target=224.0.0.1\",\"mrinfo.timeout=5s\"" \ 171 | # 172 | "https://nmap.org/nsedoc/scripts/mtrace.html;\ 173 | ;mtrace;--script=mtrace;\ 174 | \"mtrace.fromip\",\"mtrace.group=0.0.0.0\",\ 175 | \"mtrace.timeout=7s\",\"mtrace.firsthop=224.0.0.2\",\ 176 | \"mtrace.toip\"" \ 177 | # 178 | "https://nmap.org/nsedoc/scripts/nat-pmp-info.html;\ 179 | ;nat-pmp-info;--script=nat-pmp-info" \ 180 | # 181 | "https://nmap.org/nsedoc/scripts/nat-pmp-mapport.html;\ 182 | ;nat-pmp-mapport;--script=nat-pmp-mapport;\ 183 | \"nat-pmp-mapport.op\",\"nat-pmp-mapport.protocol\",\ 184 | \"nat-pmp-mapport.privport\",\"nat-pmp-mapport.pubport\",\ 185 | \"nat-pmp-mapport.lifetime=3600s\"" \ 186 | # 187 | "https://nmap.org/nsedoc/scripts/nbstat.html;\ 188 | ;nbstat;--script=nbstat" \ 189 | # 190 | "https://nmap.org/nsedoc/scripts/nping-brute.html;\ 191 | ;nping-brute;--script=nping-brute" \ 192 | # 193 | "https://nmap.org/nsedoc/scripts/path-mtu.html;\ 194 | ;path-mtu;--script=path-mtu" \ 195 | # 196 | "https://nmap.org/nsedoc/scripts/pptp-version.html;\ 197 | ;pptp-version;--script=pptp-version" \ 198 | # 199 | "https://nmap.org/nsedoc/scripts/qscan.html;\ 200 | ;qscan;--script=qscan;\ 201 | \"numclosed=1\",\"numopen=8\",\"confidence\",\"numtrips\",\ 202 | \"delay=200ms\"" \ 203 | # 204 | "https://nmap.org/nsedoc/scripts/reverse-index.html;\ 205 | ;reverse-index;--script=reverse-index;\ 206 | \"reverse-index.mode=horizontal\",\"reverse-index.names\"" \ 207 | # 208 | "https://nmap.org/nsedoc/scripts/sniffer-detect.html;\ 209 | ;sniffer-detect;--script=sniffer-detect" \ 210 | # 211 | "https://nmap.org/nsedoc/scripts/stun-info.html;\ 212 | ;stun-info;--script=stun-info" \ 213 | # 214 | "https://nmap.org/nsedoc/scripts/stun-version.html;\ 215 | ;stun-version;--script=stun-version" \ 216 | # 217 | "https://nmap.org/nsedoc/scripts/targets-asn.html;\ 218 | ;targets-asn;--script=targets-asn;\ 219 | \"targets-asn.whois_port=43\",\"targets-asn.whois_server=asn.shadowserver.org\",\ 220 | \"targets-asn.asn\"" \ 221 | # 222 | "https://nmap.org/nsedoc/scripts/targets-ipv6-map4to6.html;\ 223 | ;targets-ipv6-map4to6;--script=targets-ipv6-map4to6;\ 224 | \"targets-ipv6-map4to6.IPv4Hosts\",\"targets-ipv6-subnet\"" \ 225 | # 226 | "https://nmap.org/nsedoc/scripts/targets-ipv6-multicast-echo.html;\ 227 | ;targets-ipv6-multicast-echo;--script=targets-ipv6-multicast-echo;\ 228 | \"targets-ipv6-multicast-echo.interface\"" \ 229 | # 230 | "https://nmap.org/nsedoc/scripts/targets-ipv6-multicast-invalid-dst.html;\ 231 | ;targets-ipv6-multicast-invalid-dst;--script=targets-ipv6-multicast-invalid-dst;\ 232 | \"targets-ipv6-multicast-invalid-dst.interface\"" \ 233 | # 234 | "https://nmap.org/nsedoc/scripts/targets-ipv6-multicast-mld.html;\ 235 | ;targets-ipv6-multicast-mld;--script=targets-ipv6-multicast-mld;\ 236 | \"targets-ipv6-multicast-mld.interface\",\"targets-ipv6-multicast-mld.timeout=10s\"" \ 237 | # 238 | "https://nmap.org/nsedoc/scripts/targets-ipv6-multicast-slaac.html;\ 239 | ;targets-ipv6-multicast-slaac;--script=targets-ipv6-multicast-slaac;\ 240 | \"targets-ipv6-multicast-slaac.interface\"" \ 241 | # 242 | "https://nmap.org/nsedoc/scripts/targets-ipv6-wordlist.html;\ 243 | ;targets-ipv6-wordlist;--script=targets-ipv6-wordlist;\ 244 | \"targets-ipv6-wordlist.nsegments\",\"targets-ipv6-wordlist.fillright\",\" 245 | \"targets-ipv6-subnet\",\"targets-ipv6-wordlist.wordlist=nselib/data/targets-ipv6-wordlist\"" \ 246 | # 247 | "https://nmap.org/nsedoc/scripts/targets-sniffer.html;\ 248 | ;targets-sniffer;--script=targets-sniffer;\ 249 | \"targets-sniffer.iface\",\"targets-sniffer.timeout=10s\"" \ 250 | # 251 | "https://nmap.org/nsedoc/scripts/targets-traceroute.html;\ 252 | ;targets-traceroute;--script=targets-traceroute" \ 253 | # 254 | "https://nmap.org/nsedoc/scripts/targets-xml.html;\ 255 | ;targets-xml;--script=targets-xml;\ 256 | \"targets-xml.iX\",\"targets-xml.state=up\"" \ 257 | # 258 | "https://nmap.org/nsedoc/scripts/tor-consensus-checker.html;\ 259 | ;tor-consensus-checker;--script=tor-consensus-checker" \ 260 | # 261 | "https://nmap.org/nsedoc/scripts/traceroute-geolocation.html;\ 262 | ;traceroute-geolocation;--script=traceroute-geolocation;\ 263 | \"traceroute-geolocation.kmlfile\"" \ 264 | ) 265 | 266 | # shellcheck disable=SC2034,SC2154 267 | _module_show=(\ 268 | "${module_name}" \ 269 | "${#_module_commands[@]}" \ 270 | "${author}" \ 271 | "${contact}" \ 272 | "${description}" \ 273 | ) 274 | 275 | # shellcheck disable=SC2034 276 | export _module_opts=(\ 277 | "$_module_help") 278 | 279 | return $_STATE 280 | 281 | } 282 | -------------------------------------------------------------------------------- /data/modules/nse_other-services.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_other-services() 7 | # 8 | # Description: 9 | # NSE Other Services Module. 10 | # 11 | # Usage: 12 | # nse_other-services 13 | # 14 | # Examples: 15 | # nse_other-services 16 | # 17 | 18 | function nse_other-services() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_other-services" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Other Services Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Other Services Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/amqp-info.html;\ 113 | ;amqp-info;--script=amqp-info" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/auth-owners.html;\ 116 | ;auth-owners;--script=auth-owners" \ 117 | # 118 | "https://nmap.org/nsedoc/scripts/auth-spoof.html;\ 119 | ;auth-spoof;--script=auth-spoof" \ 120 | # 121 | "https://nmap.org/nsedoc/scripts/bittorrent-discovery.html;\ 122 | ;bittorrent-discovery;--script=bittorrent-discovery;\ 123 | \"bittorrent-discovery.include-nodes\",\"bittorrent-discovery.timeout=30s\",\ 124 | \"bittorrent-discovery.magnet\",\"bittorrent-discovery.torrent\"" \ 125 | # 126 | "https://nmap.org/nsedoc/scripts/cassandra-brute.html;\ 127 | ;cassandra-brute;--script=cassandra-brute" \ 128 | # 129 | "https://nmap.org/nsedoc/scripts/cassandra-info.html;\ 130 | ;cassandra-info;--script=cassandra-info" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/clamav-exec.html;\ 133 | ;clamav-exec;--script=clamav-exec;\ 134 | \"clamav-exec.scandb\",\"clamav-exec.cmd\"" \ 135 | # 136 | "https://nmap.org/nsedoc/scripts/cups-info.html;\ 137 | ;cups-info;--script=cups-info" \ 138 | # 139 | "https://nmap.org/nsedoc/scripts/cups-queue-info.html;\ 140 | ;cups-queue-info;--script=cups-queue-info" \ 141 | # 142 | "https://nmap.org/nsedoc/scripts/cvs-brute-repository.html;\ 143 | ;cvs-brute-repository;--script=cvs-brute-repository;\ 144 | \"cvs-brute-repository.repofile\",\"cvs-brute-repository.nodefault\"" \ 145 | # 146 | "https://nmap.org/nsedoc/scripts/cvs-brute.html;\ 147 | ;cvs-brute;--script=cvs-brute;\ 148 | \"cvs-brute.repo\"" \ 149 | # 150 | "https://nmap.org/nsedoc/scripts/daytime.html;\ 151 | ;daytime;--script=daytime" \ 152 | # 153 | "https://nmap.org/nsedoc/scripts/docker-version.html;\ 154 | ;docker-version;--script=docker-version" \ 155 | # 156 | "https://nmap.org/nsedoc/scripts/hddtemp-info.html;\ 157 | ;hddtemp-info;--script=hddtemp-info" \ 158 | # 159 | "https://nmap.org/nsedoc/scripts/ike-version.html;\ 160 | ;ike-version;--script=ike-version" \ 161 | # 162 | "https://nmap.org/nsedoc/scripts/ipmi-brute.html;\ 163 | ;ipmi-brute;--script=ipmi-brute" \ 164 | # 165 | "https://nmap.org/nsedoc/scripts/ipmi-cipher-zero.html;\ 166 | ;ipmi-cipher-zero;--script=ipmi-cipher-zero" \ 167 | # 168 | "https://nmap.org/nsedoc/scripts/ipmi-version.html;\ 169 | ;ipmi-version;--script=ipmi-version" \ 170 | # 171 | "https://nmap.org/nsedoc/scripts/iscsi-brute.html;\ 172 | ;iscsi-brute;--script=iscsi-brute;\ 173 | \"iscsi-brute.target\"" \ 174 | # 175 | "https://nmap.org/nsedoc/scripts/iscsi-info.html;\ 176 | ;iscsi-info;--script=iscsi-info" \ 177 | # 178 | "https://nmap.org/nsedoc/scripts/ldap-brute.html;\ 179 | ;ldap-brute;--script=ldap-brute;\ 180 | \"ldap.upnsuffix\",\"ldap.saveprefix\",\"ldap.savetype\",\ 181 | \"ldap.base\"" \ 182 | # 183 | "https://nmap.org/nsedoc/scripts/ldap-novell-getpass.html;\ 184 | ;ldap-novell-getpass;--script=ldap-novell-getpass;\ 185 | \"ldap-novell-getpass.password\",\"ldap-novell-getpass.account\",\ 186 | \"ldap-novell-getpass.username\"" \ 187 | # 188 | "https://nmap.org/nsedoc/scripts/ldap-rootdse.html;\ 189 | ;ldap-rootdse;--script=ldap-rootdse" \ 190 | # 191 | "https://nmap.org/nsedoc/scripts/ldap-search.html;\ 192 | ;ldap-search;--script=ldap-search;\ 193 | \"ldap.searchattrib\",\"ldap.maxobjects=20\",\"ldap.qfilter\",\ 194 | \"ldap.attrib\",\"ldap.searchvalue=*\",\"ldap.password\",\ 195 | \"ldap.savesearch\",\"ldap.username\",\"ldap.base\"" \ 196 | # 197 | "https://nmap.org/nsedoc/scripts/memcached-info.html;\ 198 | ;memcached-info;--script=memcached-info" \ 199 | # 200 | "https://nmap.org/nsedoc/scripts/nfs-ls.html;\ 201 | ;nfs-ls;--script=nfs-ls;\ 202 | \"nfs-ls.time=m\",\"nfs.version\"" \ 203 | # 204 | "https://nmap.org/nsedoc/scripts/nfs-showmount.html;\ 205 | ;nfs-showmount;--script=nfs-showmount" \ 206 | # 207 | "https://nmap.org/nsedoc/scripts/nfs-statfs.html;\ 208 | ;nfs-statfs;--script=nfs-statfs;\ 209 | \"nfs-statfs.human\"" \ 210 | # 211 | "https://nmap.org/nsedoc/scripts/nntp-ntlm-info.html;\ 212 | ;nntp-ntlm-info;--script=nntp-ntlm-info" \ 213 | # 214 | "https://nmap.org/nsedoc/scripts/nrpe-enum.html;\ 215 | ;nrpe-enum;--script=nrpe-enum;\ 216 | \"nrpe-enum.cmds\"" \ 217 | # 218 | "https://nmap.org/nsedoc/scripts/ntp-info.html;\ 219 | ;ntp-info;--script=ntp-info" \ 220 | # 221 | "https://nmap.org/nsedoc/scripts/ntp-monlist.html;\ 222 | ;ntp-monlist;--script=ntp-monlist" \ 223 | # 224 | "https://nmap.org/nsedoc/scripts/puppet-naivesigning.html;\ 225 | ;puppet-naivesigning;--script=puppet-naivesigning;\ 226 | \"puppet-naivesigning.env=production\",\"puppet-naivesigning.csr\",\ 227 | \"puppet-naivesigning.node=agentzero.localdomain\"" \ 228 | # 229 | "https://nmap.org/nsedoc/scripts/redis-brute.html;\ 230 | ;redis-brute;--script=redis-brute" \ 231 | # 232 | "https://nmap.org/nsedoc/scripts/redis-info.html;\ 233 | ;redis-info;--script=redis-info" \ 234 | # 235 | "https://nmap.org/nsedoc/scripts/rexec-brute.html;\ 236 | ;rexec-brute;--script=rexec-brute;\ 237 | \"rexec-brute.timeout=10s\"" \ 238 | # 239 | "https://nmap.org/nsedoc/scripts/riak-http-info.html;\ 240 | ;riak-http-info;--script=riak-http-info" \ 241 | # 242 | "https://nmap.org/nsedoc/scripts/rpc-grind.html;\ 243 | ;rpc-grind;--script=rpc-grind;\ 244 | \"rpc-grind.threads=4\"" \ 245 | # 246 | "https://nmap.org/nsedoc/scripts/rpcinfo.html;\ 247 | ;rpcinfo;--script=rpcinfo" \ 248 | # 249 | "https://nmap.org/nsedoc/scripts/rsync-brute.html;\ 250 | ;rsync-brute;--script=rsync-brute;\ 251 | \"rsync-brute.module\"" \ 252 | # 253 | "https://nmap.org/nsedoc/scripts/rsync-list-modules.html;\ 254 | ;rsync-list-modules;--script=rsync-list-modules" \ 255 | # 256 | "https://nmap.org/nsedoc/scripts/rtsp-methods.html;\ 257 | ;rtsp-methods;--script=rtsp-methods;\ 258 | \"rtsp-methods.path=*\"" \ 259 | # 260 | "https://nmap.org/nsedoc/scripts/rtsp-url-brute.html;\ 261 | ;rtsp-url-brute;--script=rtsp-url-brute;\ 262 | \"rtsp-url-brute.urlfile\",\"rtsp-url-brute.threads\"" \ 263 | # 264 | "https://nmap.org/nsedoc/scripts/rusers.html;\ 265 | ;rusers;--script=rusers" \ 266 | # 267 | "https://nmap.org/nsedoc/scripts/sip-brute.html;\ 268 | ;sip-brute;--script=sip-brute" \ 269 | # 270 | "https://nmap.org/nsedoc/scripts/sip-call-spoof.html;\ 271 | ;sip-call-spoof;--script=sip-call-spoof;\ 272 | \"sip-call-spoof.from=Home\",\"sip-call-spoof.extension=100\",\ 273 | \"sip-call-spoof.ua=Ekiga\",\"sip-call-spoof.timeout=5s\",\ 274 | \"sip-call-spoof.src\"" \ 275 | # 276 | "https://nmap.org/nsedoc/scripts/sip-enum-users.html;\ 277 | ;sip-enum-users;--script=sip-enum-users;\ 278 | \"sip-enum-users.users\",\"sip-enum-users.minext=0\",\ 279 | \"sip-enum-users.userslist=nselib/data/usernames.lst\",\ 280 | \"sip-enum-users.padding=0\",\"sip-enum-users.maxext=999\"" \ 281 | # 282 | "https://nmap.org/nsedoc/scripts/sip-methods.html;\ 283 | ;sip-methods;--script=sip-methods" \ 284 | # 285 | "https://nmap.org/nsedoc/scripts/skypev2-version.html;\ 286 | ;skypev2-version;--script=skypev2-version" \ 287 | # 288 | "https://nmap.org/nsedoc/scripts/supermicro-ipmi-conf.html;\ 289 | ;supermicro-ipmi-conf;--script=supermicro-ipmi-conf;\ 290 | \"supermicro-ipmi-conf.out=_bmc.conf\"" \ 291 | # 292 | "https://nmap.org/nsedoc/scripts/svn-brute.html;\ 293 | ;svn-brute;--script=svn-brute;\ 294 | \"svn-brute.repo\",\"svn-brute.force\"" \ 295 | # 296 | "https://nmap.org/nsedoc/scripts/upnp-info.html;\ 297 | ;upnp-info;--script=upnp-info;\ 298 | \"upnp-info.override=true\"" \ 299 | # 300 | "https://nmap.org/nsedoc/scripts/vmauthd-brute.html;\ 301 | ;vmauthd-brute;--script=vmauthd-brute" \ 302 | # 303 | "https://nmap.org/nsedoc/scripts/vmware-version.html;\ 304 | ;vmware-version;--script=vmware-version" \ 305 | ) 306 | 307 | # shellcheck disable=SC2034,SC2154 308 | _module_show=(\ 309 | "${module_name}" \ 310 | "${#_module_commands[@]}" \ 311 | "${author}" \ 312 | "${contact}" \ 313 | "${description}" \ 314 | ) 315 | 316 | # shellcheck disable=SC2034 317 | export _module_opts=(\ 318 | "$_module_help") 319 | 320 | return $_STATE 321 | 322 | } 323 | -------------------------------------------------------------------------------- /data/modules/nse_other-version.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_other-version() 7 | # 8 | # Description: 9 | # NSE Other Version Module. 10 | # 11 | # Usage: 12 | # nse_other-version 13 | # 14 | # Examples: 15 | # nse_other-version 16 | # 17 | 18 | function nse_other-version() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_other-version" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Other Version Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Other Version Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/fingerprint-strings.html;\ 113 | ;fingerprint-strings;--script=fingerprint-strings;\ 114 | \"fingerprint-strings.n=4\"" \ 115 | ) 116 | 117 | # shellcheck disable=SC2034,SC2154 118 | _module_show=(\ 119 | "${module_name}" \ 120 | "${#_module_commands[@]}" \ 121 | "${author}" \ 122 | "${contact}" \ 123 | "${description}" \ 124 | ) 125 | 126 | # shellcheck disable=SC2034 127 | export _module_opts=(\ 128 | "$_module_help") 129 | 130 | return $_STATE 131 | 132 | } 133 | -------------------------------------------------------------------------------- /data/modules/nse_remote-access.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_remote-access() 7 | # 8 | # Description: 9 | # NSE Remote Access Module. 10 | # 11 | # Usage: 12 | # nse_remote-access 13 | # 14 | # Examples: 15 | # nse_remote-access 16 | # 17 | 18 | function nse_remote-access() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_remote-access" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Remote Access Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Remote Access Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/rdp-enum-encryption.html;\ 113 | ;rdp-enum-encryption;--script=rdp-enum-encryption" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/rdp-vuln-ms12-020.html;\ 116 | ;rdp-vuln-ms12-020;--script=rdp-vuln-ms12-020" \ 117 | # 118 | "https://nmap.org/nsedoc/scripts/realvnc-auth-bypass.html;\ 119 | ;realvnc-auth-bypass;--script=realvnc-auth-bypass" \ 120 | # 121 | "https://nmap.org/nsedoc/scripts/ssh-auth-methods.html;\ 122 | ;ssh-auth-methods;--script=ssh-auth-methods" \ 123 | # 124 | "https://nmap.org/nsedoc/scripts/ssh-brute.html;\ 125 | ;ssh-brute;--script=ssh-brute;\ 126 | \"ssh-brute.timeout=5s\"" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/ssh-hostkey.html;\ 129 | ;ssh-hostkey;--script=ssh-hostkey;\ 130 | \"ssh-hostkey.known-hosts\",\"ssh-hostkey.known-hosts-path\"" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/ssh-publickey-acceptance.html;\ 133 | ;ssh-publickey-acceptance;--script=ssh-publickey-acceptance;\ 134 | \"knownbad\",\"ssh.privatekeys\",\"publickeydb\",\ 135 | \"ssh.usernames\",\"ssh.publickeys\",\"ssh.passphrases\"" \ 136 | # 137 | "https://nmap.org/nsedoc/scripts/ssh-run.html;\ 138 | ;ssh-run;--script=ssh-run;\ 139 | \"ssh-run.username\",\"ssh-run.cmd\",\"ssh-run.password\",\ 140 | \"ssh-run.privatekey\",\"ssh-run.passphrase\"" \ 141 | # 142 | "https://nmap.org/nsedoc/scripts/ssh2-enum-algos.html;\ 143 | ;ssh2-enum-algos;--script=ssh2-enum-algos" \ 144 | # 145 | "https://nmap.org/nsedoc/scripts/sshv1.html;\ 146 | ;sshv1;--script=sshv1" \ 147 | # 148 | "https://nmap.org/nsedoc/scripts/telnet-brute.html;\ 149 | ;telnet-brute;--script=telnet-brute;\ 150 | \"telnet-brute.autosize=true\",\"telnet-brute.timeout=5s\"" \ 151 | # 152 | "https://nmap.org/nsedoc/scripts/telnet-encryption.html;\ 153 | ;telnet-encryption;--script=telnet-encryption" \ 154 | # 155 | "https://nmap.org/nsedoc/scripts/telnet-ntlm-info.html;\ 156 | ;telnet-ntlm-info;--script=telnet-ntlm-info" \ 157 | # 158 | "https://nmap.org/nsedoc/scripts/vnc-brute.html;\ 159 | ;vnc-brute;--script=vnc-brute;\ 160 | \"vnc-brute.bruteusers=false\"" \ 161 | # 162 | "https://nmap.org/nsedoc/scripts/vnc-info.html;\ 163 | ;vnc-info;--script=vnc-info" \ 164 | # 165 | "https://nmap.org/nsedoc/scripts/vnc-title.html;\ 166 | ;vnc-title;--script=vnc-title" \ 167 | ) 168 | 169 | # shellcheck disable=SC2034,SC2154 170 | _module_show=(\ 171 | "${module_name}" \ 172 | "${#_module_commands[@]}" \ 173 | "${author}" \ 174 | "${contact}" \ 175 | "${description}" \ 176 | ) 177 | 178 | # shellcheck disable=SC2034 179 | export _module_opts=(\ 180 | "$_module_help") 181 | 182 | return $_STATE 183 | 184 | } 185 | -------------------------------------------------------------------------------- /data/modules/nse_smb-vuln.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_smb-vuln() 7 | # 8 | # Description: 9 | # NSE SMB Protocol Vulnerability Module. 10 | # 11 | # Usage: 12 | # nse_smb-vuln 13 | # 14 | # Examples: 15 | # nse_smb-vuln 16 | # 17 | 18 | function nse_smb-vuln() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_smb-vuln" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE SMB Protocol Vulnerability Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE SMB Protocol Vulnerability Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/samba-vuln-cve-2012-1182.html;\ 113 | ;samba-vuln-cve-2012-1182;--script=samba-vuln-cve-2012-1182" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/smb-vuln-conficker.html;\ 116 | ;smb-vuln-conficker;--script=smb-vuln-conficker" \ 117 | # 118 | "https://nmap.org/nsedoc/scripts/smb-vuln-cve-2017-7494.html;\ 119 | ;smb-vuln-cve-2017-7494;--script=smb-vuln-cve-2017-7494;\ 120 | \"smb-vuln-cve-2017-7494.check-version=false\"" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/smb-vuln-cve2009-3103.html;\ 123 | ;smb-vuln-cve2009-3103;--script=smb-vuln-cve2009-3103" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/smb-vuln-ms06-025.html;\ 126 | ;smb-vuln-ms06-025;--script=smb-vuln-ms06-025" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/smb-vuln-ms07-029.html;\ 129 | ;smb-vuln-ms07-029;--script=smb-vuln-ms07-029" \ 130 | # 131 | "https://nmap.org/nsedoc/scripts/smb-vuln-ms08-067.html;\ 132 | ;smb-vuln-ms08-067;--script=smb-vuln-ms08-067" \ 133 | # 134 | "https://nmap.org/nsedoc/scripts/smb-vuln-ms10-054.html;\ 135 | ;smb-vuln-ms10-054;--script=smb-vuln-ms10-054;\ 136 | \"smb-vuln-ms10-054.share=ShareDocs\",\"unsafe\"" \ 137 | # 138 | "https://nmap.org/nsedoc/scripts/smb-vuln-ms10-061.html;\ 139 | ;smb-vuln-ms10-061;--script=smb-vuln-ms10-061;\ 140 | \"printer\"" \ 141 | # 142 | "https://nmap.org/nsedoc/scripts/smb-vuln-ms17-010.html;\ 143 | ;smb-vuln-ms17-010;--script=smb-vuln-ms17-010;\ 144 | \"smb-vuln-ms17-010.sharename=IPC$\"" \ 145 | # 146 | "https://nmap.org/nsedoc/scripts/smb-vuln-regsvc-dos.html;\ 147 | ;smb-vuln-regsvc-dos;--script=smb-vuln-regsvc-dos" \ 148 | ) 149 | 150 | # shellcheck disable=SC2034,SC2154 151 | _module_show=(\ 152 | "${module_name}" \ 153 | "${#_module_commands[@]}" \ 154 | "${author}" \ 155 | "${contact}" \ 156 | "${description}" \ 157 | ) 158 | 159 | # shellcheck disable=SC2034 160 | export _module_opts=(\ 161 | "$_module_help") 162 | 163 | return $_STATE 164 | 165 | } 166 | -------------------------------------------------------------------------------- /data/modules/nse_smb.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_smb() 7 | # 8 | # Description: 9 | # NSE SMB Protocol Module. 10 | # 11 | # Usage: 12 | # nse_smb 13 | # 14 | # Examples: 15 | # nse_smb 16 | # 17 | 18 | function nse_smb() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_smb" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE SMB Protocol Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE SMB Protocol Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/smb-brute.html;\ 113 | ;smb-brute;--script=smb-brute;\ 114 | \"smblockout\",\"canaries=3\",\"brutelimit=5000\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/smb-double-pulsar-backdoor.html;\ 117 | ;smb-double-pulsar-backdoor;--script=smb-double-pulsar-backdoor" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/smb-enum-domains.html;\ 120 | ;smb-enum-domains;--script=smb-enum-domains" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/smb-enum-groups.html;\ 123 | ;smb-enum-groups;--script=smb-enum-groups" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/smb-enum-processes.html;\ 126 | ;smb-enum-processes;--script=smb-enum-processes" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/smb-enum-services.html;\ 129 | ;smb-enum-services;--script=smb-enum-services" \ 130 | # 131 | "https://nmap.org/nsedoc/scripts/smb-enum-sessions.html;\ 132 | ;smb-enum-sessions;--script=smb-enum-sessions" \ 133 | # 134 | "https://nmap.org/nsedoc/scripts/smb-enum-shares.html;\ 135 | ;smb-enum-shares;--script=smb-enum-shares" \ 136 | # 137 | "https://nmap.org/nsedoc/scripts/smb-enum-users.html;\ 138 | ;smb-enum-users;--script=smb-enum-users;\ 139 | \"samronly\",\"lsaonly\"" \ 140 | # 141 | "https://nmap.org/nsedoc/scripts/smb-flood.html;\ 142 | ;smb-flood;--script=smb-flood" \ 143 | # 144 | "https://nmap.org/nsedoc/scripts/smb-ls.html;\ 145 | ;smb-ls;--script=smb-ls;\ 146 | \"smb-ls.path=/\",\"smb-ls.pattern=*\",\"smb-ls.share(s)\",\ 147 | \"smb-ls.checksum=false\"" \ 148 | # 149 | "https://nmap.org/nsedoc/scripts/smb-mbenum.html;\ 150 | ;smb-mbenum;--script=smb-mbenum;\ 151 | \"smb-mbenum.format=3\",\"smb-mbenum.domain\",\ 152 | \"smb-mbenum.filter\"" \ 153 | # 154 | "https://nmap.org/nsedoc/scripts/smb-os-discovery.html;\ 155 | ;smb-os-discovery;--script=smb-os-discovery" \ 156 | # 157 | "https://nmap.org/nsedoc/scripts/smb-print-text.html;\ 158 | ;smb-print-text;--script=smb-print-text;\ 159 | \"text\",\"filename\",\"printer\"" \ 160 | # 161 | "https://nmap.org/nsedoc/scripts/smb-protocols.html;\ 162 | ;smb-protocols;--script=smb-protocols" \ 163 | # 164 | "https://nmap.org/nsedoc/scripts/smb-psexec.html;\ 165 | ;smb-psexec;--script=smb-psexec;\ 166 | \"nohide\",\"cleanup\",\"nocipher\",\"sharepath\",\ 167 | \"config\",\"time=15s\",\"nocleanup\",\"key\",\"share\"" \ 168 | # 169 | "https://nmap.org/nsedoc/scripts/smb-security-mode.html;\ 170 | ;smb-security-mode;--script=smb-security-mode" \ 171 | # 172 | "https://nmap.org/nsedoc/scripts/smb-server-stats.html;\ 173 | ;smb-server-stats;--script=smb-server-stats" \ 174 | # 175 | "https://nmap.org/nsedoc/scripts/smb-system-info.html;\ 176 | ;smb-system-info;--script=smb-system-info" \ 177 | # 178 | "https://nmap.org/nsedoc/scripts/smb2-capabilities.html;\ 179 | ;smb2-capabilities;--script=smb2-capabilities" \ 180 | # 181 | "https://nmap.org/nsedoc/scripts/smb2-security-mode.html;\ 182 | ;smb2-security-mode;--script=smb2-security-mode" \ 183 | # 184 | "https://nmap.org/nsedoc/scripts/smb2-time.html;\ 185 | ;smb2-time;--script=smb2-time" \ 186 | # 187 | "https://nmap.org/nsedoc/scripts/smb2-vuln-uptime.html;\ 188 | ;smb2-vuln-uptime;--script=smb2-vuln-uptime;\ 189 | \"smb2-vuln-uptime.skip-os\"" \ 190 | ) 191 | 192 | # shellcheck disable=SC2034,SC2154 193 | _module_show=(\ 194 | "${module_name}" \ 195 | "${#_module_commands[@]}" \ 196 | "${author}" \ 197 | "${contact}" \ 198 | "${description}" \ 199 | ) 200 | 201 | # shellcheck disable=SC2034 202 | export _module_opts=(\ 203 | "$_module_help") 204 | 205 | return $_STATE 206 | 207 | } 208 | -------------------------------------------------------------------------------- /data/modules/nse_snmp.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_snmp() 7 | # 8 | # Description: 9 | # NSE SNMP Protocol Module. 10 | # 11 | # Usage: 12 | # nse_snmp 13 | # 14 | # Examples: 15 | # nse_snmp 16 | # 17 | 18 | function nse_snmp() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_snmp" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE SNMP Protocol Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE SNMP Protocol Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/snmp-brute.html;\ 113 | ;snmp-brute;--script=snmp-brute;\ 114 | \"snmp-brute.communitiesdb\"" \ 115 | # 116 | "https://nmap.org/nsedoc/scripts/snmp-hh3c-logins.html;\ 117 | ;snmp-hh3c-logins;--script=snmp-hh3c-logins" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/snmp-info.html;\ 120 | ;snmp-info;--script=snmp-info" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/snmp-interfaces.html;\ 123 | ;snmp-interfaces;--script=snmp-interfaces;\ 124 | \"snmp-interfaces.host\",\"snmp-interfaces.port=161\"" \ 125 | # 126 | "https://nmap.org/nsedoc/scripts/snmp-ios-config.html;\ 127 | ;snmp-ios-config;--script=snmp-ios-config;\ 128 | \"snmp-ios-config.tftproot\"" \ 129 | # 130 | "https://nmap.org/nsedoc/scripts/snmp-netstat.html;\ 131 | ;snmp-netstat;--script=snmp-netstat" \ 132 | # 133 | "https://nmap.org/nsedoc/scripts/snmp-processes.html;\ 134 | ;snmp-processes;--script=snmp-processes" \ 135 | # 136 | "https://nmap.org/nsedoc/scripts/snmp-sysdescr.html;\ 137 | ;snmp-sysdescr;--script=snmp-sysdescr" \ 138 | # 139 | "https://nmap.org/nsedoc/scripts/snmp-win32-services.html;\ 140 | ;snmp-win32-services;--script=snmp-win32-services" \ 141 | # 142 | "https://nmap.org/nsedoc/scripts/snmp-win32-shares.html;\ 143 | ;snmp-win32-shares;--script=snmp-win32-shares" \ 144 | # 145 | "https://nmap.org/nsedoc/scripts/snmp-win32-software.html;\ 146 | ;snmp-win32-software;--script=snmp-win32-software" \ 147 | # 148 | "https://nmap.org/nsedoc/scripts/snmp-win32-users.html;\ 149 | ;snmp-win32-users;--script=snmp-win32-users" \ 150 | ) 151 | 152 | # shellcheck disable=SC2034,SC2154 153 | _module_show=(\ 154 | "${module_name}" \ 155 | "${#_module_commands[@]}" \ 156 | "${author}" \ 157 | "${contact}" \ 158 | "${description}" \ 159 | ) 160 | 161 | # shellcheck disable=SC2034 162 | export _module_opts=(\ 163 | "$_module_help") 164 | 165 | return $_STATE 166 | 167 | } 168 | -------------------------------------------------------------------------------- /data/modules/nse_socks.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_socks() 7 | # 8 | # Description: 9 | # NSE SOCKS Module. 10 | # 11 | # Usage: 12 | # nse_socks 13 | # 14 | # Examples: 15 | # nse_socks 16 | # 17 | 18 | function nse_socks() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_socks" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE SOCKS Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE SOCKS Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/socks-auth-info.html;\ 113 | ;socks-auth-info;--script=socks-auth-info" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/socks-brute.html;\ 116 | ;socks-brute;--script=socks-brute" \ 117 | # 118 | "https://nmap.org/nsedoc/scripts/socks-open-proxy.html;\ 119 | ;socks-open-proxy;--script=socks-open-proxy" \ 120 | ) 121 | 122 | # shellcheck disable=SC2034,SC2154 123 | _module_show=(\ 124 | "${module_name}" \ 125 | "${#_module_commands[@]}" \ 126 | "${author}" \ 127 | "${contact}" \ 128 | "${description}" \ 129 | ) 130 | 131 | # shellcheck disable=SC2034 132 | export _module_opts=(\ 133 | "$_module_help") 134 | 135 | return $_STATE 136 | 137 | } 138 | -------------------------------------------------------------------------------- /data/modules/nse_ssl.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_ssl() 7 | # 8 | # Description: 9 | # NSE SSL Protocol Module. 10 | # 11 | # Usage: 12 | # nse_ssl 13 | # 14 | # Examples: 15 | # nse_ssl 16 | # 17 | 18 | function nse_ssl() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_ssl" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE SSL Protocol Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE SSL Protocol Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/rsa-vuln-roca.html;\ 113 | ;rsa-vuln-roca;--script=rsa-vuln-roca" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/ssl-ccs-injection.html;\ 116 | ;ssl-ccs-injection;--script=ssl-ccs-injection" \ 117 | # 118 | "https://nmap.org/nsedoc/scripts/ssl-cert-intaddr.html;\ 119 | ;ssl-cert-intaddr;--script=ssl-cert-intaddr" \ 120 | # 121 | "https://nmap.org/nsedoc/scripts/ssl-cert.html;\ 122 | ;ssl-cert;--script=ssl-cert" \ 123 | # 124 | "https://nmap.org/nsedoc/scripts/ssl-date.html;\ 125 | ;ssl-date;--script=ssl-date" \ 126 | # 127 | "https://nmap.org/nsedoc/scripts/ssl-dh-params.html;\ 128 | ;ssl-dh-params;--script=ssl-dh-params" \ 129 | # 130 | "https://nmap.org/nsedoc/scripts/ssl-enum-ciphers.html;\ 131 | ;ssl-enum-ciphers;--script=ssl-enum-ciphers" \ 132 | # 133 | "https://nmap.org/nsedoc/scripts/ssl-heartbleed.html;\ 134 | ;ssl-heartbleed;--script=ssl-heartbleed;\ 135 | \"ssl-heartbleed.protocols\"" \ 136 | # 137 | "https://nmap.org/nsedoc/scripts/ssl-known-key.html;\ 138 | ;ssl-known-key;--script=ssl-known-key;\ 139 | \"ssl-known-key.fingerprintfile\"" \ 140 | # 141 | "https://nmap.org/nsedoc/scripts/ssl-poodle.html;\ 142 | ;ssl-poodle;--script=ssl-poodle" \ 143 | # 144 | "https://nmap.org/nsedoc/scripts/sslv2-drown.html;\ 145 | ;sslv2-drown;--script=sslv2-drown" \ 146 | # 147 | "https://nmap.org/nsedoc/scripts/sslv2.html;\ 148 | ;sslv2;--script=sslv2" \ 149 | # 150 | "https://nmap.org/nsedoc/scripts/sstp-discover.html;\ 151 | ;sstp-discover;--script=sstp-discover" \ 152 | # 153 | "https://nmap.org/nsedoc/scripts/tls-alpn.html;\ 154 | ;tls-alpn;--script=tls-alpn" \ 155 | # 156 | "https://nmap.org/nsedoc/scripts/tls-nextprotoneg.html;\ 157 | ;tls-nextprotoneg;--script=tls-nextprotoneg" \ 158 | # 159 | "https://nmap.org/nsedoc/scripts/tls-ticketbleed.html;\ 160 | ;tls-ticketbleed;--script=tls-ticketbleed;\ 161 | \"tls-ticketbleed.protocols\"" \ 162 | ) 163 | 164 | # shellcheck disable=SC2034,SC2154 165 | _module_show=(\ 166 | "${module_name}" \ 167 | "${#_module_commands[@]}" \ 168 | "${author}" \ 169 | "${contact}" \ 170 | "${description}" \ 171 | ) 172 | 173 | # shellcheck disable=SC2034 174 | export _module_opts=(\ 175 | "$_module_help") 176 | 177 | return $_STATE 178 | 179 | } 180 | -------------------------------------------------------------------------------- /data/modules/nse_vuln-scanners.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_vuln-scanners() 7 | # 8 | # Description: 9 | # NSE Vulnerability Scanners Module. 10 | # 11 | # Usage: 12 | # nse_vuln-scanners 13 | # 14 | # Examples: 15 | # nse_vuln-scanners 16 | # 17 | 18 | function nse_vuln-scanners() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_vuln-scanners" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Vulnerability Scanners Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Vulnerability Scanners Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/nessus-brute.html;\ 113 | ;nessus-brute;--script=nessus-brute" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/nessus-xmlrpc-brute.html;\ 116 | ;nessus-xmlrpc-brute;--script=nessus-xmlrpc-brute;\ 117 | \"nessus-xmlrpc-brute.timeout=5s\",\"nessus-xmlrpc-brute.threads\"" \ 118 | # 119 | "https://nmap.org/nsedoc/scripts/nexpose-brute.html;\ 120 | ;nexpose-brute;--script=nexpose-brute" \ 121 | # 122 | "https://nmap.org/nsedoc/scripts/omp2-brute.html;\ 123 | ;omp2-brute;--script=omp2-brute" \ 124 | # 125 | "https://nmap.org/nsedoc/scripts/omp2-enum-targets.html;\ 126 | ;omp2-enum-targets;--script=omp2-enum-targets" \ 127 | # 128 | "https://nmap.org/nsedoc/scripts/openvas-otp-brute.html;\ 129 | ;openvas-otp-brute;--script=openvas-otp-brute;\ 130 | \"openvas-otp-brute.threads=4\"" \ 131 | # 132 | "https://nmap.org/nsedoc/scripts/shodan-api.html;\ 133 | ;shodan-api;--script=shodan-api;\ 134 | \"shodan-api.target\",\"shodan-api.apikey\",\"shodan-api.outfile\"" \ 135 | ) 136 | 137 | # shellcheck disable=SC2034,SC2154 138 | _module_show=(\ 139 | "${module_name}" \ 140 | "${#_module_commands[@]}" \ 141 | "${author}" \ 142 | "${contact}" \ 143 | "${description}" \ 144 | ) 145 | 146 | # shellcheck disable=SC2034 147 | export _module_opts=(\ 148 | "$_module_help") 149 | 150 | return $_STATE 151 | 152 | } 153 | -------------------------------------------------------------------------------- /data/modules/nse_whois.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: nse_whois() 7 | # 8 | # Description: 9 | # NSE Whois Database Module. 10 | # 11 | # Usage: 12 | # nse_whois 13 | # 14 | # Examples: 15 | # nse_whois 16 | # 17 | 18 | function nse_whois() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="nse_whois" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="NSE Whois Database Module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | NSE Whois Database Module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "https://nmap.org/nsedoc/scripts/whois-domain.html;\ 113 | ;whois-domain;--script=whois-domain" \ 114 | # 115 | "https://nmap.org/nsedoc/scripts/whois-ip.html;\ 116 | ;whois-ip;--script=whois-ip;\ 117 | \"whodb\"" \ 118 | ) 119 | 120 | # shellcheck disable=SC2034,SC2154 121 | _module_show=(\ 122 | "${module_name}" \ 123 | "${#_module_commands[@]}" \ 124 | "${author}" \ 125 | "${contact}" \ 126 | "${description}" \ 127 | ) 128 | 129 | # shellcheck disable=SC2034 130 | export _module_opts=(\ 131 | "$_module_help") 132 | 133 | return $_STATE 134 | 135 | } 136 | -------------------------------------------------------------------------------- /data/modules/os_detection.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: os_detection() 7 | # 8 | # Description: 9 | # OS Detection module. 10 | # 11 | # Usage: 12 | # os_detection 13 | # 14 | # Examples: 15 | # os_detection 16 | # 17 | 18 | function os_detection() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="os_detection" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="Nmap OS Detection module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | Nmap OS Detection module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # ---------------------------------------------------------------------------------------\n 110 | 111 | # shellcheck disable=SC2034 112 | _module_commands=(\ 113 | # 114 | "https://nmap.org/book/man-os-detection.html;\ 115 | ;os_detection;-O" \ 116 | # 117 | "https://nmap.org/book/man-os-detection.html;\ 118 | ;os_limit;-O --osscan-limit" \ 119 | # 120 | "https://nmap.org/book/man-os-detection.html;\ 121 | ;guess_aggressive;-O --osscan-guess" \ 122 | # 123 | "https://nmap.org/book/man-os-detection.html;\ 124 | ;max_detect;-O --max-os-tries 1" \ 125 | ) 126 | 127 | # shellcheck disable=SC2034,SC2154 128 | _module_show=(\ 129 | "${module_name}" \ 130 | "${#_module_commands[@]}" \ 131 | "${author}" \ 132 | "${contact}" \ 133 | "${description}" \ 134 | ) 135 | 136 | # shellcheck disable=SC2034 137 | export _module_opts=(\ 138 | "$_module_help") 139 | 140 | return $_STATE 141 | 142 | } 143 | -------------------------------------------------------------------------------- /data/modules/port_scan.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: port_scan() 7 | # 8 | # Description: 9 | # Nmap Port Scan types module. 10 | # 11 | # Usage: 12 | # port_scan 13 | # 14 | # Examples: 15 | # port_scan 16 | # 17 | 18 | function port_scan() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="port_scan" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="Nmap Port Scan types module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | Nmap Port Scan types module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # ---------------------------------------------------------------------------------------\n 110 | 111 | # shellcheck disable=SC2034 112 | _module_commands=(\ 113 | # 114 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 115 | ;tcp_syn;-sS" \ 116 | # 117 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 118 | ;tcp_conn;-sT" \ 119 | # 120 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 121 | ;udp_scan;-sU" \ 122 | # 123 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 124 | ;sctp_scan;-sY" \ 125 | # 126 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 127 | ;null_scan;-sN" \ 128 | # 129 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 130 | ;fin_scan;-sF" \ 131 | # 132 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 133 | ;xmas_scan;-sX" \ 134 | # 135 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 136 | ;tcp_ack_scan;-sA" \ 137 | # 138 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 139 | ;tcp_window;-sW" \ 140 | # 141 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 142 | ;tcp_maimon;-sM" \ 143 | # 144 | "https://nmap.org/book/man-port-scanning-techniques.html;\ 145 | ;ip_proto_scan;-sO" \ 146 | ) 147 | 148 | # shellcheck disable=SC2034,SC2154 149 | _module_show=(\ 150 | "${module_name}" \ 151 | "${#_module_commands[@]}" \ 152 | "${author}" \ 153 | "${contact}" \ 154 | "${description}" \ 155 | ) 156 | 157 | # shellcheck disable=SC2034 158 | export _module_opts=(\ 159 | "$_module_help") 160 | 161 | return $_STATE 162 | 163 | } 164 | -------------------------------------------------------------------------------- /data/modules/service_detection.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: service_detection() 7 | # 8 | # Description: 9 | # Service and Version Detection module. 10 | # 11 | # Usage: 12 | # service_detection 13 | # 14 | # Examples: 15 | # service_detection 16 | # 17 | 18 | function service_detection() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="service_detection" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="Service and Version Detection module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | Service and Version Detection module. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # ---------------------------------------------------------------------------------------\n 110 | 111 | # shellcheck disable=SC2034 112 | _module_commands=(\ 113 | # 114 | "https://nmap.org/book/man-version-detection.html;\ 115 | ;version_detection;-sV" \ 116 | # 117 | "https://nmap.org/book/man-version-detection.html;\ 118 | ;more_aggressive;-sV --version-intensity 5" \ 119 | # 120 | "https://nmap.org/book/man-version-detection.html;\ 121 | ;light;-sV --version-ligh" \ 122 | # 123 | "https://nmap.org/book/man-version-detection.html;\ 124 | ;banner;-sV --version-intensity 0" \ 125 | # 126 | "https://nmap.org/book/man-version-detection.html;\ 127 | ;version_all;-sV --version-all" \ 128 | ) 129 | 130 | # shellcheck disable=SC2034,SC2154 131 | _module_show=(\ 132 | "${module_name}" \ 133 | "${#_module_commands[@]}" \ 134 | "${author}" \ 135 | "${contact}" \ 136 | "${description}" \ 137 | ) 138 | 139 | # shellcheck disable=SC2034 140 | export _module_opts=(\ 141 | "$_module_help") 142 | 143 | return $_STATE 144 | 145 | } 146 | -------------------------------------------------------------------------------- /data/modules/zenmap.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: zenmap() 7 | # 8 | # Description: 9 | # Zenmap module. 10 | # 11 | # Usage: 12 | # zenmap 13 | # 14 | # Examples: 15 | # zenmap 16 | # 17 | 18 | function zenmap() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="zenmap" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="trimstray" 38 | contact="trimstray@gmail.com" 39 | description="Zenmap module" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | Zenmap predefined commands. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | "Intense scan;\ 113 | ;intense;-T4 -A -v" \ 114 | # 115 | "Intense scan plus UDP;\ 116 | ;intense_udp;-sS -sU -T4 -A -v" \ 117 | # 118 | "Intense scan, all TCP ports;\ 119 | ;intense_all_tcp;-p 1-65535 -T4 -A -v" \ 120 | # 121 | "Intense scan, no ping;\ 122 | ;intense_no_ping;-T4 -A -v -Pn" \ 123 | # 124 | "Ping scan;\ 125 | ;ping_scan;-sn" \ 126 | # 127 | "Quick scan;\ 128 | ;quick;-T4 -F" \ 129 | # 130 | "Quick scan plus;\ 131 | ;quick_plus;-sV -T4 -O -F --version-light" \ 132 | # 133 | "Quick traceroute;\ 134 | ;quick_trace;-sn --traceroute" \ 135 | # 136 | "Regular scan;\ 137 | ;regular;" \ 138 | # 139 | "Slow comprehensive scan;\ 140 | ;slow;-sS -sU -T4 -A -v -PE -PP -PS80,443 -PA3389 -PU40125 -PY -g 53 --script \"default or (discovery and safe)\"" \ 141 | ) 142 | 143 | # shellcheck disable=SC2034,SC2154 144 | _module_show=(\ 145 | "${module_name}" \ 146 | "${#_module_commands[@]}" \ 147 | "${author}" \ 148 | "${contact}" \ 149 | "${description}" \ 150 | ) 151 | 152 | # shellcheck disable=SC2034 153 | export _module_opts=(\ 154 | "$_module_help") 155 | 156 | return $_STATE 157 | 158 | } 159 | -------------------------------------------------------------------------------- /data/output/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trimstray/sandmap/5be99d4f225d7c703d0bfbd283b381a4758e0950/data/output/.gitkeep -------------------------------------------------------------------------------- /etc/main.cfg: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Specifies the default destination. 4 | # Examples: 5 | # - dest="127.0.0.1,8.8.8.8" 6 | dest="127.0.0.1" 7 | 8 | # Specifies the extended Nmap parameters. 9 | # Examples: 10 | # - params="--script ssl-ccs-injection -p 443" 11 | params="" 12 | 13 | # Specifies the default output type and path. 14 | # Examples: 15 | # - report="xml" 16 | report="" 17 | 18 | # Specifies the TOR connection. 19 | # Examples: 20 | # - tor="true" 21 | tor="" 22 | 23 | # Specifies the terminal type. 24 | # Examples: 25 | # - terminal="internal" 26 | terminal="internal" 27 | -------------------------------------------------------------------------------- /etc/sandmap-completion: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -o emacs 4 | 5 | function _tab_init() { 6 | 7 | READLINE_LINE="" 8 | READLINE_POINT=$(echo -en "${#READLINE_LINE}" ; echo) 9 | 10 | } 11 | 12 | bind -x '"\t":"_tab_init"' 13 | -------------------------------------------------------------------------------- /lib/cli_help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: cli_help() 7 | # 8 | # Description: 9 | # Show help in cli. 10 | # 11 | # Usage: 12 | # cli_help 13 | # 14 | # Examples: 15 | # cli_help 16 | # 17 | 18 | function cli_help() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="cli_help" 22 | local _STATE=0 23 | 24 | printf "%s" " 25 | Main Commands 26 | ------------- 27 | 28 | help show cli help or module help 29 | list show available modules 30 | show show info about modules and profiles 31 | config | show global or module configuration 32 | set | set global or module variable value 33 | use use module (changed env) 34 | pushd init|show|flush command line commands stack 35 | search search key in all commands 36 | 37 | reload reload all modules cache or configuration 38 | banner show banner 39 | 40 | nmap pure nmap engine 41 | 42 | Options: 43 | 44 | module name 45 | key value 46 | 47 | Module Commands 48 | --------------- 49 | 50 | help display module or NSE help 51 | show display module or profile info 52 | config show module configuration 53 | set set module variable value 54 | use reuse module (changed env) 55 | pushd |init|show|flush command line commands stack (experimental) 56 | search search key in all commands 57 | init [--args] run profile 58 | 59 | Examples 60 | -------- 61 | 62 | show sample show 'sample' module info 63 | config terminal show 'terminal' key value 64 | use sample use 'sample' module 65 | search http search 'http' in all commands 66 | 67 | " 68 | 69 | return $_STATE 70 | 71 | } 72 | -------------------------------------------------------------------------------- /lib/cli_show: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: cli_show() 7 | # 8 | # Description: 9 | # Show help in cli. 10 | # 11 | # Usage: 12 | # cli_show 13 | # 14 | # Examples: 15 | # cli_show 16 | # 17 | 18 | function cli_show() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="cli_show" 22 | local _STATE=0 23 | 24 | _module_commands_count=0 25 | _module_commands_count_all=0 26 | 27 | # shellcheck disable=SC2034,SC2154 28 | _static_menu="${_tmp}/.static.menu" 29 | 30 | # shellcheck disable=SC2154 31 | _modules_count=$(find "${_modules}" -name '*.mod' | wc -l) 32 | 33 | : >"${_static_menu}" 34 | 35 | printf "\\n\\e[1;38m %-25.25s %-12.12s %s\\e[m\\n %-25.25s %-12.12s %s\\n\\n" \ 36 | "Module" \ 37 | "Profiles" \ 38 | "Description" \ 39 | "------" \ 40 | "--------" \ 41 | "-----------" >> "${_static_menu}" 42 | 43 | # shellcheck disable=SC2154 44 | for i in "${modules_full_list[@]}" ; do 45 | 46 | _module_commands_count=0 47 | 48 | # shellcheck disable=SC2034 49 | _fname=$(echo "$i" | awk -v FS="(:|:)" '{print $1}') 50 | # shellcheck disable=SC2034 51 | _fpath=$(echo "$i" | awk -v FS="(:|:)" '{print $2}') 52 | 53 | # shellcheck disable=SC1090 54 | source "${_modules}/${_fpath}" 55 | 56 | # shellcheck disable=SC2034 57 | module_name="$_fname" 58 | 59 | "${_fname}" 60 | 61 | _module_commands_count=$((_module_commands_count + ${#_module_commands[*]})) 62 | _module_commands_count_all=$((_module_commands_count_all + _module_commands_count)) 63 | 64 | printf " \\e[1;36m%-25.25s\\e[m \\e[1;33m%-12.12s\\e[m %s\\n" \ 65 | "$_fname" "$_module_commands_count" "$description" >> "${_static_menu}" 66 | 67 | done 68 | 69 | printf "\\n %s: \\e[1;39m%s\\e[m\\n %s: \\e[1;39m%s\\e[m\\n\\n" \ 70 | "All Modules" "$_modules_count" \ 71 | "All Profiles" "$_module_commands_count_all" >> "${_static_menu}" 72 | 73 | cat "${_static_menu}" 74 | 75 | : >"${_static_menu}" 76 | 77 | return $_STATE 78 | 79 | } 80 | -------------------------------------------------------------------------------- /lib/init_cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | readonly __version="1.2.0" 6 | 7 | readonly __cli_prompt="cli" 8 | # shellcheck disable=SC2034 9 | __cli_banner="main" 10 | # shellcheck disable=SC2034 11 | _cli_state=0 12 | _in_module=0 13 | 14 | _motd_status=0 15 | 16 | _cmd_state=0 17 | 18 | # shellcheck disable=SC2034 19 | _ld_module="" 20 | # shellcheck disable=SC2034 21 | _mstate=0 22 | # shellcheck disable=SC2034 23 | _module_cfg="" 24 | 25 | # shellcheck disable=SC2034 26 | _pushd_stack=() 27 | 28 | export _session_variables=() 29 | export _variables_stack=() 30 | 31 | export _profiles_list=() 32 | 33 | # shellcheck disable=SC2034 34 | # Store xterm params (for external type of terminal). 35 | readonly _xterm="xterm -hold -fa monaco -fs 10 -bg black -e" 36 | 37 | readonly _und=$(tput smul) 38 | readonly _nound=$(tput rmul) 39 | readonly _bold=$(tput bold) 40 | readonly _normal=$(tput sgr0) 41 | 42 | 43 | # `````````````````````````````````````````````````````````````````````````````` 44 | # Function name: motd_cli() 45 | # 46 | # Description: 47 | # Message of the day. 48 | # 49 | # Usage: 50 | # motd_cli 51 | # 52 | # Examples: 53 | # motd_cli 54 | # 55 | 56 | function motd_cli() { 57 | 58 | # shellcheck disable=SC2034 59 | local _FUNCTION_ID="motd_cli" 60 | local _STATE=0 61 | 62 | tput cup 4 0 63 | printf "${_bold}\\e[1;30m%s\\e[m${_normal}" " 64 | _..__. .__.._ 65 | .^\"-.._ '-(\\__/)-' _..-\"^. 66 | '-.' " 67 | printf "${_bold}\\e[1;36m%s\\e[m${_normal}" \ 68 | "oo" 69 | printf "${_bold}\\e[1;30m%s\\e[m${_normal}" \ 70 | " '.-'" 71 | 72 | printf "${_bold}\\e[1;30m%s\\e[m${_normal}" " 73 | \`-..-'" 74 | 75 | tput cup 8 0 76 | printf "\\e[0;32m%s\\e[m" " 77 | _ 78 | / \\ _ 79 | , | | , / \\ 80 | ((_| |_)) , | | , 81 | \`--, ,--\` ((_| |_)) 82 | | | \`--, ,--\`" 83 | printf "\\e[1;33m%s\\e[m" " 84 | ^^^^" 85 | printf "\\e[0;32m%s\\e[m" "| |" 86 | printf "\\e[1;33m%s\\e[m" "^^^^^^^" 87 | printf "\\e[0;32m%s\\e[m" "| |" 88 | printf "\\e[1;33m%s\\e[m" "^^^^^^^ 89 | \`\"\"\"\`" 90 | printf "\\e[0;32m%s\\e[m" " | |" 91 | printf "\\e[1;33m%s\\e[m" " 92 | \`\"\"\"\`" 93 | 94 | _t=24 95 | 96 | tput cup 1 $((23 + _t)) ; printf "%s" " _______ __" 97 | tput cup 2 $((23 + _t)) ; printf "%s" "| __|.---.-.-----.--| |.--------.---.-.-----." 98 | tput cup 3 $((23 + _t)) ; printf "%s" "|__ || _ | | _ || | _ | _ |" 99 | tput cup 4 $((23 + _t)) ; printf "%s" "|_______||___._|__|__|_____||__|__|__|___._| __|" 100 | tput cup 5 $((66 + _t)) ; printf "%s" "|__|" 101 | 102 | tput cup 6 $((40 + _t)) ; printf "%s: \\e[3;36m%s\\e[m" "Author" "trimstray" 103 | tput cup 6 $((59 + _t)) ; printf "%s: \\e[3;36m%s\\e[m" "Version" "${__version}" 104 | 105 | tput cup 8 $((26 + _t)) ; printf "%s \\e[1;38m%s\\e[m" "Project:" "https://github.com/trimstray/sandmap" 106 | 107 | tput cup 10 $((26 + _t)) ; printf "%s" "This program comes with ABSOLUTELY NO WARRANTY." 108 | tput cup 11 $((26 + _t)) ; printf "%s" "This is free software, and you are welcome to redistribute it" 109 | tput cup 12 $((26 + _t)) ; printf "%s" "under certain conditions; for more details please see" 110 | tput cup 13 $((26 + _t)) ; printf "%s" "." 111 | 112 | tput cup 15 $((26 + _t)) ; printf "%s" "Hint:" 113 | tput cup 17 $((28 + _t)) ; printf "%s '${_und}\\e[1;38m%s\\e[m${_normal}' %s" \ 114 | "Try" "help" "to show all cli commands and start!" 115 | tput cup 20 0 116 | 117 | return $_STATE 118 | 119 | } 120 | 121 | # `````````````````````````````````````````````````````````````````````````````` 122 | # Function name: init_cli() 123 | # 124 | # Description: 125 | # Init sandmap cli. 126 | # 127 | # Usage: 128 | # init_cli 129 | # 130 | # Examples: 131 | # init_cli 132 | # 133 | 134 | function init_cli() { 135 | 136 | # shellcheck disable=SC2034 137 | local _FUNCTION_ID="init_cli" 138 | local _STATE=0 139 | 140 | if [[ "$_motd_status" -eq 0 ]] ; then 141 | 142 | motd_cli 143 | _motd_status=1 144 | 145 | fi 146 | 147 | # shellcheck disable=SC1090,SC2154 148 | source "${_cfg}/sandmap-completion" 149 | 150 | # shellcheck disable=SC2034 151 | local input_array=() 152 | 153 | while [[ "${input_array[0]}" != "exit" ]] ; do 154 | 155 | cstate="1" 156 | 157 | # shellcheck disable=SC2034 158 | _cmd_state="0" 159 | 160 | # shellcheck disable=SC2354 161 | # > or » 162 | _ansi_prompt=$(printf "\\e[1;38m%s\\e[m(\\e[0;38m%s\\e[m)\\e[4;32m>\\e[m " "${__cli_prompt}" "${__cli_banner}") 163 | read -r -p "$_ansi_prompt" -e -a input_array 164 | 165 | case ${input_array[0]} in 166 | 167 | clear) 168 | 169 | clear 170 | 171 | if [[ "$_cli_state" -eq 1 ]] ; then 172 | 173 | init_cli 174 | _cli_state=1 175 | 176 | else 177 | 178 | init_cli 179 | 180 | fi 181 | cstate="0" ;; 182 | 183 | main) 184 | 185 | # shellcheck disable=SC2034 186 | __cli_banner="main" 187 | # shellcheck disable=SC2034 188 | _in_module=0 189 | 190 | init_cli 191 | cstate="0" ;; 192 | 193 | banner) 194 | 195 | clear 196 | 197 | _motd_status=0 198 | motd_cli 199 | 200 | init_cli 201 | _motd_status=1 202 | 203 | cstate="0" ;; 204 | 205 | nmap) 206 | 207 | _init_cmd "${input_array[@]:1}" 208 | cstate="0" ;; 209 | 210 | exit) 211 | 212 | _exit_ 0 ;; 213 | 214 | "") 215 | 216 | echo -en "" 217 | cstate="0" ;; 218 | 219 | *) 220 | 221 | cli_distributor "${input_array[@]}" 222 | # shellcheck disable=SC2034 223 | cstate="0" 224 | 225 | ;; 226 | 227 | esac 228 | 229 | done 230 | 231 | return $_STATE 232 | 233 | } 234 | -------------------------------------------------------------------------------- /lib/init_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: init_config() 7 | # 8 | # Description: 9 | # Init configuration. 10 | # 11 | # Usage: 12 | # init_config 13 | # 14 | # Examples: 15 | # init_config 16 | # 17 | 18 | function init_config() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="init_config" 22 | local _STATE=0 23 | 24 | # shellcheck disable=SC2034,SC2154 25 | _config_file="${_cfg}/main.cfg" 26 | 27 | if [[ -e "$_config_file" ]] ; then 28 | 29 | # shellcheck disable=SC1090 30 | source "$_config_file" 31 | 32 | fi 33 | 34 | return $_STATE 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lib/init_module: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: init_module() 7 | # 8 | # Description: 9 | # Init modules. 10 | # 11 | # Usage: 12 | # init_module 13 | # 14 | # Examples: 15 | # init_module 16 | # 17 | 18 | export module_name="" 19 | export module_args="" 20 | export module_path="" 21 | 22 | function init_module() { 23 | 24 | # shellcheck disable=SC2034 25 | local _FUNCTION_ID="init_module" 26 | local _STATE=0 27 | 28 | # shellcheck disable=SC2034 29 | local _argv=("$@") 30 | 31 | # shellcheck disable=SC2154 32 | if [[ "$_in_module" -eq 0 ]] ; then 33 | 34 | # shellcheck disable=SC2034 35 | module_name="${_argv[1]}" 36 | # shellcheck disable=SC2034 37 | module_args=("${_argv[@]:2}") 38 | # shellcheck disable=SC2154 39 | module_path="${_modules}/${module_name}.mod" 40 | 41 | if [[ -e "${module_path}" ]] ; then 42 | 43 | # shellcheck disable=SC1090 44 | source "${module_path}" 45 | 46 | ${module_name} 47 | 48 | fi 49 | 50 | elif [[ "$_in_module" -eq 1 ]] ; then 51 | 52 | # shellcheck disable=SC2034 53 | module_name="$_ld_module" 54 | # shellcheck disable=SC2034 55 | module_args=("${_argv[@]:1}") 56 | # shellcheck disable=SC2154 57 | module_path="${_modules}/${module_name}.mod" 58 | 59 | if [[ -e "${module_path}" ]] ; then 60 | 61 | # shellcheck disable=SC1090 62 | source "${module_path}" 63 | 64 | ${module_name} 65 | 66 | fi 67 | 68 | else 69 | 70 | printf "stdout: %s\\n" "unknown command" 71 | 72 | fi 73 | 74 | return $_STATE 75 | 76 | } 77 | -------------------------------------------------------------------------------- /lib/init_search: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: init_search() 7 | # 8 | # Description: 9 | # Init search module. 10 | # 11 | # Usage: 12 | # init_search 13 | # 14 | # Examples: 15 | # init_search 16 | # 17 | 18 | function init_search() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="init_search" 22 | local _STATE=0 23 | 24 | local _spattern="$1" 25 | # shellcheck disable=SC2034 26 | local _search_stack=() 27 | 28 | _cr="-35.35" 29 | 30 | # shellcheck disable=SC2034,SC2154 31 | _static_menu="${_tmp}/.static.menu" 32 | 33 | : >"${_static_menu}" 34 | 35 | printf "\\n \\e[1;38m%-25.25s %${_cr}s %s\\e[m\\n %-25.25s %${_cr}s %s\\n\\n" \ 36 | "Module" \ 37 | "Alias" \ 38 | "Nmap Parameters" \ 39 | "------" \ 40 | "-----" \ 41 | "---------------" >> "${_static_menu}" 42 | 43 | # shellcheck disable=SC2154 44 | for _svar in "${_profiles_list[@]}" ; do 45 | 46 | # shellcheck disable=SC2034 47 | _key_alias=$(echo "$_svar" | awk -v FS="(;|;)" '{print $1}') 48 | # shellcheck disable=SC2034 49 | _key_cmd=$(echo "$_svar" | awk -v FS="(;|;)" '{print $2}') 50 | # shellcheck disable=SC2034 51 | _key_mod=$(echo "$_svar" | awk -v FS="(;|;)" '{print $3}') 52 | 53 | if [[ "$_key_alias" == *"$_spattern"* ]] ; then 54 | 55 | _search_stack+=("${_key_mod};${_key_alias};${_key_cmd}") 56 | 57 | printf " \\e[1;36m%-25.25s\\e[m \\e[1;34m%${_cr}s\\e[m %s\\n" \ 58 | "$_key_mod" \ 59 | "$_key_alias" \ 60 | "$_key_cmd" >> "${_static_menu}" 61 | 62 | elif [[ "$_key_cmd" == *"$_spattern"* ]] ; then 63 | 64 | _search_stack+=("${_key_mod};${_key_alias};${_key_cmd}") 65 | 66 | printf " \\e[1;36m%-25.25s\\e[m \\e[1;34m%${_cr}s\\e[m %s\\n" \ 67 | "$_key_mod" \ 68 | "$_key_alias" \ 69 | "$_key_cmd" >> "${_static_menu}" 70 | fi 71 | 72 | done 73 | 74 | unset _svar 75 | 76 | cat "${_static_menu}" 77 | 78 | echo 79 | 80 | : >"${_static_menu}" 81 | 82 | return $_STATE 83 | 84 | } 85 | -------------------------------------------------------------------------------- /lib/init_session: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: init_session() 7 | # 8 | # Description: 9 | # Init configuration file. 10 | # 11 | # Usage: 12 | # init_session 13 | # 14 | # Examples: 15 | # init_session 16 | # 17 | 18 | function init_session() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="init_session" 22 | local _STATE=0 23 | 24 | _session_variables=(\ 25 | "Destination;'127.0.0.1 example.com';dest;$_cmd_dest" \ 26 | "Global parameters;'-sV -p 443';params;$_cmd_params" \ 27 | "Report type;'nmap|xml|grep';report;$_cmd_report" \ 28 | "Pass through TOR;'true|false';tor;$_cmd_tor" \ 29 | "Terminal type;'internal|external';terminal;$_cmd_terminal") 30 | 31 | # shellcheck disable=SC2034 32 | _variables_stack=("${_session_variables[@]}") 33 | 34 | return $_STATE 35 | 36 | } 37 | -------------------------------------------------------------------------------- /lib/load_modules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: load_modules() 7 | # 8 | # Description: 9 | # Load modules. 10 | # 11 | # Usage: 12 | # load_modules 13 | # 14 | # Examples: 15 | # load_modules 16 | # 17 | 18 | function load_modules() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="load_modules" 22 | local _STATE=0 23 | 24 | _profiles_list=() 25 | 26 | _sprintf "head" "Please wait, loading modules..." 27 | 28 | # shellcheck disable=SC2154 29 | for i in $(find "${_modules}" -name '*.mod' -exec ls {} + | sort -k 10) ; do 30 | 31 | _fpath=$(basename "$i") 32 | # shellcheck disable=SC2034 33 | _fname=$(echo "$_fpath" | cut -d "." -f1) 34 | 35 | modules_list+=("$_fname") 36 | modules_full_list+=("$_fname":"$_fpath") 37 | 38 | # shellcheck disable=SC1090 39 | source "${_modules}/${_fpath}" 40 | 41 | ${_fname} 42 | 43 | for j in "${_module_commands[@]}" ; do 44 | 45 | # shellcheck disable=SC2034 46 | _key_alias=$(echo "$j" | awk -v FS="(;|;)" '{print $3}') 47 | # shellcheck disable=SC2034 48 | _key_cmd=$(echo "$j" | awk -v FS="(;|;)" '{print $4}') 49 | 50 | _profiles_list+=("${_key_alias};${_key_cmd};${_fname}") 51 | 52 | done 53 | 54 | done 55 | 56 | return $_STATE 57 | 58 | } 59 | -------------------------------------------------------------------------------- /lib/module_help: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: module_help() 7 | # 8 | # Description: 9 | # Show help in cli. 10 | # 11 | # Usage: 12 | # module_help 13 | # 14 | # Examples: 15 | # module_help 16 | # 17 | 18 | function module_help() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="module_help" 22 | local _STATE=0 23 | 24 | # shellcheck disable=SC2154 25 | printf "%s\\n\\n" "${_module_help[@]}" 26 | 27 | return $_STATE 28 | 29 | } 30 | -------------------------------------------------------------------------------- /lib/module_info: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: module_info() 7 | # 8 | # Description: 9 | # Show module info in cli. 10 | # 11 | # Usage: 12 | # module_info 13 | # 14 | # Examples: 15 | # module_info 16 | # 17 | 18 | function module_info() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="module_info" 22 | local _STATE=0 23 | 24 | printf "\\n \\e[1;38m%-20.20s %-10.10s %-10.10s %-20.20s %-25.25s\\e[m\\n %-20.20s %-10.10s %-10.10s %-20.20s %-25.25s\\n\\n" \ 25 | "Module" \ 26 | "Version" \ 27 | "Profiles" \ 28 | "Author" \ 29 | "Contact" \ 30 | "------" \ 31 | "-------" \ 32 | "--------" \ 33 | "------" \ 34 | "-------" \ 35 | 36 | # shellcheck disable=SC2154 37 | printf " %-20.20s %-10.10s %-10.10s %-20.20s %-25.25s\\n\\n" \ 38 | "${_module_show[0]}" \ 39 | "${_module_show[1]}" \ 40 | "${_module_show[2]}" \ 41 | "${_module_show[3]}" \ 42 | "${_module_show[4]}" 43 | 44 | return $_STATE 45 | 46 | } 47 | -------------------------------------------------------------------------------- /lib/module_show: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: module_show() 7 | # 8 | # Description: 9 | # Show help in cli. 10 | # 11 | # Usage: 12 | # module_show 13 | # 14 | # Examples: 15 | # module_show 16 | # 17 | 18 | function module_show() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="module_show" 22 | local _STATE=0 23 | 24 | local _marg="$1" 25 | 26 | _count=0 27 | 28 | _cr="-35.35" 29 | 30 | # shellcheck disable=SC2034,SC2154 31 | _static_menu="${_tmp}/.static.menu" 32 | 33 | : >"${_static_menu}" 34 | 35 | if [[ -z "$_marg" ]] ; then 36 | 37 | printf "\\n \\e[1;38m%-4.4s %${_cr}s %s\\e[m\\n %-4.4s %${_cr}s %s\\n\\n" \ 38 | "ID" \ 39 | "Alias" \ 40 | "Nmap Parameters" \ 41 | "--" \ 42 | "-----" \ 43 | "---------------" >> "${_static_menu}" 44 | 45 | fi 46 | 47 | # shellcheck disable=SC2034,SC2154 48 | for _svar in "${_module_commands[@]}" ; do 49 | 50 | # shellcheck disable=SC2034 51 | _key_desc=$(echo "$_svar" | awk -v FS="(;|;)" '{print $1}') 52 | # shellcheck disable=SC2034 53 | _key_comm=$(echo "$_svar" | awk -v FS="(;|;)" '{print $2}') 54 | # shellcheck disable=SC2034 55 | _key_alias=$(echo "$_svar" | awk -v FS="(;|;)" '{print $3}') 56 | # shellcheck disable=SC2034 57 | _key_cmd=$(echo "$_svar" | awk -v FS="(;|;)" '{print $4}') 58 | # shellcheck disable=SC2034 59 | _key_arg=$(echo "$_svar" | awk -v FS="(;|;)" '{print $5}') 60 | 61 | # shellcheck disable=SC2034 62 | IFS="," read -r -a _script_args <<< "$(sed 's/,\s+/???/g' <<< "$_key_arg")" 63 | 64 | if [[ "$_key_alias" == "$_marg" ]] ; then 65 | 66 | printf "\\n \\e[1;38m%-4.4s %${_cr}s %s\\e[m\\n %-4.4s %${_cr}s %s\\n\\n" \ 67 | "ID" \ 68 | "Alias" \ 69 | "Nmap Parameters" \ 70 | "--" \ 71 | "-----" \ 72 | "---------------" >> "${_static_menu}" 73 | 74 | printf " \\e[1;32m%-4.4s\\e[m \\e[1;34m%${_cr}s\\e[m %s\\n" \ 75 | "$_count" \ 76 | "$_key_alias" \ 77 | "$_key_cmd" >> "${_static_menu}" 78 | 79 | if [[ ! "${#_script_args[@]}" -eq 0 ]] ; then 80 | 81 | printf "\\n \\e[1;38m%s\\e[m:\\n\\n" "Script arguments" >> "${_static_menu}" 82 | 83 | for i in "${_script_args[@]}" ; do 84 | 85 | # shellcheck disable=SC2001 86 | _tmp_script_args=$(echo "${i}" | sed 's/^ *//g' | sed 's/???/\\n/g') 87 | 88 | if [[ "${_tmp_script_args}" == *"="* ]] ; then 89 | 90 | _a_arg=$(echo "${_tmp_script_args}" | tr -d '"' | cut -d "=" -f1) 91 | _b_arg=$(echo "${_tmp_script_args}" | tr -d '"' | cut -d "=" -f2) 92 | 93 | printf " %s = '\\e[1;33m%s\\e[m'\\n" "${_a_arg}" "${_b_arg}" >> "${_static_menu}" 94 | 95 | else 96 | 97 | _a_arg=$(echo "${_tmp_script_args}" | tr -d '"') 98 | 99 | printf " %s = ''\\n" "${_a_arg}" >> "${_static_menu}" 100 | 101 | fi 102 | 103 | done 104 | 105 | fi 106 | 107 | elif [[ -z "$_marg" ]] ; then 108 | 109 | printf " \\e[1;32m%-4.4s\\e[m \\e[1;34m%${_cr}s\\e[m %s\\n" \ 110 | "$_count" \ 111 | "$_key_alias" \ 112 | "$_key_cmd" >> "${_static_menu}" 113 | 114 | fi 115 | 116 | _count=$((_count + 1)) 117 | 118 | done 119 | 120 | cat "${_static_menu}" 121 | 122 | echo 123 | 124 | : >"${_static_menu}" 125 | 126 | return $_STATE 127 | 128 | } 129 | -------------------------------------------------------------------------------- /lib/set_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: set_config() 7 | # 8 | # Description: 9 | # Set config configuration. 10 | # 11 | # Usage: 12 | # set_config 13 | # 14 | # Examples: 15 | # set_config 16 | # 17 | 18 | function set_config() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="set_config" 22 | local _STATE=0 23 | 24 | # shellcheck disable=SC2034 25 | local _session_arg=("$@") 26 | local _session_key="${_session_arg[1]}" 27 | local _session_value="${_session_arg[*]:2}" 28 | 29 | # shellcheck disable=SC2154 30 | local _session_num="${#_variables_stack[@]}" 31 | local _acount=0 32 | local _bcount=0 33 | 34 | # shellcheck disable=SC2154 35 | for _svar in "${_variables_stack[@]}" ; do 36 | 37 | # shellcheck disable=SC2034 38 | _key_description=$(echo "$_svar" | awk -v FS="(;|;)" '{print $1}') 39 | # shellcheck disable=SC2034 40 | _key_values=$(echo "$_svar" | awk -v FS="(;|;)" '{print $2}') 41 | # shellcheck disable=SC2034 42 | _key_id=$(echo "$_svar" | awk -v FS="(;|;)" '{print $3}') 43 | # shellcheck disable=SC2034 44 | _key_var=$(echo "$_svar" | awk -v FS="(;|;)" '{print $4}') 45 | 46 | # For debug: 47 | # printf "%s , %s , %s , %s\n" \ 48 | # "_session_key: $_session_key" \ 49 | # "_key_description: $_key_description" \ 50 | # "_key_values: $_key_values" \ 51 | # "_key_id: $_key_id" \ 52 | # "_key_var: $_key_var" 53 | 54 | if [[ "$_key_id" == "$_session_key" ]] ; then 55 | 56 | # shellcheck disable=SC2034 57 | _key_var="$_session_value" 58 | 59 | _variables_stack[$_acount]="${_key_description};${_key_values};${_key_id};${_key_var}" 60 | 61 | else 62 | 63 | _bcount=$((_bcount + 1)) 64 | 65 | fi 66 | 67 | _acount=$((_acount + 1)) 68 | 69 | done 70 | 71 | if [[ "$_session_num" -eq "$_bcount" ]] ; then 72 | 73 | printf "stdout: %s\\n" "unknown key" 74 | 75 | fi 76 | 77 | return $_STATE 78 | 79 | } 80 | -------------------------------------------------------------------------------- /lib/show_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: show_config() 7 | # 8 | # Description: 9 | # Show config. 10 | # 11 | # Usage: 12 | # show_config 13 | # 14 | # Examples: 15 | # show_config 16 | # 17 | 18 | function show_config() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="show_config" 22 | local _STATE=0 23 | 24 | # shellcheck disable=SC2154 25 | if [[ "$session_type" == "main" ]] ; then 26 | 27 | local _session_arg="$2" 28 | 29 | elif [[ "$session_type" == "module" ]] ; then 30 | 31 | local _session_arg="$3" 32 | 33 | fi 34 | 35 | _break=0 36 | 37 | echo 38 | 39 | # shellcheck disable=SC2154 40 | for _svar in "${_variables_stack[@]}" ; do 41 | 42 | # shellcheck disable=SC2034 43 | _key_description=$(echo "$_svar" | awk -v FS="(;|;)" '{print $1}') 44 | # shellcheck disable=SC2034 45 | _key_values=$(echo "$_svar" | awk -v FS="(;|;)" '{print $2}') 46 | # shellcheck disable=SC2034 47 | _key_id=$(echo "$_svar" | awk -v FS="(;|;)" '{print $3}') 48 | # shellcheck disable=SC2034 49 | _key_var=$(echo "$_svar" | awk -v FS="(;|;)" '{print $4}') 50 | 51 | # For debug: 52 | # printf "%s , %s , %s , %s\n" \ 53 | # "_session_key: $_session_key" \ 54 | # "_key_description: $_key_description" \ 55 | # "_key_values: $_key_values" \ 56 | # "_key_id: $_key_id" \ 57 | # "_key_var: $_key_var" 58 | 59 | if [[ -z "$_key_id" ]] ; then 60 | 61 | printf "stdout: %s\\n" "invalid session param" 62 | 63 | fi 64 | 65 | # Show specific key. 66 | if [[ "$_session_arg" == "$_key_id" ]] ; then 67 | 68 | printf " Description: \\e[0;37m%s\\e[m\\n" \ 69 | "$_key_description" 70 | printf " Examples: \\e[0;37m%s\\e[m\\n" \ 71 | "$_key_values" 72 | printf " { \"\\e[0;38m%s\\e[m\":\"\\e[1;36m%s\\e[m\" }\\n\\n" \ 73 | "$_key_id" \ 74 | "$_key_var" 75 | 76 | _break=1 77 | 78 | elif [[ "$_break" -eq 0 ]] ; then 79 | 80 | # Show all keys. 81 | if [[ -z "$_session_arg" ]] ; then 82 | 83 | printf " Description: \\e[0;37m%s\\e[m\\n" \ 84 | "$_key_description" 85 | printf " Examples: \\e[0;37m%s\\e[m\\n" \ 86 | "$_key_values" 87 | printf " { \"\\e[0;38m%s\\e[m\":\"\\e[1;36m%s\\e[m\" }\\n\\n" \ 88 | "$_key_id" \ 89 | "$_key_var" 90 | 91 | fi 92 | 93 | fi 94 | 95 | done 96 | 97 | return $_STATE 98 | 99 | } 100 | -------------------------------------------------------------------------------- /log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trimstray/sandmap/5be99d4f225d7c703d0bfbd283b381a4758e0950/log/.gitkeep -------------------------------------------------------------------------------- /setup.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | readonly _dir="$(dirname "$(readlink -f "$0")")" 4 | 5 | # shellcheck disable=SC2034 6 | _arg="$1" 7 | 8 | if [[ "$1" == "install" ]] ; then 9 | 10 | printf "%s\\n" "Create symbolic link to /usr/local/bin" 11 | 12 | if [[ -e "${_dir}/bin/sandmap" ]] ; then 13 | 14 | if [[ ! -e "/usr/local/bin/sandmap" ]] ; then 15 | 16 | ln -s "${_dir}/bin/sandmap" /usr/local/bin 17 | 18 | fi 19 | 20 | fi 21 | 22 | printf "%s\\n" "Create man page to /usr/local/man/man8" 23 | 24 | if [[ -e "${_dir}/static/man8/sandmap.8" ]] ; then 25 | 26 | if [[ ! -e "/usr/local/man/man8/sandmap.8.gz" ]] ; then 27 | 28 | mkdir -p /usr/local/man/man8 29 | cp "${_dir}/static/man8/sandmap.8" /usr/local/man/man8 30 | gzip /usr/local/man/man8/sandmap.8 31 | 32 | fi 33 | 34 | fi 35 | 36 | elif [[ "$1" == "uninstall" ]] ; then 37 | 38 | printf "%s\\n" "Remove symbolic link from /usr/local/bin" 39 | 40 | if [[ -L "/usr/local/bin/sandmap" ]] ; then 41 | 42 | unlink /usr/local/bin/sandmap 43 | 44 | fi 45 | 46 | printf "%s\\n" "Remove man page from /usr/local/man/man8" 47 | 48 | if [[ -e "/usr/local/man/man8/sandmap.8.gz" ]] ; then 49 | 50 | rm /usr/local/man/man8/sandmap.8.gz 51 | 52 | fi 53 | 54 | fi 55 | 56 | exit 0 57 | -------------------------------------------------------------------------------- /src/__init__: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | ################################################################################ 6 | ######################### Main function (script init) ########################## 7 | ################################################################################ 8 | 9 | function __main__() { 10 | 11 | local _FUNCTION_ID="__main__" 12 | local _STATE="0" 13 | 14 | # Stores the current date. 15 | readonly _cdate=$(date +%Y%m%d) 16 | 17 | # Variables related to the log file. Divided into three parts due 18 | # to the better possibility of manipulation for the user. 19 | # shellcheck disable=SC2154 20 | readonly _log_directory="${_rel}/log" 21 | # shellcheck disable=SC2154 22 | readonly _log_file="${_init_name}.${_cdate}.log" 23 | readonly _log_stdout="${_log_directory}/stdout.log" 24 | readonly _log_path="${_log_directory}/${_log_file}" 25 | 26 | # We check if we are a root user. 27 | if [[ "$EUID" -ne 0 ]] ; then 28 | 29 | printf "EUID is not equal 0 (no root user)\\n" 30 | _exit_ "1" 31 | 32 | fi 33 | 34 | # Path to import file. 35 | # shellcheck disable=SC2154 36 | readonly _import_path="${_src}/import" 37 | 38 | # Path to modules directory. 39 | # shellcheck disable=SC2034,SC2154 40 | readonly _modules="${_dat}/modules" 41 | 42 | # Store modules list. 43 | # shellcheck disable=SC2034 44 | modules_list=() 45 | # shellcheck disable=SC2034 46 | modules_full_list=() 47 | # shellcheck disable=SC2034 48 | _module_commands_count=0 49 | # shellcheck disable=SC2034 50 | _module_commands_count_all=0 51 | 52 | # External configuration file (-c|--config script param). 53 | config="" 54 | load_state="0" 55 | 56 | # Declaration of output variables (--debug and --verbose params). 57 | stdout_mode="" 58 | printf_mode="" 59 | # Enable/disable output colors. 60 | # shellcheck disable=SC2034 61 | s_color="true" 62 | 63 | # Declaration of total execution time. 64 | time_tracking="false" 65 | time_mode="0" 66 | export _cmdtime_state="0" 67 | 68 | # We place here used commands at script runtime, as strings to anything 69 | # unnecessarily run. 70 | readonly commands=("basename" "dirname" "stat" "date" "grep" "egrep" "cut" \ 71 | "sed" "gzip" "tar" "nmap" "xterm" "proxychains") 72 | 73 | # If you intend to specify the full path to the command we do it like: 74 | # readonly exec_gzip="/bin/gzip" 75 | 76 | # Stores the names of the missing commands. 77 | missing_hash=() 78 | missing_counter="0" 79 | 80 | for i in "${commands[@]}" ; do 81 | 82 | if [[ ! -z "$i" ]] ; then 83 | 84 | hash "$i" >/dev/null 2>&1 ; state="$?" 85 | 86 | # If the command was not found put it in the array 87 | if [[ "$state" -ne 0 ]] ; then 88 | 89 | missing_hash+=("$i") 90 | ((missing_counter++)) 91 | 92 | fi 93 | 94 | fi 95 | 96 | done 97 | 98 | # It is a good idea to terminate the script at this stage 99 | # with information for the user to fix the errors if at least one 100 | # of the required commands in the commands array is not found. 101 | if [[ "$missing_counter" -gt 0 ]] ; then 102 | 103 | printf "not found in PATH: %s\\n" "${missing_hash[*]}" >&2 104 | _exit_ "1" 105 | 106 | fi 107 | 108 | if [[ "$time_tracking" == "true" ]] ; then 109 | _begtime=$(date +%s) ; fi 110 | 111 | # shellcheck disable=SC2154 112 | _logger "init" \ 113 | "init '${_init_name}' in '${_init_directory}'" && \ 114 | _logger "info" \ 115 | "__init_params[] = (${__init_params[*]})," \ 116 | "__script_params[] = (${__script_params[*]})" 117 | 118 | # Include import file. 119 | _load "null" "$_import_path" 120 | 121 | # Specifies the call parameters of the script, the exact description 122 | # can be found in _help_ and file README.md. 123 | local _short_opt="" 124 | local _long_opt="help" 125 | 126 | _GETOPT_PARAMS=$(getopt -o "${_short_opt}" --long "${_long_opt}" \ 127 | -n "${_init_name}" -- "${__script_params[@]}") 128 | 129 | # With this structure, in the case of problems with the parameters placed 130 | # in the _GETOPT_PARAMS variable we finish the script. Keep this in mind 131 | # because it has some consequences - the __main __() function will not be 132 | # executed. 133 | 134 | # Ends an error if the parameter or its argument is not valid. 135 | _getopt_state="$?" 136 | if [ "$_getopt_state" != 0 ] ; then 137 | _exit_ "1" 138 | fi 139 | 140 | eval set -- "$_GETOPT_PARAMS" 141 | while true ; do 142 | 143 | case $1 in 144 | 145 | --help) 146 | 147 | _help_ 148 | 149 | shift ; _exit_ "0" ;; 150 | 151 | *) 152 | 153 | if [[ "$2" == "-" ]] || [[ ! -z "$2" ]] ; then 154 | 155 | printf "%s: invalid option -- '%s'\\n" "$_init_name" "$2" 156 | _exit_ "1" 157 | 158 | # elif [[ -z "$2" ]] ; then break ; fi 159 | else break ; fi 160 | 161 | ;; 162 | 163 | esac 164 | 165 | done 166 | 167 | # If you run the script in debug mode, the information 168 | # will be displayed on the screen from this point. 169 | if [[ "$stdout_mode" == "debug" ]] ; then 170 | 171 | _logger "info" \ 172 | "${_FUNCTION_ID}()" \ 173 | "starting debug mode" 174 | 175 | fi 176 | 177 | # Running tasks before start user functions. 178 | _before_init 179 | 180 | ################################# USER SPACE ################################# 181 | # ```````````````````````````````````````````````````````````````````````````` 182 | # Put here all your variable declarations, function calls 183 | # and all the other code blocks. 184 | 185 | # In this section we add external file (for -c|--config script param). 186 | if [[ "$load_state" -eq 1 ]] ; then _load "head" "$config" ; fi 187 | 188 | # shellcheck disable=SC2034 189 | # Generate random value. 190 | _random=$(date +"%s") 191 | 192 | # Array that stores the names of variables used that are part of the script 193 | # call parameters (_GETOPT_PARAMS). Useful when checking whether all 194 | # or selected parameters without which the script can not work properly 195 | # have been used. Do not add the load_state variable to the _opt_values array, 196 | # which is supported above. 197 | _opt_values=() 198 | 199 | # Checking the value of the variables (if they are unset or empty): 200 | # - variables for call parameters 201 | # - variables from the additional configuration files 202 | if [[ "${#_opt_values[@]}" -ne 0 ]] ; then 203 | 204 | for i in "${_opt_values[@]}" ; do 205 | 206 | _i="" ; eval _i='$'"$i" 207 | 208 | _logger "info" \ 209 | "${_FUNCTION_ID}()" \ 210 | "$i: '$_i'" 211 | 212 | if [[ -z "$_i" ]] ; then 213 | 214 | _sprintf "stop" "error of argument value: '$i' is unset or empty" 215 | 216 | _logger "stop" \ 217 | "${_FUNCTION_ID}()" \ 218 | "error of argument value: '$i' is unset or empty" 219 | 220 | fi 221 | 222 | done 223 | 224 | fi 225 | 226 | # Only if you used --time, --verbose and --debug script parameters 227 | # - checking the relationship between call parameters. 228 | if [[ "$time_mode" -eq 1 ]] ; then 229 | 230 | if [[ "$printf_mode" != "verbose" ]] ; then 231 | 232 | _sprintf "stop" "missing argument: '--time' is dependent on '--verbose'" 233 | 234 | _logger "stop" \ 235 | "${_FUNCTION_ID}()" \ 236 | "missing argument: '--time' occurs only with '--verbose'" 237 | 238 | fi 239 | 240 | elif [[ "$stdout_mode" == "debug" ]] ; then 241 | 242 | if [[ "$printf_mode" == "verbose" ]] || [[ "$time_mode" -eq 1 ]] ; then 243 | 244 | _sprintf "stop" "debug mode can not occur together with '--verbose' and '--time'" 245 | 246 | _logger "stop" \ 247 | "${_FUNCTION_ID}()" \ 248 | "debug mode can not occur together with '--verbose' and '--time'" 249 | 250 | fi 251 | 252 | fi 253 | 254 | export _cmd_dest 255 | export _cmd_params 256 | export _cmd_report 257 | export _cmd_tor 258 | export _cmd_terminal 259 | 260 | # Initialize configuration. 261 | init_config 262 | 263 | # shellcheck disable=SC2154 264 | _cmd_dest="$dest" 265 | # shellcheck disable=SC2154 266 | _cmd_params="$params" 267 | # shellcheck disable=SC2154 268 | _cmd_report="$report" 269 | # shellcheck disable=SC2154 270 | _cmd_tor="$tor" 271 | # shellcheck disable=SC2154 272 | _cmd_terminal="$terminal" 273 | 274 | init_session 275 | 276 | # Initialize modules. 277 | load_modules 278 | 279 | # Initialize cli. 280 | clear 281 | init_cli 282 | 283 | # ```````````````````````````````````````````````````````````````````````````` 284 | 285 | if [[ "$time_tracking" == "true" ]] ; then 286 | 287 | # Counting the execution time. 288 | _endtime=$(date +%s) 289 | _totaltime=$((_endtime - _begtime)) 290 | 291 | # Print time header. 292 | printf '\e[m\e[1;39mTOTAL TIME: %dh:%dm:%ds\e[m\n' \ 293 | $((_totaltime/3600)) $((_totaltime%3600/60)) $((_totaltime%60)) 294 | 295 | fi 296 | 297 | return "$_STATE" 298 | 299 | } 300 | -------------------------------------------------------------------------------- /src/import: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | ################################################################################ 6 | #################### External variables/functions and libs ##################### 7 | ################################################################################ 8 | 9 | # Set of external files with variables, functions and other. The configuration 10 | # of each of them is in lib directory. The fd_stack array stores the names of 11 | # attached files. If you create a new file with some interesting function, 12 | # name it appropriately and insert to the array. 13 | # Example: 14 | # - lib/kill_process - file with your function 15 | # - _fd_stack=("kill_process") - says to include this file in the script 16 | readonly _fd_stack=(init_config init_session load_modules init_cli \ 17 | cli_distributor cli_help cli_show init_module \ 18 | module_help module_show module_info show_config \ 19 | set_config init_search) 20 | 21 | if [[ "${#_fd_stack[@]}" -ne 0 ]] ; then 22 | 23 | for _fd in "${_fd_stack[@]}" ; do 24 | 25 | # shellcheck disable=SC2154 26 | _fd_full_path="${_lib}/${_fd}" 27 | 28 | if [[ ! -z "$_fd_full_path" ]] && [[ -e "$_fd_full_path" ]] ; then 29 | 30 | # If the file exists is loaded. 31 | # shellcheck disable=SC1090 32 | source "$_fd_full_path" 33 | 34 | elif [[ -z "$_fd_full_path" ]] ; then 35 | 36 | printf "incorrectly loaded '%s' file (incorrect filename)" "$_fd_full_path" 37 | _exit_ "1" 38 | 39 | else 40 | 41 | printf "incorrectly loaded '%s' file (does not exist?)" "$_fd_full_path" 42 | _exit_ "1" 43 | 44 | fi 45 | 46 | done 47 | 48 | fi 49 | -------------------------------------------------------------------------------- /src/settings: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | ################################################################################ 6 | ################## The configuration parameters of the script ################## 7 | ################################################################################ 8 | 9 | # Bash 'Strict Mode': 10 | # errexit - exit the script if any statement returns a non-true return value 11 | # pipefail - exit the script if any command in a pipeline errors 12 | # nounset - exit the script if you try to use an uninitialised variable 13 | # xtrace - display debugging information 14 | set -o pipefail 15 | 16 | # Internal field separator (more flexible): 17 | # IFS_ORIG="$IFS" 18 | # IFS_HACK=$'\n\t' 19 | # IFS="$IFS_HACK" 20 | 21 | # PATH env variable setup: 22 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 23 | 24 | # Setting permissions in the script environment: 25 | # 0022 - less restrictive settings (default value) 26 | # 0027 - for better security than above 27 | # 0077 - only for user access (more restrictive) 28 | umask 0027 29 | 30 | # Catch the listed SIGNALS, which may be signal names with or without the SIG 31 | # prefix, or signal numbers. By default, only the signal 0 or EXIT is supported. 32 | trap "_get_trap_SIG EXIT" EXIT 33 | 34 | # shellcheck disable=SC2173 35 | trap "_get_trap_SIG SIGS" SIGHUP SIGTERM SIGKILL SIGINT 36 | 37 | # Set properly terminal size if you use X-Session. 38 | _rows=44 ; _cols=180 39 | if [ ! -z "${DISPLAY:-}" ]; then resize -s "$_rows" "$_cols" > /dev/null ; fi 40 | -------------------------------------------------------------------------------- /static/img/sandmap_blackarch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trimstray/sandmap/5be99d4f225d7c703d0bfbd283b381a4758e0950/static/img/sandmap_blackarch.png -------------------------------------------------------------------------------- /static/man8/sandmap.8: -------------------------------------------------------------------------------- 1 | .\" Manpage for sandmap. 2 | .\" Contact trimstray@gmail.com. 3 | .TH man 8 "14.03.2018" "1.2.0" "sandmap man page" 4 | .SH NAME 5 | Sandmap \- supporting network and system reconnaissance 6 | .SH SYNOPSIS 7 | sandmap 8 | .SH DESCRIPTION 9 | A tool supporting network and system reconnaissance using the massive Nmap engine. It provides a user-friendly interface, automates and speeds up scanning, and allows you to easily use many advanced scanning techniques. 10 | .SH OPTIONS 11 | --help 12 | show this message 13 | 14 | --debug 15 | displays information on the screen (debug mode) 16 | 17 | --verbose 18 | displays 'info' messages on the screen (verbose mode) 19 | 20 | --time 21 | displays execution time, occurs only with --verbose 22 | 23 | -c, --config 24 | attach an external config file to the script 25 | .SH SEE ALSO 26 | https://github.com/trimstray/sandmap 27 | .SH BUGS 28 | No known bugs. 29 | .SH AUTHOR 30 | trimstray (trimstray@gmail.com) 31 | -------------------------------------------------------------------------------- /templates/sample.cfg: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # Specifies the default destination. 4 | # Examples: 5 | # - dest="127.0.0.1,8.8.8.8" 6 | dest="127.0.0.1" 7 | 8 | # Specifies the extended Nmap parameters. 9 | # Examples: 10 | # - params="--script ssl-ccs-injection -p 443" 11 | params="" 12 | 13 | # Specifies the default output type and path. 14 | # Examples: 15 | # - report="xml" 16 | report="" 17 | 18 | # Specifies the TOR connection. 19 | # Examples: 20 | # - tor="true" 21 | tor="" 22 | 23 | # Specifies the terminal type. 24 | # Examples: 25 | # - terminal="internal" 26 | terminal="internal" 27 | -------------------------------------------------------------------------------- /templates/sample.mod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck shell=bash 4 | 5 | # `````````````````````````````````````````````````````````````````````````````` 6 | # Function name: sample() 7 | # 8 | # Description: 9 | # Sample module template. 10 | # 11 | # Usage: 12 | # sample 13 | # 14 | # Examples: 15 | # sample 16 | # 17 | 18 | function sample() { 19 | 20 | # shellcheck disable=SC2034 21 | local _FUNCTION_ID="sample" 22 | local _STATE=0 23 | 24 | # User variables: 25 | # - module_name: store module name 26 | # - module_args: store module arguments 27 | 28 | export _module_show= 29 | export _module_help= 30 | export _module_opts= 31 | export _module_commands= 32 | 33 | # shellcheck disable=SC2034 34 | _module_variables=() 35 | 36 | # shellcheck disable=SC2034 37 | author="" 38 | contact="" 39 | description="Sample module template" 40 | 41 | # shellcheck disable=SC2034,SC2154 42 | _module_cfg="${_modules}/${module_name}.cfg" 43 | 44 | touch "$_module_cfg" 45 | 46 | # shellcheck disable=SC2034,SC2154 47 | _module_help=$(printf "%s: \\e[1;32m%s\\e[m" " 48 | Module" "${module_name}") 49 | 50 | _module_help+=$(printf "%s" " 51 | 52 | Description 53 | ----------- 54 | 55 | Sample predefined commands. 56 | 57 | Commands 58 | -------- 59 | 60 | help display module or NSE help 61 | show display module or profile info 62 | config show module configuration 63 | set set module variable value 64 | use reuse module (changed env) 65 | pushd |init|show|flush command line commands stack 66 | search search key in all commands 67 | init [--args] run profile 68 | 69 | Options: 70 | 71 | key value 72 | profile alias or id 73 | 74 | ") 75 | 76 | # shellcheck disable=SC2154 77 | if [[ "$_mstate" -eq 0 ]] ; then 78 | 79 | if [[ -e "$_module_cfg" ]] && [[ -s "$_module_cfg" ]] ; then 80 | 81 | # shellcheck disable=SC1090 82 | source "$_module_cfg" 83 | 84 | else 85 | 86 | # shellcheck disable=SC2034 87 | _module_variables=() 88 | 89 | if [[ "${#_module_variables[@]}" -ne 0 ]] ; then 90 | 91 | printf "_module_variables=(\"%s\")\\n" "${_module_variables[@]}" > "$_module_cfg" 92 | 93 | fi 94 | 95 | _mstate=1 96 | 97 | fi 98 | 99 | else 100 | 101 | # shellcheck disable=SC1090 102 | source "$_module_cfg" 103 | 104 | fi 105 | 106 | # In the given commands you can use variables from the CLI config 107 | # command or the etc/main.cfg file. 108 | 109 | # shellcheck disable=SC2034 110 | _module_commands=(\ 111 | # 112 | # "Intense scan;\ 113 | # ;intense;-T4 -A -v" \ 114 | # 115 | "Short module description;\ 116 | ;sample_scan;" \ 117 | ) 118 | 119 | # shellcheck disable=SC2034,SC2154 120 | _module_show=(\ 121 | "${module_name}" \ 122 | "${#_module_commands[@]}" \ 123 | "${author}" \ 124 | "${contact}" \ 125 | "${description}" \ 126 | ) 127 | 128 | # shellcheck disable=SC2034 129 | export _module_opts=(\ 130 | "$_module_help") 131 | 132 | return $_STATE 133 | 134 | } 135 | -------------------------------------------------------------------------------- /tmp/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/trimstray/sandmap/5be99d4f225d7c703d0bfbd283b381a4758e0950/tmp/.gitkeep --------------------------------------------------------------------------------