Commit Graph

204 Commits

Author SHA1 Message Date
Tim Schumacher
c034bb26a1 Use hash setting on getCheckRedirect 2020-09-17 17:14:23 -04:00
Tim Schumacher
fc82b6b673 Capture BodyTextLength 2020-09-17 15:01:27 -04:00
Tim Schumacher
a7ad9a27d2 Combine to single option 2020-09-17 14:08:02 -04:00
Tim Schumacher
40ebf2ae9c Spelling 2020-09-17 13:21:03 -04:00
Tim Schumacher
7c61e14cfc Fix test 2020-09-17 12:15:07 -04:00
Tim Schumacher
f96339b30b Add BodyHashAlgorithm option 2020-09-17 11:31:31 -04:00
Tim Schumacher
8f4f1bb1ec Types 2020-09-17 11:08:26 -04:00
Tim Schumacher
30e6cdb73f Add BodyHash field with hash type prefix 2020-09-17 11:04:27 -04:00
Tim Schumacher
4775cf85f4 Add option to compute http BodySHA256 on decoded BodyText 2020-09-17 10:13:52 -04:00
Benjamin Wireman
6eaaa2fa00
add implicit tls bool to smtp (#266)
https://github.com/zmap/zgrab2/pull/266
2020-06-02 09:06:27 -04:00
Elliot Cubit
457d8a090b
Ecubit/fix false positives (#262)
* telnet module should not return success when it finds something other than telnet

* telnet module should not return success when it finds something other than telnet

* Adds verification step for POP3 banners

* Add validation for IMAP banners & fix some formatting problems

* Verify SMTP banners exist and are successful

* Add check for is_dnp3 flag which seems to be working as expected

* Fix dropping SCAN_APPLICATION_ERROR in IMAP

* Fix dropping SCAN_APPLICATION_ERROR in POP3

* Fix dropping SCAN_APPLICATION_ERROR in SMTP

* Add protocol and blacklist indicators to email protocols

Co-authored-by: Elliot Cubit <elliotcubit@elliots-mbp.lan>
2020-06-01 14:26:24 -04:00
Jeff Cody
f6fbfc53c8
ftp: Add support for implicit TLS
The command line option `--implicit-tls` will attempt connecting via
TLS before intiating the FTP handshake.
2020-05-29 16:10:53 -04:00
Benjamin Wireman
cfd48de9d6
Fix panics in Modbus scanner (#265)
* Check message and body length in in GetModbusResponse()

* add timeout to waiting when PSQL container to start

https://github.com/zmap/zgrab2/pull/265
2020-05-29 13:07:47 -04:00
Jeff Cody
76d09b59c5
http/tls: Add option to override SignatureAndHashes
So that we can advertise a slightly more expansive default set of
signature/hash algorithms in the signature_algorithms extension of
the TLS Client Hello, provide an option to use a pre-defined override.

This also splits up the TLS connection helper in tls.go, so that the
tls.Config can be modified by a scanner module.
2020-05-08 17:32:33 -04:00
bwireman
8395d72fee use DetermineEncoding To try and translate page to UTF8 if possible 2020-03-21 10:51:04 -04:00
Jeff Cody
0bd36c5267
modules/http: Add option to suppress errors when max redirects exceeded (#253)
If the --max-redirects value is exceeded, we return
SCAN_APPLICATION_ERROR with "Too many redirect" as the error message.

Add an option to suppress this error, and return success even if we
exceed the maximum specified number of redirects.
2020-02-28 13:56:18 -05:00
Jeff Cody
909643c227
HTTP Module: Keep scanner.config immutable during scans (#245)
The Scanner.config struct is a configuration for all instances of
Scanner.  Scanner.Scan() is called concurrently by multiple worker
goroutines; while Scanner is dereferenced before the call, the config
struct is a pointer, and so modifications to it will affect all other
running scans done with that Scanner.

Make sure we treat it as immutable during anything invoked by
Scanner.Scan() in the http module.

https://github.com/zmap/zgrab2/pull/245
2020-02-19 14:31:12 -05:00
David Adrian
11425ac78b
Add Description() to ScanModule (#248)
This abstracts more of the help text into the ScanModule definition,
removing some more of the need for `zgrab2.AddCommand()`

https://github.com/zmap/zgrab2/pull/248
2020-02-18 10:24:04 -05:00
Julian Kornberger
f5b169cbd4
Trim SMTP response (#237)
this avoids to have \r\n in the error message
2020-02-03 16:52:37 -08:00
Jeff Cody
82da88e34d
Let HTTP scanner use the custom resolver
If both an IP address and a domain are specified for a scan, have the
HTTP scanner use a fake resolver in the DialContext, so that we always
scan the intended IP and Domain name pair.

However, make sure redirects still function as normal, so only use our
fake resolver if the domain name matches the original targeted domain
name.

In addition, the custom resolver is only used if the network specified
is one that supports domain names.
2020-01-31 14:40:36 -05:00
Jeff Cody
d12c70e5de Honor port override when composing URL (#233)
Commit a38194a added an optional port override as part of the
scan target.  The HTTP and IPP modules, however, still compose
the URL (and select http vs https) by ignoring the override.

This checks for the override, and if present uses the scan target
port.  Otherwise, it falls back to the config port.

https://github.com/zmap/zgrab2/pull/233
2019-11-20 10:14:18 -05:00
cy
0b6d1d994d fixed bug for io.EOF on fox moudle (#207)
fox read with  io.EOF ,but the data  has been returned

https://github.com/zmap/zgrab2/pull/207
2019-09-23 20:51:09 -04:00
Jeff Cody
fb49609733
Remove GetPort() from modules
The previous patch allows the port to be specified in the
`ScanTarget{}`.

Since the port option in the Config may not be the port currently being
scanned, delete the `GetPort()` function provided by each module.

The `GetPort()` function is also not used.  While we could just change
the meaning of this function, to mean "Return the port in the Config",
it is probably better to go ahead and just remove all references to it
as there are no users.
2019-08-21 14:55:14 -04:00
Zakir Durumeric
28cde1a5a6
Add SSH Client Hello Only flag (#215) 2019-08-15 17:01:24 -07:00
Ricky Diaz Gomez
98b142ec2e Redis: Made major, minor, and patchlevel be pointers to ints so that they're correctly omitted 2019-06-28 16:30:12 -04:00
Ricky Diaz Gomez
67fbf1facb Redis: Store the major, minor, and patchlevel as ints as well as the whole version as a string 2019-06-28 15:54:11 -04:00
Ricky Diaz Gomez
7c651c0be5 Redis: Updated setting suffix -- zero value is already empty string 2019-06-25 12:57:40 -04:00
Ricky Diaz Gomez
31788624f2 Redis: Added max file size check 2019-06-25 11:57:47 -04:00
Ricky Diaz Gomez
41df4251b6 Redis: Removed break statement when iterating through INFO response 2019-06-21 16:37:55 -04:00
Ricky Diaz Gomez
bcaf844200 Redis: Made check so that if line_prefix_suffix only contains prefix, adds empty string to suffix index 2019-06-21 16:14:13 -04:00
Ricky Diaz Gomez
f71548ed94 Redis: Missed an old bool check 2019-06-20 17:14:30 -04:00
Ricky Diaz Gomez
84ffc2c667 Redis: Updated the break condition when looking for fields within info_response 2019-06-20 12:17:26 -04:00
Ricky Diaz Gomez
4446024636 Redis: Changed commandMappings to map[string]string, fixed QUIT err=io.EOF bug, and capture redis_mode now 2019-06-19 16:06:43 -04:00
Ricky Diaz Gomez
e12f32b521 Redis: Now gather the OS the server is running 2019-06-19 09:51:40 -04:00
Ricky Diaz Gomez
5be58b2b0d Redis: Actually send the custom commands and store the responses. Also updated the zschema 2019-06-17 17:32:51 -04:00
Ricky Diaz Gomez
f0d9070733 Redis: Takes JSON/YAML file that allows for renaming of commands 2019-06-17 15:23:56 -04:00
Jeff Cody
b69c22c532
SMB: Probe for SMB1 in addition to SMB2
If the probe for SMB2 fails, close the connection and then try probing
for SMB1 as a backup.

Since there are more SMB2 servers in the wild, that is the first
attempt.
2019-06-10 17:17:20 -04:00
Jeff Cody
f2b76412fb
SMB: Combine 'GetSMBLog()' and 'GetSMBBanner()'
These two functions are largely duplicates, and only differ in the
boolean option passed to LoggedNegotiateProtocol().  Combine the
functions, and just take that option in as an argument to pass along.
2019-06-07 16:54:26 -04:00
AnthraX1
bcc4b05d6c Add custom regexp banner grabber (#199)
https://github.com/zmap/zgrab2/pull/199
2019-04-11 17:29:34 -04:00
Benjamin VanderSloot
93f30ef698 Use Target Domain name in SNI when using HTTP
Previous addition of GetTLSConfigForTarget (811eb38) did not modify
HTTP module to use SNI. This let to the very cryptic unknown-error:
remote error: internal error. Some servers give Fatal alerts when
they don't get an SNI extension. Discovered on a `Pagely-ARES/1.3.21`
Server
2019-03-01 21:29:22 -05:00
justinbastress
9f19df743e
Merge pull request #176 from sdnewhop/master
SSH: Add banner grabbing
2019-01-23 15:25:29 -05:00
justinbastress
4a6dfdbcc4
Merge pull request #146 from zmap/jb/fixSNI
TLS SNI fixes / API cleanup
2019-01-23 13:43:31 -05:00
Justin Bastress
fd322d3ecd fix missing format specifier 2018-12-18 16:32:44 -05:00
Jeff Cody
ec59b49540
Add support for BytesReadLimit parameter in BaseFlags
Some protocols may require more data than others.  To accomodate those,
allow the BytesReadLimit to be changed by means of BaseFlags.

By setting BaseFlags.BytesReadLimit prior to calling .Open(), scanners
can override the default limit to one that is appropriate for the data
collected.
2018-10-22 21:59:01 -04:00
Oleg Broslavsky
d5aaeca283 Add SSH banner grabbing when userauth enabled
- Bump lib/ssh from golang.org/x/crypto/ssh (just banner hadling)
- Add a banner field to the SSH module info
2018-10-20 03:39:24 -04:00
Justin Bastress
8c71100b9e gofmt it 2018-10-08 11:27:06 -04:00
cy
2e94480cce
To ensure that the HTTP connection is not blocked! 2018-10-05 14:59:28 +08:00
cy
d5258bdc6e
To ensure that the HTTP connection is not blocked!
https://github.com/zmap/zgrab2/issues/171
2018-10-05 14:51:14 +08:00
Justin Bastress
65a7c8a578 Merge branch 'jb/session-wide-timeout' into jb/mssqlBoundsChecking 2018-10-01 14:25:04 -04:00
Justin Bastress
6618920234 add some tighter bounds checking in MSSQL scanner, and if there is an uncaught panic, log the body that caused it 2018-10-01 11:08:26 -04:00