Go to file
2017-12-15 10:02:09 -05:00
cmd/zgrab2 Name changes, readme changes 2017-10-04 11:20:17 -04:00
integration_tests note non-SSL mysql 2017-12-15 09:57:56 -05:00
lib TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
modules TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
schemas TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
tools/keys sed name changes 2017-10-22 21:19:49 -04:00
.travis.yml TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
cleanup_integration_tests.sh TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
config.go gofmt, golint, add docs 2017-10-03 23:57:56 -04:00
integration_tests.py chmod +x integration_tests.py 2017-12-07 16:44:58 -05:00
integration_tests.sh TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
LICENSE initial commit with readme and license 2016-08-19 16:25:49 -07:00
Makefile move main to cmd/zgrab2 2017-09-03 13:43:05 -04:00
module.go Update ScanStatus comments 2017-12-15 10:02:09 -05:00
monitor.go gofmt, golint, add docs 2017-10-03 23:57:56 -04:00
multiple.go gofmt, golint, add docs 2017-10-03 23:57:56 -04:00
processing.go TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
README.md readme fixes 2017-12-15 09:53:46 -05:00
scanner.go TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
setup_integration_tests.sh TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
test_mysql_all.sh TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
test_mysql_version.sh TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
tls.go TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00
utility.go TLS scan prototype + Travis integration (#25) 2017-12-15 09:25:17 -05:00

ZGrab 2.0

This repo contains the new ZGrab framework, and will eventually replace https://github.com/zmap/zgrab.

Building

You will need to have a valid $GOPATH set up, for more information about $GOPATH, see https://golang.org/doc/code.html.

Once you have a working $GOPATH, run:

$ go get github.com/zmap/zgrab2

This will install zgrab under $GOPATH/src/github.com/zmap/zgrab

$ cd $GOPATH/src/github.com/zmap/zgrab
$ make

Single Module Usage

ZGrab2 supports modules. For example, to run the ssh module use

./zgrab2 ssh

Module specific options must be included after the module. Application specific options can be specified at any time.

Multiple Module Usage

To run a scan with multiple modules, a .ini file must be used with the multiple module. Below is an example .ini file with the corresponding zgrab2 command.

***multiple.ini***
[Application Options]
output-file="output.txt"
input-file="input.txt"
[http]
name="http80"
port=80
endpoint="/"
[http]
name="http8080"
port=8080
endpoint="/"
[ssh]
port=22
./zgrab2 multiple -c multiple.ini

Application Options must be the initial section name. Other section names should correspond exactly to the relevant zgrab2 module name. The default name for each module is the command name. If the same module is to be used multiple times then name must be specified and unique.

Adding New Protocols

Add module to modules/ that satisfies the following interfaces: Scanner, ScanModule, ScanFlags.

The flags struct must embed zgrab2.BaseFlags. In the modules init() function the following must be included.

func init() {
    var newModule NewModule
    _, err := zgrab2.AddCommand("module", "short description", "long description of module", portNumber, &newModule)
    if err != nil {
        log.Fatal(err)
    }
}

Output schema

To add a schema for the new module, add a module under schemas, and update schemas/__init__.py to ensure that it is loaded.

Integration tests

To add integration tests for the new module, add shell scripts to setup/test/cleanup the tests in integration_tests/[your-module]/, named setup.sh, test.sh and cleanup.sh respectively. See integration_tests/mysql/* for an example. The only requirement is that the test.sh script drops its output in $ZGRAB_OUTPUT/[your-module]/*.json, so that it can be validated against the schema.

License

ZGrab2.0 is licensed under Apache 2.0 and ISC. For more information, see the LICENSE file.