clayzim
3fa42bef49
Parses empty attribute-groups correctly by skipping to the next one.
2018-07-10 15:16:30 -04:00
clayzim
544652de9d
Resolves merge conflict to fix timeouts.
2018-07-10 15:10:24 -04:00
Justin Bastress
2a4ffcc3d9
BaseFlags.Timeout is already a duration
2018-07-10 14:25:25 -04:00
clayzim
e77e11cb7f
Compensates for change in Scanner.config.BaseFlags.Timeout's type. No longer casts to time.Duration.
2018-07-10 14:05:20 -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
Justin Bastress
811eb38754
Add GetTLSConfigForTarget and GetTLSConnectionForTarget methods (allowing SNI to work without an explicit --server-name); Add scanTarget.OpenTLS() to give a uniform interface; Document TLS scan; use target.OpenTLS(), correctly report successful/failed detections
2018-07-05 14:34:17 -04:00
Alex Holland
4f046b3085
Implement timeout to accept float value ( #111 )
...
* Implement timeout as a float value vs int
* remove unnecessary second multiplier
* whoops, missed one
* Switch type to time.Duration
* Fixup integration tests, change default and description
* Whoops, bad merge
* fix build
2018-07-02 13:00:45 -04:00
Justin Bastress
3e76d14900
use standard method to get host in SSH scanner
2018-06-28 16:52:29 -04:00
Justin Bastress
ccbf497b84
resolve conflict with utility.go
2018-06-28 16:05:48 -04:00
justinbastress
724d02d90d
read full banners ( #103 )
...
* read full banners
* account for cases where smaller packets are returned
2018-06-28 15:06:39 -04:00
Zakir Durumeric
681d6e0a56
Merge branch 'master' into ah/trigger
2018-06-28 15:05:12 -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
Alex Halderman
0c597e5a8d
Merge branch 'master' into ah/trigger
2018-06-26 17:53:20 -07:00
J. Alex Halderman
0c8413c8cd
mend
2018-06-26 13:59:36 -04:00
J. Alex Halderman
cd2070d3bc
mend
2018-06-26 13:57:28 -04:00
J. Alex Halderman
9df97e03cf
Add support for tags and triggers.
2018-06-26 13:51:10 -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
6456dda5e1
Implements basic scanning, without checking for correct protocol.
2018-06-11 12:02:42 -04:00
Clayton Zimmerman
b076c7b005
Boilerplate for IPP scan module.
2018-06-07 15:13:01 -04:00
Justin Bastress
c35a9f29e2
add missing _unknown_error_tag to postgres error schema
2018-05-31 10:56:16 -04:00
Justin Bastress
01cd84926e
Strip/cap the output value length; include output error in cases where format was not expected
2018-05-25 17:01:31 -04:00
Justin Bastress
71090d71b3
handshakeErr, not err
2018-05-22 18:23:19 -04:00
Justin Bastress
a14f3dc584
include negotiated encrypt_mode
2018-05-22 17:06:48 -04:00
Justin Bastress
05841e9ab4
raw_packets is debug; server_version is omitempty
2018-05-22 16:05:56 -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
89e0e956d5
MSSQL: Strip null terminator from instance_name; changeInstanceName to a pointer to distinguish the empty names (e.g. just a null terminator) from no name being returned.
2018-05-18 15:25:08 -04:00
Justin Bastress
f3437bbc62
don't log full packet; don't create packet until returning
2018-05-17 14:36:51 -04:00
Justin Bastress
3ffbf89c36
lower max packet size to 512k, not 128MB. Add maximum on number of packets as well.
2018-05-15 15:47:14 -04:00
Justin Bastress
bf1d74483e
fix packet length calculation
2018-05-15 14:16:51 -04:00
Justin Bastress
88707e7a87
fix comment typo
2018-05-14 14:48:48 -04:00
Justin Bastress
531ba31c34
Add memory and CPU profiling (if ZGRAB_[MEM/CPU]PROFILE is set); add upper bound on data read from postgres
2018-05-14 11:24:25 -04:00
Justin Bastress
b5fbfcc690
ensure postgres connections get closed
2018-05-11 14:01:10 -04:00
Justin Bastress
e4388ad861
handle server returning < 2 bytes
2018-05-11 12:21:11 -04:00
Justin Bastress
7dc895a975
fix logrus collision
2018-05-11 11:52:08 -04:00
Justin Bastress
0cfc4bdff3
lower log level of per-scan errors
2018-05-11 11:45:59 -04:00
Justin Bastress
e77866dfea
loglevel fixes
2018-05-11 11:43:08 -04:00
Justin Bastress
e0745c5323
another err->readErr
2018-05-11 11:18:20 -04:00
Justin Bastress
50e2dbbeb7
fix error variable name
2018-05-11 10:56:38 -04:00
Justin Bastress
3254857b58
Add a dialer for the non-TLS case in HTTP, so that --timeout is honored even if --use-https is not set (issue #109 )
2018-05-01 13:33:21 -04:00
justinbastress
5c0cbeeee0
Merge pull request #97 from zmap/feature/stripDebugFields
...
zgrab2: Strip debug fields
2018-04-26 12:27:39 -04:00
Justin Bastress
42ae30babe
add --retry-https flag to work with unknown HTTP/HTTPS servers; remove unused request.tls field from zschema (only used for HTTP servers, caused zschema errors because of ListOf(ListOf()))
2018-04-05 14:19:58 -04:00
Justin Bastress
7a013ca261
Add output unit tests; add output.Process to strip debug; make MySQL debug fields omitempty too; use processor to strip data in Process()
2018-04-03 17:15:20 -04:00
Justin Bastress
c358b52018
add Protocol method
2018-03-26 11:46:27 -04:00
Justin Bastress
24ab7e93d5
merge master
2018-03-26 11:31:35 -04:00
Justin Bastress
714e8f1833
address @dadrian's comments -- clean up schema, fix godoc formatting
2018-03-26 11:25:04 -04:00
Justin Bastress
13c4944e91
add siemens s7 scanner
2018-03-22 17:06:44 -04:00
Justin Bastress
8f91d369fc
port fox scanner from zgrab
2018-03-22 15:33:42 -04:00
Justin Bastress
83212a722e
add dnp3.go
2018-03-21 17:17:38 -04:00
Justin Bastress
04db34a3af
Merge branch 'master' into feature/closeConnections
2018-03-21 17:17:23 -04:00
Justin Bastress
087337935b
clean up connections before exiting
2018-03-21 17:16:58 -04:00
Justin Bastress
735cb3a4c3
port DNP3 scanner
2018-03-21 16:52:53 -04:00
Justin Bastress
1c84990382
port BACNet from zgrab
2018-03-21 16:27:28 -04:00
Justin Bastress
45a96cf40a
make requestID configurable
2018-03-21 11:49:26 -04:00
Justin Bastress
c2aefe4ecd
remove debug
2018-03-21 10:39:56 -04:00
Justin Bastress
0f7a265bdd
add modbus scanner
2018-03-21 10:36:58 -04:00
Justin Bastress
1024fb4619
break out early if !setup-session; make debug configurable
2018-03-16 14:34:15 -04:00
Justin Bastress
586992cb15
More comments; make old zgrab behavior the default
2018-03-16 14:00:12 -04:00
Justin Bastress
d47c97d830
remove debug code
2018-03-16 13:36:53 -04:00
Justin Bastress
65d1789860
comments; update schema
2018-03-16 13:21:05 -04:00
Justin Bastress
c05c00a743
Pull in updated SMB library, modify it to take logs, use it in scanner
2018-03-16 12:08:59 -04:00
Justin Bastress
70314ce92b
Port SMB (???) scanner from ZGrab
2018-03-15 16:58:57 -04:00
justinbastress
85f4b8f06a
Merge pull request #78 from zmap/feature/portIMAPModule
...
zgrab2: Port IMAP scanner from zgrab
2018-03-15 15:28:21 -04:00
justinbastress
46737b418c
Merge pull request #77 from zmap/feature/addSMTPModule
...
zgrab2/SMTP: add SMTPS support
2018-03-15 14:50:22 -04:00
Justin Bastress
aa4c966d0d
add basic IMAP scanning
2018-03-15 14:35:35 -04:00
Justin Bastress
d12eb17aa4
add SMTPS support
2018-03-15 13:35:58 -04:00
Justin Bastress
f1c9bfbc89
merge master
2018-03-15 13:12:21 -04:00
Justin Bastress
ad6295f421
port POP3
2018-03-15 13:10:10 -04:00
Justin Bastress
57bc835bcf
Add integration tests; Post PR comment updates: stray further from original ZGrab input/output in favor of more zgrab2-like input/output; make QUIT optional (default off).
2018-03-15 11:07:18 -04:00
Justin Bastress
89911eff01
merge master
2018-03-14 17:22:12 -04:00
Justin Bastress
37b54205f8
lint/comment SMTP
2018-03-14 17:19:27 -04:00
Justin Bastress
20cde3441d
add missing telnet.go
2018-03-14 09:59:46 -04:00
Justin Bastress
f09d31c65a
add SMTP
2018-03-14 09:18:54 -04:00
Justin Bastress
fa6a7ce50c
port telnet module from zgrab; add basic integration tests and schema
2018-03-13 15:23:57 -04:00
Justin Bastress
17a5c0e85c
Scanner modules return the protocol ID, scan returns the protocol in the results.
2018-03-12 13:36:11 -04:00
Justin Bastress
af63437659
godoc
2018-03-01 15:31:15 -05:00
Justin Bastress
a490023c1d
Merge branch 'master' into feature/addOracleModule
2018-03-01 14:32:43 -05:00
Zakir Durumeric
2ec074a082
Merge pull request #58 from zmap/feature/lintFTP
...
golint / godocs on zgrab2 FTP module
2018-03-01 11:12:06 -08:00
Justin Bastress
30145afc5a
golint
2018-02-28 16:21:27 -05:00
Justin Bastress
f2b34ed54e
fix comments
2018-02-28 16:09:58 -05:00
Justin Bastress
f322d0b691
less panic
2018-02-28 16:08:33 -05:00
Justin Bastress
67a4af48f7
cleanup; fewer panics/less panic; package docs; remove unused code
2018-02-28 15:42:03 -05:00
Justin Bastress
6fbbc0a182
clean up output; add ReleaseVersion tests
2018-02-28 13:16:52 -05:00
Justin Bastress
f61e698ea3
MSSQL -> Oracle
2018-02-28 09:46:40 -05:00
Justin Bastress
9996c765e9
godocs; param validation
2018-02-27 16:27:09 -05:00
Justin Bastress
7a61e3b2a9
use TNSDriver in tests
2018-02-27 16:26:32 -05:00
Justin Bastress
b8d979e3b1
golint; godocs; add TNSDriver to handle multiple TNSHeader formats
2018-02-27 16:26:16 -05:00
Justin Bastress
e06794df8b
use TNSDriver for raw packet operations; godocs / golint; validate input
2018-02-27 16:25:30 -05:00
Justin Bastress
5c528de288
Merge branch 'master' into feature/addOracle
2018-02-27 14:46:19 -05:00
Justin Bastress
7255168761
update tests -- add descriptor tests
2018-02-26 16:08:20 -05:00
Justin Bastress
9a244f5dbe
godocs; ConnectionString -> ConnectDescriptor; update default ConnectDescriptor; add handling for Refuse to types.go; descriptor parsing
2018-02-26 16:07:33 -05:00
Justin Bastress
630333fdd8
add experimental TCPS support to scanner
2018-02-26 16:05:44 -05:00
Justin Bastress
f8ec8b94ec
add Refuse handling to Connection
2018-02-26 16:05:07 -05:00
Justin Bastress
9a5549940f
add redirect; godoc for connection.go; remove debugging from tests
2018-02-22 17:21:57 -05:00
Justin Bastress
5c081acbe5
godocs; move output encoding to use outputBuffer
2018-02-22 09:53:42 -05:00
Justin Bastress
d4054673e2
Update ServiceOptions names
2018-02-21 13:12:51 -05:00
Justin Bastress
4ee7c2a91f
add oracle.go stub
2018-02-21 13:08:33 -05:00
justinbastress
b206b953e8
Expand NTP docs ( #59 )
2018-02-21 10:04:57 -05:00
justinbastress
730b7221ca
Update MSSQL GoDocs ( #60 )
...
* re-export mssql primitives; golint; expanded godocs; log whether we ever read a valid TDS packet; move ServerVersion string conversion into ServerVersion method
* add package godocs; re-export module items; populate InstanceName; set default EncryptMode == ENCRYPT_ON; detailed scan godocs; fix return value in case of failed / incomplete detection;
2018-02-21 10:04:25 -05:00