├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── pull_request_template.md
└── workflows
│ ├── label.yml
│ └── stale.yml
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── conf
├── conf.py
├── requirements.txt
└── version.txt
├── install.sh
├── modules
├── dirsearchscan.py
├── exit.py
├── fullscan.py
├── niktoscan.py
└── nmapscan.py
└── webmap.py
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | (Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.)
2 |
3 | What does this implement/fix? Explain your changes.
4 | ---------------------------------------------------
5 | …
6 |
7 | Does this close any currently open issues?
8 | ------------------------------------------
9 | …
10 |
11 |
12 | Any relevant logs, error output, etc?
13 | -------------------------------------
14 | …
15 |
16 |
17 | Any other comments?
18 | -------------------
19 | …
20 |
21 | Where has this been tested?
22 | ---------------------------
23 | **Operating System:** …
24 |
25 | **Platform:** …
26 |
27 | **Target Platform:** …
28 |
29 | **Python Version:** …
30 |
--------------------------------------------------------------------------------
/.github/workflows/label.yml:
--------------------------------------------------------------------------------
1 | # This workflow will triage pull requests and apply a label based on the
2 | # paths that are modified in the pull request.
3 | #
4 | # To use this workflow, you will need to set up a .github/labeler.yml
5 | # file with configuration. For more information, see:
6 | # https://github.com/actions/labeler
7 |
8 | name: Labeler
9 | on: [pull_request]
10 |
11 | jobs:
12 | label:
13 |
14 | runs-on: ubuntu-latest
15 |
16 | steps:
17 | - uses: actions/labeler@v2
18 | with:
19 | repo-token: "${{ secrets.GITHUB_TOKEN }}"
20 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: Mark stale issues and pull requests
2 |
3 | on:
4 | schedule:
5 | - cron: "30 1 * * *"
6 |
7 | jobs:
8 | stale:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/stale@v3
14 | with:
15 | repo-token: ${{ secrets.GITHUB_TOKEN }}
16 | stale-issue-message: 'Stale issue message'
17 | stale-pr-message: 'Stale pull request message'
18 | stale-issue-label: 'no-issue-activity'
19 | stale-pr-label: 'no-pr-activity'
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | **/__pycache__/
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4 |
5 | ### [1.0.5](https://github.com/Anteste/WebMap/compare/v1.0.4...v1.0.5) (2021-01-13)
6 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Request for contributions
2 |
3 | Please contribute to this repository if any of the following is true:
4 | - You have expertise in community development, communication, or education
5 | - You want open source communities to be more collaborative and inclusive
6 | - You want to help lower the burden to first time contributors
7 |
8 | # How to contribute
9 |
10 | Prerequisites:
11 |
12 | - Familiarity with [pull requests](https://help.github.com/articles/using-pull-requests) and [issues](https://guides.github.com/features/issues/).
13 | - Knowledge of [Markdown](https://help.github.com/articles/markdown-basics/) for editing `.md` documents.
14 |
15 | In particular, this community seeks the following types of contributions:
16 |
17 | - **Ideas**: participate in an issue thread or start your own to have your voice
18 | heard.
19 | - **Resources**: submit a pull request to add to RESOURCES.md with links to related content.
20 | - **Outline sections**: help us ensure that this repository is comprehensive. if
21 | there is a topic that is overlooked, please add it, even if it is just a stub
22 | in the form of a header and single sentence. Initially, most things fall into
23 | this category.
24 | - **Writing**: contribute your expertise in an area by helping us expand the included
25 | content.
26 | - **Copy editing**: fix typos, clarify language, and generally improve the quality
27 | of the content.
28 | - **Formatting**: help keep content easy to read with consistent formatting.
29 |
30 | # Conduct
31 |
32 | We are committed to providing a friendly, safe and welcoming environment for
33 | all, regardless of gender, sexual orientation, disability, ethnicity, religion,
34 | or similar personal characteristic.
35 |
36 | Please be kind and courteous. There's no need to be mean or rude.
37 | Respect that people have differences of opinion and that every design or
38 | implementation choice carries a trade-off and numerous costs. There is seldom
39 | a right answer, merely an optimal answer given a set of values and
40 | circumstances.
41 |
42 | Please keep unstructured critique to a minimum. If you have solid ideas you
43 | want to experiment with, make a fork and see how it works.
44 |
45 | We will exclude you from interaction if you insult, demean or harass anyone.
46 | That is not welcome behaviour. We interpret the term "harassment" as
47 | including the definition in the
48 | [Citizen Code of Conduct](http://citizencodeofconduct.org/);
49 | if you have any lack of clarity about what might be included in that concept,
50 | please read their definition. In particular, we don't tolerate behavior that
51 | excludes people in socially marginalized groups.
52 |
53 | Private harassment is also unacceptable. No matter who you are, if you feel
54 | you have been or are being harassed or made uncomfortable by a community
55 | member, please contact one of the channel ops or any of the
56 | [CONTRIBUTING.md](https://github.com/jden/CONTRIBUTING.md) core team
57 | immediately. Whether you're a regular contributor or a newcomer, we care about
58 | making this community a safe place for you and we've got your back.
59 |
60 | Likewise any spamming, trolling, flaming, baiting or other attention-stealing
61 | behaviour is not welcome.
62 |
63 | # Communication
64 |
65 | GitHub issues are the primary way for communicating about specific proposed
66 | changes to this project.
67 |
68 | In both contexts, please follow the conduct guidelines above. Language issues
69 | are often contentious and we'd like to keep discussion brief, civil and focused
70 | on what we're actually doing, not wandering off into too much imaginary stuff.
71 |
72 | # Frequently Asked Questions
73 |
74 | *Comming soom*
75 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Iliass Alami Qammouri
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 📡 WebMap
2 | [](https://www.python.org/)
3 | A Python tool used to automate the execution of the following tools : Nmap , Nikto and Dirsearch but also to automate the report generation during a Web Penetration Testing
4 | * Perform A Network Scan using Nmap
5 | * Perform A Vulnerabity Scan Using Nikto
6 | * Perform A Directory Busting using Using Dirsearch
7 | * Generate Reports
8 | * Automate Web Penetration Using WebMap
9 | * Tested on Linux and Unix with Python 3
10 | ------------------------------------
11 |
12 |
13 |
14 |
15 | ## 🛠 Installation
16 | ### Linux & Unix
17 | ```
18 | $ git clone https://github.com/Anteste/WebMap.git
19 | $ cd WebMap
20 | $ ./install.sh
21 | $ webmap
22 | ```
23 |
24 | # ✨ Other
25 | * This project is free and open source, under the [MIT](./LICENSE).
26 | * You can contribute to this project by proposing pull requests.
27 |
--------------------------------------------------------------------------------
/conf/conf.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import os
10 | import socket
11 | import sys
12 |
13 | import requests
14 | from art import *
15 | from termcolor import colored
16 |
17 | from modules.dirsearchscan import dirsearch_scan
18 | from modules.exit import exit
19 | from modules.fullscan import full_scan
20 | from modules.niktoscan import nikto_scan
21 | from modules.nmapscan import nmap_scan
22 |
23 | ans = True
24 | version = "1.0.7"
25 | home = os.path.expanduser("~")
26 |
27 |
28 | def re_open():
29 | installed = True if os.path.exists("/usr/local/bin/webmap") else False
30 |
31 | if installed:
32 | os.system("sudo webmap")
33 | sys.exit()
34 |
35 | else:
36 | os.system("sudo python3 webmap.py")
37 | sys.exit(())
38 |
39 |
40 | def clear():
41 | os.system("cls" if os.name == "nt" else "clear")
42 |
43 |
44 | def create_dir(directory):
45 | if not os.path.exists(directory):
46 | os.makedirs(directory)
47 |
48 |
49 | def not_valid(func, var, num=1):
50 | num = True
51 | if num == True:
52 | if len(var) <= 5:
53 | clear()
54 |
55 | print(
56 | colored("\nNot Valid Choice Try again\n",
57 | "red",
58 | attrs=["reverse"]))
59 | func()
60 | else:
61 | clear()
62 |
63 | print(
64 | colored("\nNot Valid Choice Try again\n", "red",
65 | attrs=["reverse"]))
66 | func()
67 |
68 |
69 | def dir_output(var, path, url):
70 | if len(var) == 0:
71 | var = path + "/" + url
72 | return var
73 |
74 |
75 | def call_def(func, num=1):
76 | if num == True:
77 | clear()
78 | ans = True
79 | while ans:
80 | func()
81 | else:
82 | clear()
83 | func()
84 |
85 |
86 | def ver_check():
87 | ver_url = "https://raw.githubusercontent.com/Anteste/WebMap/master/conf/version.txt"
88 | try:
89 | ver_rqst = requests.get(ver_url)
90 | ver_sc = ver_rqst.status_code
91 | if ver_sc == 200:
92 | github_ver = ver_rqst.text
93 | github_ver = github_ver.strip()
94 |
95 | if version == github_ver:
96 | print(
97 | colored(
98 | "Your WebMap version is Up-To-Date\n",
99 | "yellow",
100 | attrs=["reverse"],
101 | ))
102 | else:
103 | print(
104 | colored(
105 | f"Your WebMap version is Out-Dated, New _version Available: {format(github_ver)} \n",
106 | "red",
107 | attrs=["reverse"],
108 | ))
109 | else:
110 | print("[ Status : {} ".format(ver_sc) + "]" + "\n")
111 | except Exception as e:
112 | print("\n" + "[-] Exception : " + str(e))
113 |
--------------------------------------------------------------------------------
/conf/requirements.txt:
--------------------------------------------------------------------------------
1 | requests<=2.25.1
2 | art<=5.1
3 | termcolor<=1.1.0
--------------------------------------------------------------------------------
/conf/version.txt:
--------------------------------------------------------------------------------
1 | 1.0.7
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | DEPENDENCIES="nmap nikto git python3-pip"
10 |
11 | # Verify the OS witch is using and install on the right one
12 | if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then ##If need more distributions just add more
13 | sudo apt-get install $DEPENDENCIES -y
14 | elif [ "$(grep -Ei 'redhat|centos' /etc/*release)" ]; then ##To install on RPM CentOS/RedHat
15 | os_version=$(cut -d ':' -f5 < /etc/system-release-cpe)
16 | if [ "$os_version" == 8 ]; then
17 | sudo dnf install https://extras.getpagespeed.com/release-el8-latest.rpm -y
18 | sudo dnf install $DEPENDENCIES -y
19 | elif [ "$os_version" == 7 ]; then
20 | sudo rpm -Uvh http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-release-1.0-20.el7.art.noarch.rpm
21 | sudo rpm -Uvh http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-release-1.0-21.art.noarch.rpm
22 | sudo rpm -Uvh http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/atomic-release-1.0-21.art.noarch.rpm
23 | sudo yum install $DEPENDENCIES -y
24 | fi
25 | fi
26 |
27 | pip3 install --user -r conf/requirements.txt
28 | sudo ln -s "$(pwd)"/webmap.py /usr/local/bin/webmap
29 | git clone --depth 1 https://github.com/maurosoria/dirsearch.git ~/.local/share/dirsearch
--------------------------------------------------------------------------------
/modules/dirsearchscan.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import conf.conf as conf
10 |
11 |
12 | def dirsearch_scan():
13 | print(
14 | "===================================================================")
15 | print(conf.colored(conf.text2art("Dirsearch Scan", "small"), "cyan"))
16 | print(
17 | "===================================================================")
18 |
19 | dir_host = input(conf.colored("\nEnter target: ", "green", attrs=["bold"]))
20 | dir_output = input(
21 | conf.colored(
22 | f"Enter the output folder - [default: reports/Dirsearch/{dir_host}/]: ",
23 | "green",
24 | attrs=["bold"],
25 | ))
26 |
27 | conf.not_valid(dirsearch_scan, dir_host)
28 | dir_output = conf.dir_output(dir_output, "reports/Dirsearch", dir_host)
29 | conf.create_dir(dir_output)
30 |
31 | conf.os.system(
32 | f"python3 {conf.home}/.local/share/dirsearch/dirsearch.py -u {dir_host} --format plain -o {dir_output}/dirsearch.txt"
33 | )
34 |
35 | print(
36 | "______________________________________________________________________"
37 | )
38 |
--------------------------------------------------------------------------------
/modules/exit.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import conf.conf as conf
10 |
11 |
12 | def exit():
13 | conf.clear()
14 | conf.sys.exit()
15 | conf.ans = None
16 |
--------------------------------------------------------------------------------
/modules/fullscan.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import conf.conf as conf
10 |
11 |
12 | def full_scan():
13 | print("===========================================================")
14 | print(conf.colored(conf.text2art("All The Scans", "small"), "cyan"))
15 | print("===========================================================")
16 |
17 | full_host = input(
18 | conf.colored("\nEnter the target URL (i.e. opensource.com) : ", "green", attrs=["bold"]))
19 | full_output = input(
20 | conf.colored(
21 | f"Enter the output folder - [default: reports/All/{full_host}/]: ",
22 | "green",
23 | attrs=["bold"],
24 | ))
25 |
26 | conf.not_valid(full_scan, full_host)
27 | full_output = conf.dir_output(full_output, "reports/All", full_host)
28 |
29 | conf.create_dir(full_output)
30 |
31 | full_ip = conf.socket.gethostbyname(full_host)
32 |
33 | print(
34 | "___________________________________________________________________________"
35 | )
36 |
37 | conf.create_dir(full_output)
38 |
39 | gnome_installed = True if conf.os.path.exists(
40 | "/usr/bin/gnome-terminal") else False
41 |
42 | if len(full_host) == 0:
43 | conf.clear()
44 |
45 | print("Not Valid Choice Try again")
46 | conf.re_open()
47 |
48 | conf.full_host = None
49 | elif gnome_installed:
50 | conf.os.system(
51 | f"gnome-terminal -- bash -c 'nmap -A {full_ip} -o \"{full_output}/nmap.txt\" && bash'"
52 | )
53 | conf.clear()
54 |
55 | conf.os.system(
56 | f"gnome-terminal -- bash -c 'python3 {conf.home}/.local/share/dirsearch/dirsearch.py -u {full_host} --format plain -o \"{full_output}/dirsearch.txt\" && bash'"
57 | )
58 | conf.clear()
59 |
60 | conf.os.system(
61 | f"gnome-terminal -- bash -c 'nikto +h {full_host} -output \"{full_output}/nikto.txt\" && bash'"
62 | )
63 | conf.clear()
64 |
65 | else:
66 | conf.os.system(f"nmap -A {full_ip} -o {full_output}/nmap.txt")
67 |
68 | conf.os.system(
69 | f"python3 ~/.local/share/dirsearch/dirsearch.py -u {full_host} --format plain -o '{full_output}/dirsearch.txt'"
70 | )
71 |
72 | conf.os.system(f"nikto +h {full_host} -output {full_output}/nikto.txt")
73 |
--------------------------------------------------------------------------------
/modules/niktoscan.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import conf.conf as conf
10 |
11 |
12 | def nikto_scan():
13 | print("==============================================")
14 | print(conf.colored(conf.text2art("Nikto Scan", "small"), "cyan"))
15 | print("==============================================")
16 |
17 | nikto_host = input(
18 | conf.colored("\nEnter target: ", "green", attrs=["bold"]))
19 | nikto_output = input(
20 | conf.colored(
21 | f"Enter the output folder - [default: reports/Nikto/{nikto_host}/]: ",
22 | "green",
23 | attrs=["bold"],
24 | ))
25 |
26 | conf.not_valid(nikto_scan, nikto_host)
27 | nikto_output = conf.dir_output(nikto_output, "reports/Nikto", nikto_host)
28 |
29 | conf.create_dir(nikto_output)
30 |
31 | conf.os.system(f"nikto +h {nikto_host} -output {nikto_output}/nikto.txt")
32 |
33 | print(
34 | "______________________________________________________________________"
35 | )
36 |
--------------------------------------------------------------------------------
/modules/nmapscan.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import conf.conf as conf
10 |
11 |
12 | def nmap_scan():
13 | def tcp_scan():
14 | conf.clear()
15 |
16 | print(
17 | "______________________________________________________________________"
18 | )
19 |
20 | tcp_host = input(
21 | conf.colored(
22 | "\nEnter the IP you want to Scan the ports of: ",
23 | "green",
24 | attrs=["bold"],
25 | ))
26 | tcp_output = input(
27 | conf.colored(
28 | f"Enter the output folder - [default: reports/Nmap/{tcp_host}/]: ",
29 | "green",
30 | attrs=["bold"],
31 | ))
32 | tcp_ip = conf.socket.gethostbyname(tcp_host)
33 |
34 | conf.not_valid(udp_scan, tcp_host)
35 | tcp_output = conf.dir_output(tcp_output, "reports/Nmap/", tcp_host)
36 | conf.create_dir(tcp_output)
37 |
38 | print(
39 | "______________________________________________________________________"
40 | )
41 |
42 | conf.os.system(f"nmap -sS {tcp_ip} -o {tcp_output}/tcpscan.txt")
43 |
44 | print(
45 | "______________________________________________________________________"
46 | )
47 |
48 | def udp_scan():
49 | print(
50 | "______________________________________________________________________"
51 | )
52 |
53 | udp_host = input(
54 | conf.colored(
55 | "\nEnter the IP you want to Scan the ports of: ",
56 | "green",
57 | attrs=["bold"],
58 | ))
59 | udp_output = input(
60 | conf.colored(
61 | f"Enter the output folder - [default: reports/Nmap/{udp_host}/]: ",
62 | "green",
63 | attrs=["bold"],
64 | ))
65 | udp_ip = conf.socket.gethostbyname(udp_host)
66 |
67 | conf.not_valid(udp_scan, udp_host)
68 | udp_output = conf.dir_output(udp_output, "reports/Nmap/", udp_host)
69 | conf.create_dir(udp_output)
70 |
71 | print(
72 | "______________________________________________________________________"
73 | )
74 |
75 | conf.os.system(f"sudo nmap -sU {udp_ip} -o {udp_output}/udpscan.txt")
76 |
77 | print(
78 | "______________________________________________________________________"
79 | )
80 |
81 | def os_scan():
82 | print(
83 | "______________________________________________________________________"
84 | )
85 |
86 | os_host = input(
87 | conf.colored(
88 | "\nEnter the IP you want to find the operating system of: ",
89 | "green",
90 | attrs=["bold"],
91 | ))
92 | os_output = input(
93 | conf.colored(
94 | f"Enter the output folder - [default: reports/Nmap/{os_host}/]: ",
95 | "green",
96 | attrs=["bold"],
97 | ))
98 | os_ip = conf.socket.gethostbyname(os_host)
99 |
100 | conf.not_valid(os_scan, os_host)
101 | os_output = conf.dir_output(os_output, "reports/Nmap/", os_host)
102 | conf.create_dir(os_output)
103 |
104 | print(
105 | "______________________________________________________________________"
106 | )
107 |
108 | conf.os.system(f"sudo nmap -O {os_ip} -o {os_output}/osscan.txt")
109 |
110 | print(
111 | "______________________________________________________________________"
112 | )
113 |
114 | def a_scan():
115 | print(
116 | "______________________________________________________________________"
117 | )
118 |
119 | a_host = input(
120 | conf.colored("\nEnter the IP you want to Scan: ",
121 | "green",
122 | attrs=["bold"]))
123 | a_output = input(
124 | conf.colored(
125 | f"Enter the output folder - [default: reports/Nmap/{a_host}/]: ",
126 | "green",
127 | attrs=["bold"],
128 | ))
129 | a_ip = conf.socket.gethostbyname(a_host)
130 |
131 | conf.not_valid(a_scan, a_host)
132 | a_output = conf.dir_output(a_output, "reports/Nmap/", a_host)
133 | conf.create_dir(a_output)
134 |
135 | print(
136 | "______________________________________________________________________"
137 | )
138 |
139 | conf.os.system(f"sudo nmap -T4 -A {a_ip} -o {a_output}/ascan.txt")
140 |
141 | print(
142 | "______________________________________________________________________"
143 | )
144 |
145 | def net_scan():
146 | conf.clear()
147 |
148 | print(
149 | "______________________________________________________________________"
150 | )
151 |
152 | net_host = input(
153 | conf.colored(
154 | "\nEnter your address and range (i.e. 192.168.0.1/24) now: ",
155 | "green",
156 | attrs=["bold"],
157 | ))
158 | net_sort = net_host.split("/", 1)
159 | net_sort = net_sort[0]
160 | sn_output = input(
161 | conf.colored(
162 | f"Enter the output folder - [default: reports/Nmap/{net_sort}/]: ",
163 | "green",
164 | attrs=["bold"],
165 | ))
166 | conf.not_valid(net_scan, net_host)
167 | sn_output = conf.dir_output(sn_output, "reports/Nmap/", net_sort)
168 | conf.create_dir(sn_output)
169 |
170 | print(
171 | "______________________________________________________________________"
172 | )
173 |
174 | conf.os.system(f"sudo nmap -sn {net_host} -o {sn_output}/netscan.txt")
175 |
176 | print(
177 | "______________________________________________________________________"
178 | )
179 |
180 | def menu_scan():
181 | conf.clear()
182 | conf.re_open()
183 |
184 | print("================================================")
185 | print(conf.colored(conf.text2art("Nmap Scan", "small"), "cyan"))
186 | print("================================================")
187 | print(
188 | conf.colored("\n1. Scan An IP Address For Open Ports using TCP",
189 | "yellow",
190 | attrs=["bold"]))
191 | print(
192 | conf.colored("2. Scan An IP Address For Open Ports using UDP",
193 | "yellow",
194 | attrs=["bold"]))
195 | print(conf.colored("3. Operating System Scan", "yellow", attrs=["bold"]))
196 | print(
197 | conf.colored("4. Agressive Scan For An IP Address",
198 | "yellow",
199 | attrs=["bold"]))
200 | print(
201 | conf.colored("5. Scan The Network For All Devices",
202 | "yellow",
203 | attrs=["bold"]))
204 | print(conf.colored("M. Main Menu\n", "yellow", attrs=["bold"]))
205 | print("================================================")
206 |
207 | conf.ans = input(
208 | conf.colored("\nWhat would you like to do? Enter your selection: ",
209 | "green")).upper()
210 |
211 | if conf.ans == "1":
212 | conf.call_def(tcp_scan, 0)
213 | elif conf.ans == "2":
214 | conf.call_def(udp_scan, 0)
215 | elif conf.ans == "3":
216 | conf.call_def(os_scan, 0)
217 | elif conf.ans == "4":
218 | conf.call_def(a_scan, 0)
219 | elif conf.ans == "5":
220 | conf.call_def(net_scan, 0)
221 | elif conf.ans == "M":
222 | conf.call_def(menu_scan, 0)
223 | else:
224 | conf.not_valid(nmap_scan, 0)
225 |
226 | conf.ans = None
227 |
--------------------------------------------------------------------------------
/webmap.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 | #
3 | # Copyright (c) 2021 Iliass Alami Qammouri
4 | #
5 | # This is free software, licensed under the MIT License.
6 | # See /LICENSE for more information.
7 | #
8 |
9 | import conf.conf as conf
10 |
11 |
12 | def main():
13 | while conf.ans:
14 | print(
15 | "==================================================================="
16 | )
17 | print(conf.colored(conf.text2art("WebMap", "larry3d"), "cyan"))
18 | print(
19 | conf.colored("[>]", "red", attrs=["bold"]) +
20 | conf.colored("Created by : Anteste\n", "magenta", attrs=["bold"]))
21 | print(
22 | conf.colored("[>]", "red", attrs=["bold"]) + conf.colored(
23 | f"Version : {conf.version}\n", "magenta", attrs=["bold"]))
24 | conf.ver_check()
25 | print(
26 | "==================================================================="
27 | )
28 | print(conf.colored("\n1. Nmap Scan", "yellow", attrs=["bold"]))
29 | print(conf.colored("2. Dirsearch Scan", "yellow", attrs=["bold"]))
30 | print(conf.colored("3. Nikto Scan", "yellow", attrs=["bold"]))
31 | print(conf.colored("A. All the Scans", "yellow", attrs=["bold"]))
32 | print(conf.colored("E. Exit\n", "yellow", attrs=["bold"]))
33 | print(
34 | "==================================================================="
35 | )
36 |
37 | conf.ans = input(
38 | conf.colored("\nWhat would you like to do? Enter your selection: ",
39 | "green")).upper()
40 |
41 | if conf.ans == "1":
42 | conf.call_def(conf.nmap_scan)
43 | elif conf.ans == "2":
44 | conf.call_def(conf.dirsearch_scan)
45 | elif conf.ans == "3":
46 | conf.call_def(conf.nikto_scan)
47 | elif conf.ans == "A":
48 | conf.call_def(conf.full_scan)
49 | elif conf.ans == "E":
50 | conf.call_def(conf.exit)
51 | else:
52 | conf.not_valid(main, conf.ans, 0)
53 |
54 |
55 | try:
56 | main()
57 | except KeyboardInterrupt:
58 | print("\n \n Keyboard Interrupt. ")
59 | conf.sys.exit()
60 |
--------------------------------------------------------------------------------