* 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>
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.
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.
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
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
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.
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
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.
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.
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.
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
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.