From df6686fd7d50406782e678134538ee961aa3ef23 Mon Sep 17 00:00:00 2001 From: Sven Strittmatter Date: Tue, 11 Jul 2023 12:11:27 +0200 Subject: [PATCH 1/4] Removes leading $ from command line examples If you use the copy & paste feature from GH's rendered README.md this $ sign is also copied and needs to be removed when pasted into a shell. Removing the $ makes it possible to paste the command w/o manual edit. Signed-off-by: Sven Strittmatter --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0bdf440b..d9c56161 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ 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 +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 +cd $GOPATH/src/github.com/zmap/zgrab2 +make ``` ## Single Module Usage @@ -140,15 +140,15 @@ 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 +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 $? +echo $? 0 ``` From c266628cb3be600fcc711ec5c5fd76dbea5edc46 Mon Sep 17 00:00:00 2001 From: Sven Strittmatter Date: Tue, 11 Jul 2023 12:14:36 +0200 Subject: [PATCH 2/4] Adds style name to fenced code to improve Markdown rendering Signed-off-by: Sven Strittmatter --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d9c56161..72a0b90d 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ You will need to have a valid `$GOPATH` set up, for more information about `$GOP Once you have a working `$GOPATH`, run: -``` +```shell go get github.com/zmap/zgrab2 ``` This will install zgrab under `$GOPATH/src/github.com/zmap/zgrab2` -``` +```shell cd $GOPATH/src/github.com/zmap/zgrab2 make ``` @@ -26,7 +26,7 @@ make ZGrab2 supports modules. For example, to run the ssh module use -``` +```shell ./zgrab2 ssh ``` @@ -36,7 +36,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 ``` @@ -50,7 +50,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 @@ -66,7 +66,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" @@ -81,21 +81,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" @@ -113,7 +113,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) @@ -139,7 +139,7 @@ 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: -``` +```shell go get github.com/jmespath/jp && go build github.com/jmespath/jp pip install --user zschema make integration-test @@ -147,7 +147,7 @@ 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: -``` +```shell echo $? 0 ``` From c431630061c541e4121926eebe03790c08fecad7 Mon Sep 17 00:00:00 2001 From: Sven Strittmatter Date: Tue, 11 Jul 2023 12:19:02 +0200 Subject: [PATCH 3/4] Updates the build instruction due to error The documented way to build seems to be outdated: ``` go get github.com/zmap/zgrab2 go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For more information, see https://golang.org/doc/go-get-install-deprecation or run 'go help get' or 'go help install'. ``` What works for me: Clone the repo and simply run `make` inside the repo to build the binary. Signed-off-by: Sven Strittmatter --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 72a0b90d..e0ca1c08 100644 --- a/README.md +++ b/README.md @@ -9,16 +9,16 @@ ZGrab 2.0 contains a new, modular ZGrab framework, which fully supersedes https: 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: +Once you have a working `$GOPATH`, clone the repo: ```shell -go get github.com/zmap/zgrab2 +git clone github.com/zmap/zgrab2 ``` -This will install zgrab under `$GOPATH/src/github.com/zmap/zgrab2` +This will install zgrab under current working directory: ```shell -cd $GOPATH/src/github.com/zmap/zgrab2 +cd zgrab2 make ``` From ed09a6f131d738b9c04bfe8eeb250bcdd461c1c8 Mon Sep 17 00:00:00 2001 From: Raymond Nook <59678453+developStorm@users.noreply.github.com> Date: Sun, 19 May 2024 16:47:29 -0700 Subject: [PATCH 4/4] Update README.md --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2ad8168a..049eb759 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ ZGrab 2.0 contains a new, modular ZGrab framework, which fully supersedes https: For Go 1.17 and later you must build from source: ```shell -$ git clone https://github.com/zmap/zgrab2.git -$ cd zgrab2 -$ make -$ ./zgrab2 +git clone https://github.com/zmap/zgrab2.git +cd zgrab2 +make +./zgrab2 ``` @@ -25,14 +25,14 @@ You will need to have a valid `$GOPATH` set up, for more information about `$GOP Once you have a working `$GOPATH`, run: ```shell -$ go get github.com/zmap/zgrab2 +go get github.com/zmap/zgrab2 ``` This will install zgrab under `$GOPATH/src/github.com/zmap/zgrab2` ```shell -$ cd $GOPATH/src/github.com/zmap/zgrab2 -$ make +cd $GOPATH/src/github.com/zmap/zgrab2 +make ``` ## Single Module Usage