Commit Graph

24 Commits

Author SHA1 Message Date
parkanzky
264b811a72
Merge pull request #156 from zmap/paul/mongodb
Add MongoDB scanner.
2018-08-22 13:54:28 -04:00
Paul A. Parkanzky
d9aec0ae40 Improve partial results for mongodb scanner
* Separate out isMaster and buildInfo commands
* Return results of both in separate sub-structs
* Include isMaster results regardless of whether buildInfo succeeds
2018-08-22 11:49:17 -04:00
Justin Bastress
a139cc9349 add missing 'constraint' field for postgres_error 2018-08-22 10:07:59 -04:00
Paul A. Parkanzky
7419796cfc Address more PR comments
* Add error message to invalid BSON log msg
* Use snake case for json output
* Update affect integration tests
2018-08-21 16:34:35 -04:00
Paul A. Parkanzky
8b9c23f122 Fix typo and integration test which tested for it 2018-08-21 16:01:40 -04:00
Paul A. Parkanzky
2f316b2242 Add mongodb integration tests. 2018-08-21 13:11:34 -04:00
Chris Dzombak
d8bba99313
Stop marking fields as “required” (#158)
This causes problems when trying to load data into BigQuery if, for example, an entire protocol or subrecord is unpopulated.
2018-08-21 12:33:26 -04:00
Justin Bastress
ecbd12f11a note source location 2018-08-20 12:04:35 -04:00
Justin Bastress
1e4f4b9b51 Enums are Strings, but this value is actually a uint32 2018-08-20 12:03:18 -04:00
justinbastress
e3e5189068 Replace Strings with WhitespaceAnalyzedStrings
https://github.com/zmap/zgrab2/pull/155
2018-08-14 14:37:39 -04:00
Clayton Zimmerman
8318aae089
Changes CertType's id field to an Enum of strings, as ES expects. (#154) 2018-08-03 13:59:05 -04:00
Clayton Zimmerman
6cffb7a888
IPP: document output fields (#151)
Documents fields of IPP scan results in schema.
2018-07-11 13:31:34 -04:00
Clayton Zimmerman
c11be290dc
Feature/IPP: Fix Retry-TLS and Collect All IPP Attributes (#143)
* Correctly enables TLS only during retry grab when retry-tls flag is set.
* Fixes evaluation which caused too many arguments error in IPP integration test.
* Updates IPP zgrab2 schema to reflect storing all attributes in response.
* Adds Attributes member to ScanResults
* Ensures tryReadAttributes only reads attributes in the case of a postive detection. Cleans up isIPP
* Reads all attributes in IPP response
* Detects invalid length errors when reading IPP attributes.
* Returns the correct amount of uris, ipp versions, and cups versions in ScanResults.
2018-07-09 14:39:54 -04:00
Clayton Zimmerman
9bbd62a5b6
(IPP) improve scan output (#140)
* Refactors sending IPP request and handling errors thereof into sendIPPRequest()

* Adds dependency of IPP zgrab2 schema on HTTP zgrab2 schema.

* Refactors out trying to grab with multiple versions into re-usable function.

* Determines whether to output nil result in a concise and accurate manner.

* Refactors reading attributes present in IPP response to its own function. Calls that in Grab and augmentWithCUPSData. Formats code using Go fmt.

* Rejects successful non-IPP responses with protocol error. Reports HTTP errors.

* Removes circular dependency upon http zgrab2 schema.

* Changes name of objects to make IPP schema actually work.
2018-06-28 14:58:40 -04:00
justinbastress
713150b089 merge client/server header list (#134)
* merge client/server header list

* fix formatting of header.go
2018-06-28 14:46:19 -04:00
Clayton Zimmerman
9b00db7f29
Feature/create ipp module (#137)
* Changes grab to return *ScanResults. Implements ippInContentType correctly.

* Slots in an operational re-working of several HTTP module functions, and adds dependency on zgrab's http module. Includes some laregly copy-pasted sections worthy of scrutiny.

* Adds support to retry failed HTTP over HTTPS. Removes vestigial functions.

* Implements sending CUPS-get-printers request if CUPS is detected, yielding more detailed & accurate version information. Also handles URI's more correctly.

* Creates separate container to run IPP over TLS on CUPS. Runs basic tests against both containers.

* Creates virtual printer on each container to test for augmenting data with CUPS-get-printers request (which only works when printers exist).

* Augments version information with CUPS-get-printers response if possible.

* Allows specifying IPP version in constructed requests. Checks for version-not-supported server error.

* Allows resending IPP requests with different versions if we hit a version-not-supported error.

* Updates IPP zgrab2 schema to include fields added in modules/ipp/scanner.go

* Removes unnecessary TODO's

* Updates testable example for new definition of AttributeByteString

* Removes versionNotSupported's dependency on bufferFromBody. Checks bounds on generated requests' fields correctly.

* Updates zgrab2 IPP schema to match ScanResults object in modules/ipp/scanner.go

* Corrects IPP tests, bounds checking, zgrab schema formatting.

* Logs errors for unexpected behavior in buffer io operations. Updates schema to include standalone fields for attributes described in CUPS-get-printers response.

* Logs at debug level only when verbose flag is set. Prints accurate error message when CUPSVersion test fails.

* Handles HTTP request errors before checking for nil response/body. Fixes and tests convertURIToIPP.
2018-06-26 12:00:27 -04:00
Clayton Zimmerman
2afd7d8a2d Addresses comments from pull request #135. Makes ipp Dockerfile conform to best practices. Makes reference to IPP RFC where appropriate. 2018-06-12 17:00:52 -04:00
Clayton Zimmerman
ffaeeab0f1 Cleans up TODOs and includes more results to collect from scans. 2018-06-12 09:27:45 -04:00
Clayton Zimmerman
b076c7b005 Boilerplate for IPP scan module. 2018-06-07 15:13:01 -04:00
David Adrian
b9fdae7774 Make auth mode enum optional
This gets lifted out of the subrecord in other schemas, which makes it
optional in them. This is the easiest way to fix that, although it is
indicative or an underlying problem.
2018-06-01 10:30:54 -04:00
Justin Bastress
c35a9f29e2 add missing _unknown_error_tag to postgres error schema 2018-05-31 10:56:16 -04:00
Justin Bastress
a14f3dc584 include negotiated encrypt_mode 2018-05-22 17:06:48 -04:00
Justin Bastress
486dc517a3 fix required/non-required in schemas; add error_ids, and code to get them; throw ERRPacket as APPLICATION_ERROR 2018-05-21 12:15:17 -04:00
Justin Bastress
1e4ec64650 schemas.zgrab2 -> zgrab2_schemas 2018-05-04 11:15:09 -04:00