ZGrab 2.0
=========
ZGrab is a fast, modular application-layer network scanner designed for completing large Internet-wide surveys. ZGrab is built to work with ZMap (ZMap identifies L4 responsive hosts, ZGrab performs in-depth, follow-up L7 handshakes). Unlike many other network scanners, ZGrab outputs detailed transcripts of network handshakes (e.g., all messages exchanged in a TLS handshake) for offline analysis.
ZGrab 2.0 contains a new, modular ZGrab framework, which fully supersedes https://github.com/zmap/zgrab.
## Installation
### With Docker
You can run ZGrab 2.0 with our official Docker image. For example, to scan a single website using the HTTP module, you can use:
```shell
echo 'example.com' | docker run --rm -i ghcr.io/zmap/zgrab2 http
```
For more complex scanning scenarios, such as using multiple modules or custom configurations, you can create a configuration file and pass it to the container:
```shell
docker run --rm -i -v /path/to/your/config.ini:/config.ini ghcr.io/zmap/zgrab2 multiple -c /config.ini
```
Replace `/path/to/your/config.ini` with the path to your configuration file on the host machine. See [Multiple Module Usage](#multiple-module-usage) for more details on configurations.
### Building from Source
For Go 1.17 and later you must build from source:
```shell
git clone https://github.com/zmap/zgrab2.git
cd zgrab2
make
./zgrab2
```
For Go 1.16 and below you can install via go get:
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:
```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
```
## Single Module Usage
ZGrab2 supports modules. For example, to run the ssh module use
```shell
./zgrab2 ssh
```
To retrieve detailed command-line usage and options for a specific module, append `-h` to the command:
```bash
./zgrab2 [module] -h
```
This will display the module-specific options, as well as the application-wide options, including usage examples, available flags, and descriptions for each option.
Module specific options must be included after the module. Application specific options can be specified at any time.
## Input Format
Targets are specified with input files or from `stdin`, in CSV format. Each input line has three fields:
```text
IP, DOMAIN, TAG
```
Each line must specify `IP`, `DOMAIN`, or both. If only `DOMAIN` is provided, scanners perform a DNS hostname lookup to determine the IP address. If both `IP` and `DOMAIN` are provided, scanners connect to `IP` but use `DOMAIN` in protocol-specific contexts, such as the HTTP HOST header and TLS SNI extension.
If the `IP` field contains a CIDR block, the framework will expand it to one target for each IP address in the block.
The `TAG` field is optional and used with the `--trigger` scanner argument.
Unused fields can be blank, and trailing unused fields can be omitted entirely. For backwards compatibility, the parser allows lines with only one field to contain `DOMAIN`.
These are examples of valid input lines:
```text
10.0.0.1
domain.com
10.0.0.1, domain.com
10.0.0.1, domain.com, tag
10.0.0.1, , tag
, domain.com, tag
192.168.0.0/24, , tag
```
## 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***
```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
```
```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"
port=22
[http]
trigger="tagB"
name="http80"
port=80
```
## 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.
```go
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 [`zgrab2_schemas/zgrab2/__init__.py`](zgrab2_schemas/zgrab2/__init__.py) to ensure that it is loaded.
See [zgrab2_schemas/README.md](zgrab2_schemas/README.md) for details.
### Integration tests
To add integration tests for the new module, run `integration_tests/new.sh [your_new_protocol_name]`.
This will add stub shell scripts in `integration_tests/your_new_protocol_name`; update these as needed.
See [integration_tests/mysql/*](integration_tests/mysql) for an example.
The only hard 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.
#### How to Run Integration Tests
To run integration tests, you must have [Docker](https://www.docker.com/) and **Python 2** on host 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
# or, sudo wget https://github.com/jmespath/jp/releases/download/0.2.1/jp-linux-amd64 -O /usr/local/bin/jp && sudo chmod +x /usr/local/bin/jp
pip2 install --user zschema
pip2 install --user -r requirements.txt
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
```
Refer to our [Github Actions workflow](.github/workflows/integration-test.yml) for an example of how to prepare environment for integration tests.
## License
ZGrab2.0 is licensed under Apache 2.0 and ISC. For more information, see the LICENSE file.
没有合适的资源?快使用搜索试试~ 我知道了~
Fast Go 应用程序扫描器.zip
共483个文件
go:269个
sh:62个
json:60个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 43 浏览量
2024-12-02
22:10:36
上传
评论
收藏 1MB ZIP 举报
温馨提示
Fast Go 应用程序扫描器抓斗2.0ZGrab 是一款快速、模块化的应用层网络扫描器,专为完成大型互联网范围的调查而设计。ZGrab 专为与 ZMap 配合使用而设计(ZMap 识别 L4 响应主机,ZGrab 执行深入的后续 L7 握手)。与许多其他网络扫描器不同,ZGrab 输出网络握手的详细记录(例如,TLS 握手中交换的所有消息)以供离线分析。ZGrab 2.0 包含一个新的模块化 ZGrab 框架,它完全取代了https://github.com/zmap/zgrab。安装使用 Docker您可以使用我们的官方 Docker 映像运行 ZGrab 2.0。例如,要使用 HTTP 模块扫描单个网站,您可以使用echo 'example.com' | docker run --rm -i ghcr.io/zmap/zgrab2 http对于更复杂的扫描场景,比如使用多个模块或者自定义配置,可以创建一个配置文件并将其传递给容器docker run --rm -i -v /path/to/your/config.ini:/config.ini
资源推荐
资源详情
资源评论
收起资源包目录
Fast Go 应用程序扫描器.zip (483个子文件)
Dockerfile.9.3 443B
cupsssl.conf 5KB
cupsd.conf 5KB
lighttpd.conf 1KB
ntpd.conf 780B
renamed.conf 169B
password.conf 22B
default.conf 0B
style.css 8B
Dockerfile 781B
Dockerfile 641B
Dockerfile 520B
Dockerfile 484B
Dockerfile 434B
Dockerfile 361B
Dockerfile 307B
Dockerfile 290B
Dockerfile 288B
service-base.Dockerfile 157B
Dockerfile 157B
Dockerfile 157B
Dockerfile 156B
Dockerfile 45B
.dockerignore 57B
file 11B
.gitattributes 28B
.gitignore 278B
.gitignore 266B
h2_bundle.go 223KB
errors.go 175KB
serve_test.go 139KB
transport_test.go 104KB
server.go 92KB
transport.go 64KB
client_test.go 51KB
types.go 48KB
request.go 42KB
process_test.go 41KB
clientserver_test.go 37KB
fs_test.go 33KB
scanner.go 33KB
connection.go 32KB
types_test.go 31KB
jar_test.go 31KB
request_test.go 28KB
mysql.go 28KB
client.go 28KB
transfer.go 27KB
scanner.go 26KB
keys.go 23KB
scanner.go 22KB
response_test.go 22KB
fs.go 22KB
requestwrite_test.go 22KB
kex.go 21KB
terminal.go 21KB
messages.go 20KB
non1.go 19KB
session_test.go 19KB
scanner.go 18KB
certs.go 17KB
zgrab.go 16KB
scanner.go 16KB
server.go 16KB
client.go 16KB
cookie_test.go 16KB
channel.go 16KB
http_readlimit_test.go 16KB
cipher.go 16KB
session.go 15KB
client_auth.go 14KB
modbus.go 13KB
jar.go 13KB
keys_test.go 13KB
smb.go 12KB
types.go 12KB
handshake.go 12KB
scanner.go 12KB
encoder.go 12KB
client_auth_test.go 12KB
conn.go 12KB
conn_bytelimit_test.go 12KB
tls.go 11KB
handshake_test.go 11KB
response.go 11KB
conn_timeout_test.go 11KB
types_test.go 11KB
persist.go 11KB
connection.go 11KB
mux_test.go 11KB
s7.go 11KB
common.go 11KB
scanner.go 10KB
tcpip.go 10KB
header.go 10KB
scanner.go 10KB
connection.go 10KB
server.go 10KB
readrequest_test.go 10KB
cookie.go 9KB
共 483 条
- 1
- 2
- 3
- 4
- 5
资源评论
赵闪闪168
- 粉丝: 1660
- 资源: 5391
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 我使用 redis 的工具.zip
- 灭火器检测39-YOLO(v5至v9)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- 异步并发哈希图 与 Redis 不同,它支持多线程和高级数据结构.zip
- 常见有用的服务器配置,包括nginx,mysql,tomcat,redis.zip
- 非常好的python入门书傻瓜式教程100%好用.zip
- 小型流畅接口,更轻松地在 redis 中缓存 sequelize 数据库查询结果.zip
- 火焰检测19-YOLO(v5至v7)、COCO、CreateML、Darknet、Paligemma、TFRecord、VOC数据集合集.rar
- 项目二 李白代表作品页面(资源)
- 将数据存储在 Redis 数据库中的 Node.js 应用.zip
- 将你的 Laravel 应用程序与 redis 管理器集成.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功