Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build instructions #383

Merged
merged 5 commits into from
May 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ ZGrab is a fast, modular application-layer network scanner designed for completi

ZGrab 2.0 contains a new, modular ZGrab framework, which fully supersedes https://github.com/zmap/zgrab.


## Building

For Go 1.17 and later you must build from source:

```
$ git clone https://github.com/zmap/zgrab2.git
$ cd zgrab2
$ go build
$ make
$ ./zgrab2
```shell
git clone https://github.com/zmap/zgrab2.git
cd zgrab2
make
./zgrab2
```


Expand All @@ -24,22 +24,22 @@ You will need to have a valid `$GOPATH` set up, for more information about `$GOP

Once you have a working `$GOPATH`, run:

```
$ go get github.com/zmap/zgrab2
```shell
go get github.com/zmap/zgrab2
```

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

```
$ cd $GOPATH/src/github.com/zmap/zgrab2
$ make
```shell
cd $GOPATH/src/github.com/zmap/zgrab2
make
```

## Single Module Usage

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

```bash
```shell
./zgrab2 ssh
```

Expand All @@ -57,7 +57,7 @@ Module specific options must be included after the module. Application specific

Targets are specified with input files or from `stdin`, in CSV format. Each input line has three fields:

```
```text
IP, DOMAIN, TAG
```

Expand All @@ -71,7 +71,7 @@ Unused fields can be blank, and trailing unused fields can be omitted entirely.

These are examples of valid input lines:

```
```text
10.0.0.1
domain.com
10.0.0.1, domain.com
Expand All @@ -87,7 +87,7 @@ domain.com
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***
```
```ini
[Application Options]
output-file="output.txt"
input-file="input.txt"
Expand All @@ -102,21 +102,21 @@ endpoint="/"
[ssh]
port=22
```
```
```shell
./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.

Multiple module support is particularly powerful when combined with input tags and the `--trigger` scanner argument. For example, this input contains targets with two different tags:

```
```text
141.212.113.199, , tagA
216.239.38.21, censys.io, tagB
```

Invoking zgrab2 with the following `multiple` configuration will perform an SSH grab on the first target above and an HTTP grab on the second target:

```
```ini
[ssh]
trigger="tagA"
name="ssh22"
Expand All @@ -134,7 +134,7 @@ Add module to modules/ that satisfies the following interfaces: `Scanner`, `Scan

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

```
```go
func init() {
var newModule NewModule
_, err := zgrab2.AddCommand("module", "short description", "long description of module", portNumber, &newModule)
Expand All @@ -160,16 +160,16 @@ The only hard requirement is that the `test.sh` script drops its output in `$ZGR

To run integration tests, you must have [Docker](https://www.docker.com/) installed. Then, you can follow the following steps to run integration tests:

```
$ go get github.com/jmespath/jp && go build github.com/jmespath/jp
$ pip install --user zschema
$ make integration-test
```shell
go get github.com/jmespath/jp && go build github.com/jmespath/jp
pip install --user zschema
make integration-test
```

Running the integration tests will generate quite a bit of debug output. To ensure that tests completed successfully, you can check for a successful exit code after the tests complete:

```
$ echo $?
```shell
echo $?
0
```

Expand Down
Loading