Code Monkey home page Code Monkey logo

webmap's Introduction


A Web Dashbord for Nmap XML Report

Table Of Contents

Screenshot





Usage

You should use this with docker, just by sending this command:

$ mkdir /tmp/webmap
$ docker run -d \
         --name webmap \
         -h webmap \
         -p 8000:8000 \
         -v /tmp/webmap:/opt/xml \
         reborntc/webmap

$ # now you can run Nmap and save the XML Report on /tmp/webmap
$ nmap -sT -A -T4 -oX /tmp/webmap/myscan.xml 192.168.1.0/24

Now point your browser to http://localhost:8000

Generate new token

In order to access to the WebMap dashboard, you need a token. You can create a new token with:

$ docker exec -ti webmap /root/token

Upgrade from previous release

$ # stop running webmap container
$ docker stop webmap

$ # remove webmap container
$ docker rm webmap

$ # pull new image from dockerhub
$ docker pull reborntc/webmap

$ # run WebMap
$ curl -sL http://bit.ly/webmapsetup | bash

Run without Docker

This project is designed to run on a Docker container. IMHO it isn't a good idea to run this on a custom Django installation, but if you need it you can find all building steps inside the Dockerfile.

Video

The HTML template changes often. This video could not be up to date with the latest version.

Features

  • Import and parse Nmap XML files
  • Run and Schedule Nmap Scan from dashboard
  • Statistics and Charts on discovered services, ports, OS, etc...
  • Inspect a single host by clicking on its IP address
  • Attach labels on a host
  • Insert notes for a specific host
  • Create a PDF Report with charts, details, labels and notes
  • Copy to clipboard as Nikto, Curl or Telnet commands
  • Search for CVE and Exploits based on CPE collected by Nmap
  • RESTful API

Roadmap for v2.3x

You love WebMap and you know python? We need your help! This is what we want deploy for the v2.3:

  • [todo] Improve template: try to define better the html template and charts
  • [todo] Improve API: create a documentation/wiki about it
  • [todo] Wiki: create WebMap User Guide on GitHub
  • [working] Authentication or something that could blocks access to WebMap if != localhost
  • [working] Scan diff: show difference between two scheduled nmap scan report
  • [todo] Zaproxy: Perform web scan using the OWASP ZAP API

Changes on v2.2

  • fixed bug on missing services
  • Run nmap from WebMap
  • Schedule nmap run
  • Add custom NSE scripts section

Changes on v2.1

  • Better usage of Django template
  • Fixed some Nmap XML parse problems
  • Fixed CVE and Exploit collecting problems
  • Add new Network View
  • Add RESTful API

PDF Report

WebMap

XML Filenames

When creating the PDF version of the Nmap XML Report, the XML filename is used as document title on the first page. WebMap will replace some parts of the filename as following:

  • _ will replaced by a space ( )
  • .xml will be removed

Example: ACME_Ltd..xml
PDF title: ACME Ltd.

CVE and Exploits

thanks to the amazing API services by circl.lu, WebMap is able to looking for CVE and Exploits for each CPE collected by Nmap. Not all CPE are checked over the circl.lu API, but only when a specific version is specified (for example: cpe:/a:microsoft:iis:7.5 and not cpe:/o:microsoft:windows).

Network View

WebMap

RESTful API

From v2.1 WebMap has a RESTful API frontend that makes users able to query their scan files with something like:

curl -s 'http://localhost:8000/api/v1/scan?token=<token>'

    "webmap_version": "v2.1/master",
    "scans": {
        "scanme.nmap.org.xml": {
            "filename": "scanme.nmap.org.xml",
            "startstr": "Sun Nov  4 16:22:46 2018",
            "nhost": "1",
            "port_stats": {
                "open": 42,
                "closed": 0,
                "filtered": 0
            }
        },
        "hackthebox.xml": {
            "filename": "hackthebox.xml",
            "startstr": "Mon Oct  8 20:56:32 2018",
            "nhost": "256",
            "port_stats": {
                "open": 67,
                "closed": 0,
                "filtered": 2
            }
        }
    }
}

A user can get information about a single scan by append to the URL the XML filename:

curl -v 'http://localhost:8000/api/v1/scan/hackthebox.xml?token=<token>'

{
    "file": "hackthebox.xml",
    "hosts": {
        "10.10.10.2": {
            "hostname": {},
            "label": "",
            "notes": ""
        },
        "10.10.10.72": {
            "hostname": {
                "PTR": "streetfighterclub.htb"
            },
            "label": "",
            "notes": ""
        },
        "10.10.10.76": {
            "hostname": {},
            "label": "",
            "notes": ""
        },
        "10.10.10.77": {
            "hostname": {},
            "label": "Vulnerable",
            "notes": "PHNwYW4gY2xhc3M9ImxhYmVsIGdyZWVuIj5SRU1FRElBVElPTjwvc3Bhbj4gVXBncmFkZSB0byB0aGUgbGF0ZXN0IHZlcnNpb24g"
        },
...

and he can get all information about a single host by append the IP address to URL:

curl -v 'http://localhost:8000/api/v1/scan/hackthebox.xml/10.10.10.87?token=<token>'

    "file": "hackthebox.xml",
    "hosts": {
        "10.10.10.87": {
            "ports": [
                {
                    "port": "22",
                    "name": "ssh",
                    "state": "open",
                    "protocol": "tcp",
                    "reason": "syn-ack",
                    "product": "OpenSSH",
                    "version": "7.5",
                    "extrainfo": "protocol 2.0"
                },
                {
                    "port": "80",
                    "name": "http",
                    "state": "open",
                    "protocol": "tcp",
                    "reason": "syn-ack",
                    "product": "nginx",
                    "version": "1.12.2",
                    "extrainfo": ""
                },
                {
                    "port": "8888",
                    "name": "sun-answerbook",
                    "state": "filtered",
                    "protocol": "tcp",
                    "reason": "no-response",
                    "product": "",
                    "version": "",
                    "extrainfo": ""
                }
            ],
            "hostname": {},
            "label": "Checked",
            "notes": "",
            "CVE": [
                {
                    "Modified": "2018-08-17T15:29:00.253000",
                    "Published": "2018-08-17T15:29:00.223000",
                    "cvss": "5.0",
                    "cwe": "CWE-200",
                    "exploit-db": [
                        {
                            "description": "OpenSSH 7.7 - Username Enumeration. CVE-2018-15473. Remote exploit for Linux platform",
                            "file": "exploits/linux/remote/45233.py",
                            "id": "EDB-ID:45233",
                            "last seen": "2018-08-21",
                            "modified": "2018-08-21",
                            "platform": "linux",
                            "port": "",
                            "published": "2018-08-21",
                            "reporter": "Exploit-DB",
                            "source": "https://www.exploit-db.com/download/45233/",
                            "title": "OpenSSH 7.7 - Username Enumeration",
                            "type": "remote"
                        },
                        {
                            "id": "EDB-ID:45210"
                        }
                    ],
                    "id": "CVE-2018-15473",
                    "last-modified": "2018-11-02T06:29:06.993000",
                    "metasploit": [
...

Third Parts

Security Issues

This app is not intended to be exposed to the internet, but to be used as localhost web application. Please, DO NOT expose this app to the internet, use your localhost or, in case you can't do it, take care to filter who and what can access to WebMap with a firewall rule or something like that. Exposing this app to the whole internet could lead not only to a stored XSS but also to a leakage of sensitive/critical/private informations about your port scan. Please, be smart.

webmap's People

Contributors

michelbaie avatar sabyasachirana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webmap's Issues

Package 'libssl1.0-dev'

"E:Package 'libssl1.0-dev' has no installation candidate"

i run webmap docker build ($ docker build -t webmap:latest ) in kali and ubuntu in both I got above error
too i install Package 'libssl1.0-dev' package

Nmap scan command syntax should happen before the dialog box is closed

When you try to create a new scan
image

But there's some error in your parameters

image

It will error out and close the dialog

Now you have to type in everything again, and it makes iterating harder than necessary.

(and if anyone can point out my error here, I can't get this to work at all unfortunately)

Loop Popup Nmap scan done

Hoi

i started Nmap scan on a /24 now it popups Nmap scan done
there is no way to cancel the scan restart de scan etc how to solve this

Chris

Change of username

Because of the change of the GitHub username, from Rev3seSecurity to SabyasachiRana, trying to build from the docker file fails (ie. it's trying to clone a non-existent repo).

"+" button should be clickable

Specifically this button
image

When you click it, it expands the sidebar

image

But then if you click it again, it moves a little but does not open the new scan dialog

PDF-Export broken

Hello!
I get a KeError at /view/pdf, when trying to create a PDF-Report.
Is this feature broken?
I am using the docker-container.
Everything else seems to work fine.

Cheers
Niko

Cannot start docker container

I get the next error when i try to start the container:
standard_init_linux.go:211: exec user process caused "exec format error"

I'm trying to start the container on a raspberry pi 3 b+

docker pull failing

running the command:
docker pull reborntc/webmap

results in the following error:
Error response from daemon: manifest for reborntc/webmap:latest not found: manifest unknown: manifest unknown

CVE

It does not seem to be finding CVE's when I click on the link.

vimrc not found & token permission denied

I built the docker after cloning this repo. I got a couple of errors easy to fix.

  1. In Dockerfile line 40: there is no vimrc file to copy.
  2. When I try to generate a token: the /opt/nmapdashboard/nmapreport/token.py is not executable and I get a permission denied. chmod +x /opt/nmapdashboard/nmapreport/token.py should fix it.

KeyError for cveobj['references'] in cve.py

First things first,
Awesome piece of software! it helps me a lot and saves me a lot of time, as long as it works fully as expected, but does not.

File:

root@webmap:/opt/nmapdashboard/nmapreport/nmap# cat cve.py
...
line 80: r.=.requests.get('http://cve.circl.lu/api/cvefor/'+cpestr)t()
...

there is 2x API reference, unfortunately "cvefor" doesn't work, as below

blaise@dev:~/app$ curl -k -X 'GET'   'https://cve.circl.lu/api/cvefor/cpe%3A2.3%3Ao%3Amicrosoft%3Awindows_11%3A-%3A*%3A*%3A*%3A*%3A*%3Ax64%3A*?limit=20'   -H 'accept: application/json'
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL was not found on this server.</p>
<hr>
<address>Apache Server at cve.circl.lu Port 443</address>
</body></html>

I launched the whole project (cve search docker) locally, changed the addresses to my own (localhost)

and now the "CHECK FOR CVE AND EXPLOITS" function works, at the bottom of the page you can see: (222 CVE FOUND) but when I click to enable preview, I get an error from django:


KeyError at /report/192.168.16.147/
'references'
...

				elif type(i) is dict:
					listcve = [i]
					#cveout += 'dict<hr>'
				#continue
				for cveobj in listcve:
					cverefout = ''
					for cveref in cveobj['references']: …
						cverefout += '<a href="'+cveref+'">'+cveref+'</a><br>'
					cveexdbout = ''
					if 'exploit-db' in cveobj:
						cveexdbout = '<br><div class="small" style="line-height:20px;"><b>Exploit DB:</b><br>'
						for cveexdb in cveobj['exploit-db']:

'references' contains a list of urls

webmap

Invalid Token

Generate a new token with:
docker exec -ti webmap /root/token

  1. after docker image build, also need run: chmod +x /opt/nmapdashboard/nmapreport/token.py otherwise /root/token return "Permission denied".
  2. After token generation I have still receive error about wrong token.

root@c0e56bc65d19:# cat /root/token.sha256
4b1015c1b1f8cd597286a38e692760b86f44a5d8d3d7ae818b2648a1d0f8c7a1root@c0e56bc65d19:
#

PDF Export

hi, i tried the docker and works, but ... when i try to generate the pdf, i get an exception

KeyError at /view/pdf/'@reason'Request Method:GETRequest URL:http://127.0.0.1:8000/view/pdf/Django Version:3.0.3Exception Type:KeyErrorException Value:'@reason'Exception Location:/opt/nmapdashboard/nmapreport/pdf.py in reportPDFView, line 94Python Executable:/usr/bin/python3Python Version:3.6.9Python Path:['/opt/nmapdashboard', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']Server time:Fri, 20 Mar 2020 18:39:45 +0000 

Am not a python fun so i don't know what is happening.

And.... this is not an issue just an additional feature... import scans...

Kind Regards!

how to import an nmap xml file

First I run:

sudo docker run -d --name webmap4 -h webmap -p 8000:8000 -v /tmp/webmap:/opt/xml reborntc/webmap

This would seem to indicate that /tmp/webmap on my host OS will be mounted to /opt/xml inside the docker image. However when I drop an nmap.xml file into /tmp/webmap the docker webapp doesn't load/parse it?

Thoughts?

Parse multiple files

Hi

How can I parse multiple XML files with this? I don't see any option for that. I have multiple XMLs that I want to parse/merge into one so the report gets a bit better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.