GithubHelp home page GithubHelp logo

wantongtang / nmap-web Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaryno/nmap-web

0.0 2.0 0.0 224 KB

web-based tool for running nmap against a host, replete with site-based scan histories

Java 89.24% HTML 10.76%

nmap-web's Introduction

Installation instructions:

This assumes you have maven, mysql, and nmap command line utility.

1. UPDATE PROPERTIES

Update the properties to point to nmap:
Update src/main/resources/nmapweb.properties with path to nmap.

2. CREATE DATABASE

First, make sure you have a user/pass in your favorite database with the right privileges to create tables. You can create the table using hb2ddl or by utilizing the create_tables.sql script in src/main/resources. Either way, you will need to edit src/main/resources/hibernate.cfg.xml and update the path to the mysql server and the database username and password. 

2a. create tables using hbm2ddl:
In the src/main/resources/hibernate.cfg.xml file, set the hibernate.hbm2ddl.auto property to "create".  Next, execute the maven "clean" target. This has the added benefit of running the unit tests. Once you have  created the database, immediately set te property back to "update" or you will lose all database updates every time the program is executed.

2b. use the sql script:
In the src/main/resources, use the create_tables.sql script to generate the tables from the nmapscans database (or whatever you decide to name it).

3. BUILD APPLICATION

Run the unit tests, build, and deploy locally using Jersey and Grizzly:

> mvn clean package install

4. WEB APPLICATION

Deploy the grizzly engine using maven:

> mvn exec:java

It will continue to run until you press Enter key on the console.

Once the application is up and running, go to your web browser. The default url is http://localhost:8080/html/index.html. If you changed the port in the nmapweb.properties file it would be reflected here.

Enter an arbitrary number of hosts or IP addresses, separated by commas. 

5. WEB SERVICE

The path to the web services are:

SiteScan (single host): http://localhost:8080/nmap/scan/{host}
SiteScanHistory (single host): http://localhost:8080/nmap/history/{host}

example:
http://localhost:8080/nmap/scan/yahoo.com

The schema for the SiteScan is mapped by the POJO at aaryn.nmap.summary.SiteScan:
	 String host;
	 String ip;
	 List<String> hostAliases;
	 List<Integer> openPorts;
	 List<Integer> openFilteredPorts;
	 List<Integer> closedPorts;
	 List<Integer> closedFilteredPorts;
	 List<Integer> filteredPorts;
	 List<Integer> unfilteredPorts;

The JSON schema for the SiteScanHistory is mapped by the POJO at aaryn.nmap.summary.SiteScanHistory:
	 String[][] portStateArray;
	 int[][] portChangeArray;
	 List<Integer> historicallyOpenPorts;
	 List<Integer> ports;
	 List<Date> scanDates;
	 String ip;
	 List<String> hostnames; 
 
Ideally these schemas would be json schemas accessible by service... 

6. BONUS - JAVADOC

If you want to look at crude javadoc, build the javadoc from maven:

> mvn javadoc:javadoc

This will build the javadoc at target/site/apidocs/index.html.

Enjoy!

nmap-web's People

Watchers

James Cloos avatar Richard M Wan avatar

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.