https://github.com/surface-security/scanner-example
Template scanner to speed up creating new ones. But also built as scanner image so it can be used to test scanners framework or a new rootbox
https://github.com/surface-security/scanner-example
Last synced: about 2 months ago
JSON representation
Template scanner to speed up creating new ones. But also built as scanner image so it can be used to test scanners framework or a new rootbox
- Host: GitHub
- URL: https://github.com/surface-security/scanner-example
- Owner: surface-security
- Created: 2022-02-11T11:46:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-15T18:51:48.000Z (over 3 years ago)
- Last Synced: 2025-06-12T07:47:50.320Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Boilerplate
Template scanner to speed up creating new ones
The only thing scanners need to follow is:
* process a single input file that will be specified as first positional argument
* produce as many output files as wanted in `/output` path (inside the container)
Input file format will match whatever is chosen as `Input Generator` and the output produced should match whatever is expected by `Output Parser` <-- settings defined in the scanner configuration in Surface)
This repository is actually built as a scanner (named `example`) that can be used to test scanners framework or a new rootbox.
## NOTE
This is a dumb scanner as it only resolves A records and it shells out to `host` utility. This has a performance impact (spawning shells) over simply using a DNS lib/package but the purpose is to exemplify the common scenario of building entrypoints to *wrap* external/3rd-party scanners
Rest of README.md is also part of the example, feel free to re-use
# Example Scanner in Docker
This scanner performs DNS resolution.
Input expected: one hostname per line
Output provided: single file, with `hostname:IP`
## Usage
```
Mass DNS Resolver
positional arguments:
inputfile THE input file
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
output directory for results
-p PROCESSES, --processes PROCESSES
number of processes
--echo just echo input back instead of resolving DNS (passive
testing)
--wait WAIT sleep WAIT seconds after completion
```
`echo` will just echo back so it can be executed without hammering nameservers (if not required).
`wait` will introduce sleep at the end which can be useful to easily simulate a long scan.
## Run locally
- Build: `./build.sh nopush`
- Create `/tmp/input/input.txt` and `/tmp/output`.
- Run: `docker run --rm -v /tmp/input:/input -v /tmp/output:/output ${PWD##*/}:latest`