NETGREP
Descriptionnetgrep can send http/https request or resolve domain from dns (can customize dns server) to separate existing domains from all domains very easy. |
Install netgrep
netgrep require go1.13 and above.
Install netgrep with command:
GO111MODULE=off go get -u github.com/aWolver/netgrep
How to use
See usage:
netgrep -h
Will print usage:
Usage - netgrep [OPTIONS] {targets specification}
TARGETS SPECIFICATION:
Can pass targets.
-iL <filename>: Input from list of hosts.
If not pass target, targets read from <stdin>.
DNS:
-dns <IP-address>: DNS Server for resolve host.
-dns-timeout <time-duration>: DNS Server timeout (default: 10000ms).
durations: ns(Nanosecond), us(Microsecond), ms(Millisecond), s(Second), m(Minutes), h(Hour)
-dns-type <type>: DNS Type (default: Host).
types: Host, MX, CNAME, NS
HTTP Request:
-http/-https: Use HTTP/HTTPS request to discovery.
-http-method <method>: HTTP[S] request method
-cookie <data>: HTTP[S] request cookies (format like cURL).
-header <header>: HTTP[S] request header (format like cURL).
-http-timeout <time-duration>: HTTP[S] request timeout (default: 10s). [see -dns-timeout]
-http-path <path>: HTTP[S] request path ( /path[query][fragment] ).
-status-code <statuscode>: Match HTTP status codes (default: (default: 200,204,301,302,307,401,403,405)).
OUTPUT:
-o <filename>: Output scan write to the given filename.
-debug: Debug mode (increase verbosity level).
-oS <style>: Output file style.
styles: Host: {{HOST}} StatusCode: {{CODE}} Status: {{STATUS}} IP's: {{IP}} ProtocolType: {{TYPE}} Path: {{PATH}}
OTHER:
-V: Print version and exit.
-h, --help: Show this help menu.
DNS
- usage:
echo "example.com" | netgrep
- can customize dns server:
echo "example.com" | netgrep -dns 8.8.8.8
- can set dns type and dns timeout:
echo "example.com" | netgrep -dns 8.8.8.8 -dns-timeout 10s -dns-type MX
HTTP/HTTPS
- usage (for HTTP use -http | for HTTPS use -https):
echo "example.com" | netgrep -http
- can set path/method/headers/cookies:
echo "example.com" | netgrep -http -http-path / -http-method POST -header 'Refferer: sub.example.com' -cookie 'NAME=VALUE; NAME=VALUE'
- set status codes for separate:
echo "example.com" | netgrep -http -status-code 200,301,401,403
STYLING
-
for DNS:
- {{HOST}}: domain/host
- {{IP}}: resolved IP's
-
for HTTP/HTTPS:
- {{HOST}}: domain/host
- {{PATH}}: requested path
- {{TYPE}}: http or https
- {{CODE}}: status code
- {{STATUS}}: e.g. '200 OK'
$ netgrep -http -o file.txt -oS '{{TYPE}}://{{HOST}}{{PATH}} - {{STATUS}}' example.com sub.example.com
...
[200 OK] example.com
[301 Moved Permanently] sub.example.com
...
$ cat file.txt
http://example.com/ - 200 OK
http://sub.example.com/ - 301 Moved Permanently