Commit Graph

568 Commits

Author SHA1 Message Date
svbatalov
11611670fe
Adds --hex option to banner module (#325)
Conversion of binary responses to UTF8 occasionally yields U+FFFD [replacement characters](https://en.wikipedia.org/wiki/Specials_(Unicode_block))
(see #197, #263). As a result it is not possible to restore the original response.

This introduces the `--hex` option to the `banner` module. When enabled,
the `banner` value will contain server response in hex.

Refs #197, #263

https://github.com/zmap/zgrab2/pull/325
2021-08-29 17:00:18 -06:00
Houlton McGuinn
a70b93322f
remove masking of s7 protocols errors (#322) 2021-07-30 12:13:55 -04:00
Houlton McGuinn
904ea05789
add jarm-go to go.mod (#321) 2021-07-30 12:13:41 -04:00
Elliot Cubit
a1d5e930ca
smb: allow dynamic length fields of exact length (#323) 2021-07-26 15:57:24 -04:00
Tom Sellers
6a8e4f5abe
README.md - minor typo correction (#320) 2021-07-19 14:15:15 -06:00
Zakir Durumeric
ade0a8c420
Update README.md 2021-07-07 15:40:13 -07:00
Houlton McGuinn
f9dcf9f703
Add error handling for FTP TLS handshake (#314)
Co-authored-by: Houlton McGuinn <houlton@censys.io>
2021-06-07 23:17:59 -04:00
Silas Cutler
9a23e804e3
Added JARM fingerprinting module (#282)
JARM is an active-fingerprinting technique developed by Salesforce. It was released https://github.com/salesforce/jarm and a write-up on it can be found at: https://engineering.salesforce.com/easily-identify-malicious-servers-on-the-internet-with-jarm-e095edac525a

Co-authored-by: Silas Cutler <silas@blacklab.io>
2021-06-06 19:15:28 -06:00
David Adrian
daaf631ad2 Delete .travis.yaml 2021-06-06 18:57:40 -06:00
engn33r
ee0da7b609
First draft of GitHub Action (#309)
https://github.com/zmap/zgrab2/pull/309
2021-06-06 18:55:53 -06:00
engn33r
577c906710
First draft of GitHub Action (#309)
This does not run the integration tests.

https://github.com/zmap/zgrab2/pull/309
2021-06-06 18:55:15 -06:00
AG
ecd32d0d5d
Feature fail http to https for known status code and substrings (#308)
* Add `--fail-http-to-https` to retry as HTTPS when --retry-https is used and certain known responses are encountered indicating HTTPS should be used

* Apache: HTTP/400, substring "You're speaking plain HTTP to an SSL-enabled server port"
* NGINX: HTTP/400, substring "The plain HTTP request was sent to HTTPS port"

* Add additional substring observed indicating http->https

* Add another observed substring, adjust whitespace

* Use go-ism for slicing implicitly from index 0

Co-authored-by: Adam Greene <copyright@mzpqnxow.com>
2021-06-06 11:31:36 -07:00
Meteorite
2b6e6cb2ec
update zflags module to new version (#243)
Co-authored-by: Zakir Durumeric <zakird@gmail.com>
2021-06-06 11:30:01 -07:00
Rick van Schijndel
ed21e07e04
Fix incorrect logging calls that don't do formatting (#290)
The errors can be found by running `go vet`.
Found these issues while packaging.
2021-06-06 11:27:01 -07:00
Anthr@X
fcd8f0dc1c
Read probe from file (hex probe support) (#269)
* Adds TLS connection to banner module

* Adds support to read probe from file

Co-authored-by: AnthraX <anthrax1@users.noreply.github.com>
2021-06-06 11:25:09 -07:00
AG
3c55bbe861
Specify arbitrary HTTP headers (#284)
* Add support for specifying arbitrary HTTP headers

* * (Minor, Comment) Fix incorrect comment, replace with more helpful (and accurate) comment
* (Minor, Linting) Rename raw_hash => rawHash, 4 occurences (linter)
* (Minor, Linting) Rename s -> scanner, 1 occurence (linter)
* (Sanity Checking) Prevent duplicate custom headers
* (Sanity Checking) Prevent attempts to set known immutable headers (host, content-length)

* Add --custom-header-delimeter for convenience, in practice, quoting the header values that contain comma can be problematic

* Make the separator consistent for both custom-headers-names and custom-headers-values. It's just weird having them be different :>

* Spelling delimiter correctly would probably help...

* Update modules/http/scanner.go

Co-authored-by: engn33r <engn33r@users.noreply.github.com>

Co-authored-by: Adam Greene <copyright@mzpqnxow.com>
Co-authored-by: Zakir Durumeric <zakird@gmail.com>
Co-authored-by: engn33r <engn33r@users.noreply.github.com>
2021-06-06 11:17:33 -07:00
AG
5e9507cacf
[BUGFIX] Set SNI on each redirect to avoid handshake failures / incorrect server name (#306)
* Set SNI explicitly, in case it's a redirect (fix for #300)

* Fix the SNI issue correctly, using the host portion of addr, while respecting --server-name and --no-sni

* Clean up double error logging pointed out by dadrien

* Comply with RFC4366, do not set SNI server name for IP address

Co-authored-by: Adam Greene <copyright@mzpqnxow.com>
https://github.com/zmap/zgrab2/pull/306
2021-04-09 13:36:07 -06:00
David Adrian
4e047842a6 stm: go get -u, fix compile errors 2021-04-06 16:49:27 -06:00
AG
0eb497e803
Add support for specifying the "PortableCiphers" cipher-suite list added in https://github.com/zmap/zcrypto/pull/238 (#302)
Co-authored-by: Adam Greene <copyright@mzpqnxow.com>
2021-04-06 16:44:47 -06:00
Elliot Cubit
17a5257565
Add NativeOS, NTLM, and GroupName to SMBv1 results (#286)
* add smbv1 session setup scan

* remove unused values

* rename os_name to native_os to match smb documentation

* remove superfluous comment

* update zschema to include new SMB fields

* improve clarity on bounds checking for SMBv1 requests
2021-03-15 09:23:55 -04:00
vl4deee11
d3d2a3746a
Fix null results in fox module (#294)
Co-authored-by: vl4deee11 <boi4enkovlad@yandex.ru>
Co-authored-by: vl4deee11 <boi4chenkovlad@yandex.ru>
Co-authored-by: vl4deee11 <boi4enkovlad@yandex>
2021-03-12 19:49:37 -07:00
vl4deee11
0d51d0d401
fix issue 288 (#289)
Co-authored-by: vl4deee11 <boi4enkovlad@yandex.ru>
2021-03-05 09:42:32 -07:00
David Adrian
31126e97ab fix compilation error introduced by #244 merge 2021-03-04 09:03:34 -07:00
Jack Cable
a9fc785eb0
Add option to flush after each line of input (#244) 2021-03-02 10:10:19 -07:00
Elliot Cubit
3c17bf32e8
Fix SMB scanner marshaller panic (#299) 2021-02-11 14:44:36 -05:00
aspacewalz
d25b7ad901
fix for smtp module (#297)
The SMTP module was matching on "STMP" when verifying the contents of the scan response. This PR fixes the typo and adds a test for the VerifySMTPContents() function.
2021-02-05 07:29:14 -05:00
Benjamin Wireman
d9ed4f141d
improves http body decoding and enforces max length (#295)
https://github.com/zmap/zgrab2/pull/295
2021-02-03 10:56:32 -05:00
Jeff Cody
3613392bf0
telnet: Optionally return result even on error (#277)
Even if the server does not respond to the telnet commands, the
banner may have useful information.  Add the option "--force-banner"
so that the banner string may be returned even on failure.
2020-10-30 10:06:46 -04:00
grace-murphy
8aa9230e29
[DATA-970] Increase buffer size in FTP scanner (#279) 2020-10-21 14:25:43 -04:00
justinbastress
dae700ea10
Merge pull request #275 from twschum/http-decoded-hash
Add option to compute http BodySHA256 on decoded BodyText

NOTE: CI errors are preexisting pop3 issues
2020-09-18 11:39:12 -04:00
Tim Schumacher
66c842d234 Put body_length behind flag to zschema 2020-09-18 11:01:46 -04:00
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
475c10307a
Merge pull request #264 from zmap/jcody/ftp-implicit-tls-opt
ftp: Add support for implicit TLS
2020-05-29 16:56:06 -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
2d92ae75e3
Merge pull request #261 from zmap/jcody/zgrab2-http-sig-override
http/tls: Add option to override SignatureAndHashes
2020-05-08 18:03:21 -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
Benjamin Wireman
d2e503881f
Allow for programaitc access of ssh result types (#260)
https://github.com/zmap/zgrab2/pull/260
2020-03-31 15:56:44 -04:00
Benjamin Wireman
145470af50
Merge pull request #258 from zmap/bw/http_encodings
https://github.com/zmap/zgrab2/pull/258
2020-03-24 10:52:39 -04:00
bwireman
8395d72fee use DetermineEncoding To try and translate page to UTF8 if possible 2020-03-21 10:51:04 -04:00