Commit Graph

38 Commits

Author SHA1 Message Date
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
e4bd0bcc89 move process tests 2018-04-02 16:10:01 -04:00
Justin Bastress
e82d5b4cfd add process tests 2018-04-02 16:09:41 -04:00
Justin Bastress
53e35bbaa7 prevent multiple concurrent usages of the same processor; copy all fields, nil out debug ones; 2018-04-02 16:09:27 -04:00
Justin Bastress
58601e045a add output processing 2018-03-30 16:28:24 -04:00
Luke Valenta
b4ac16e630 add H field to xssh server signature to allow signature verification (#95) 2018-03-29 10:17:39 -04:00
Justin Bastress
199fe5d8e5 PEP8 updates; fix NTLM typo 2018-03-16 14:39:06 -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
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
075924400f
Add shared FlagsToSet function in output.go (#62)
* Add shared FlagsToSet function in output.go, use it in mysql. Add examples / tests.

* Add utility functions to widen map keys
2018-03-01 14:32:12 -05:00
justinbastress
bd952d9809
golint and godocs for mysql module (#56) 2018-02-12 10:42:45 -05:00
justinbastress
2766a7ae08
Port http from zgrab (#31) 2018-02-09 13:45:50 -05:00
Jordan Wright
162138dac3 Changed tools/keys dependencies to point to zgrab2. 2018-01-30 23:45:52 -06:00
justinbastress
f49887290d
Implements postgres zgrab2 module (#30)
* remove unnecessary indirection on net.Conn

* Ignore *.pyc

* fix NPE on nil handshake

* refactoring -- move status to status.go; add Open() methods for ScanTarget

* cherry-pick .gitignore fix

* pull in TLS fix

* status.go comments

* trim over-generalizations

* use /usr/bin/env bash instead of absolute path

* remove debug tcpwrap

* add integration tests for postgres

* hack for cleanup.sh to work on mingw -- use //var/lib instead of /var/lib

* cleanup should actually stop the process though

* comments / rearrange

* Bump up timeout in postgres tests; only pass user if explicitly requested to do so

* add schema stubs to new.sh

* Integration test fixes -- use /usr/bin/env bash; log all validation failures

* add postgres schemas

* fill out zcrypto.client_hello schema

* handle early get of TLSLog

* postgres: return SCAN_SUCCESS on success

* cleanup

* fix new.sh

* fix typo

* postgres container cleanup

* build.sh docs

* standardize container/image names

* add not to check for success

* shift mysql's connection management to ScanTarget.Open(); wrap Read/Write methods returned by ScanTarget.Open() to enforce timeouts

* catch schematically-valid but non-successful scans

* postgres: clean up output format; more scanning

* cleanup; better error handling; get detailed protocol version error

* refactor modules

* clean up dangling connections

* split gigantic postgres.go

* remove unused

* ServerParams gets its own type

* refactor integration tests: run zgrab2 in its own container, which is linked to the service containers, so that we don't need to keep track of unique ports on the host any more

* rename entrypoint; remove duplicate postgres tests

* comments for postgres schema

* Use param expansion to check for env variable [minor]

This is a *very* minor change to `docker-runner/docker-run.sh` checks to
see if the environment variable required to run the script has been set
to a non-empty string. If not, the script exits with a non-zero status
code and displays a default message:

```
❯ docker-runner/docker-run.sh
docker-runner/docker-run.sh: line 7: CONTAINER_NAME: parameter null or not set
```

This was the behavior before, but just uses a one-liner declarative bash
idiom.

For further reading on parameter expansion, see
https://stackoverflow.com/a/307735.

@justinbastress can tell me if I did something wrong and broke the
intent of the script :-)

* Add integration_test targets to makefile; use makefile instead of directly calling go build everywhere; run postgres schema through PEP8 linter

* use make in docker-runner entrypoint

* add .integration_test_setup to .gitignore

* more .gitignore items

* Makefile updates: Windows support; add docker-runner target; better cleanup.

* docker-runner Dockerfile: start from zgrab2_runner_base image

* cleanup postgres setup

* make travis use make

* add .gitattributes, try to prevent it from overriding lfs with crlfs in shell scripts at least

* fix folder name in Makefile

* update go (one of our dependencies now works only with >= 1.9)

* From travis: `I don't have any idea what to do with '1.9.0'.`

* explicit clean make

* fix dep order

* fix build.sh location

* popd

* use make to ensure zgrab2_runner exists

* Make docker-runner an order-dependency for integration-test-cleanup; don't do a cleanup after each integration test

* use explicit tag name for zgrab2_runner

* Add container-clean target to Makefile, to remove cyclic dependency on docker; use .id files to track docker images; add servce-base image; use Make to build / track images

* use LF in Makefiles; update .gitignore; use zgrab_service_base image in ssh container; fix line endings (?)

* remove overzealous cleanup

* let setup continue even if some containers are already running

* zgrab depends on *.go

* docker-runner depends on zgrab2 binary

* clean output before running integration tests
2018-01-15 14:24:57 -05:00
justinbastress
a5d8d0b57a
remove unnecessary indirection on net.Conn (#27) 2017-12-19 16:21:16 -05:00
justinbastress
a244ec15e6 TLS scan prototype + Travis integration (#25)
* Fix typo

* Actually call init per sender for each goroutine

* split out TLS handling

* Rename tls_handshake; update docs

* fix comments

* format fixes

* merge updates

* fix path

* refactor heartbleed logging (now the same as original zgrab)

* add ScanStatus, update modules to return it

* fix threaded for loop; fix styling of dict literal

* fix compile errors, note un-bubbled handshake error

* initial schema commit

* fix comment

* schema cleanup

* comments

* fix TODOs

* first attempt at docker integration in travis; also add schema validation

* add integration_tests.sh

* need sudo?

* try pip install --user

* revert regression

* add docker service again

* chmod +x integration_tests.sh

* fix path of binary

* Dump output file to stdout

* travis work

* use jp's build-self-contained script

* use go get/go build to get jp

* fix jp path

* switch from bogus regex to wildcard

* do all mysql versions; fix version comparison

* re-enable notifications; fix successful version check log message; comment TryGetScanStatus

* move to conf.d layout for integration tests

* update README

* add missing scripts

* add ./ to path
2017-12-15 09:25:17 -05:00
Justin Bastress
87f2825cac fix imports in test-only files 2017-12-08 16:03:31 -05:00
Justin Bastress
577e79cb54 fix zgrab/zgrab2 paths in lib/ssh 2017-12-08 15:42:29 -05:00
Justin Bastress
45ae3c1f0c switch from flagsToList to flagsToSet 2017-12-08 13:39:21 -05:00
Justin Bastress
162c71e95e fix ReservedOmitted tags; strip trailing NUL terminator in AuthPluginName; encode AuthPluginData as a []byte not a string 2017-12-07 16:16:53 -05:00
Justin Bastress
b9fdd24b1f Add output conversions; add debug tags to less-useful fields (not currently consumed) 2017-12-07 15:57:40 -05:00
Justin Bastress
d561fcdba7 omitempty on optional values 2017-12-05 21:32:17 -05:00
Justin Bastress
c64cb23fbc switch from a PacketLog list to a ConnectionLog with enumerated entries 2017-12-05 14:02:14 -05:00
Justin Bastress
6dae547826 add usage info 2017-12-04 12:25:57 -05:00
Justin Bastress
e96b7bd419 Omit normal reserved data from output 2017-12-04 12:06:14 -05:00
Justin Bastress
b70c8d84ce remove redundant Packet.GetType() 2017-12-04 11:15:14 -05:00
Justin Bastress
ecf8690e96 Remove GetDescription(); formatting fixes 2017-12-04 10:55:55 -05:00
Justin Bastress
9de9ee9f17 Remove underscores 2017-12-04 10:19:47 -05:00
Justin Bastress
837a4b57da NewConfig -> InitConfig 2017-12-04 09:37:04 -05:00
Justin Bastress
41f3e53069 Link capability flags definitions in MySQL Reference Manual 2017-12-04 09:35:21 -05:00
Justin Bastress
505d2d0281 add MySQL module 2017-11-27 13:00:31 -05:00
Alex
c6a009d85b Couple of bug fixes, do clientID and verbose 2017-10-22 21:19:49 -04:00
Alex
9bbc2ea8f4 Name changes to library, remove global config 2017-10-22 21:19:49 -04:00
Alex
f99445c05b sed name changes 2017-10-22 21:19:49 -04:00
Alex
677f2064b1 initial import ssh from zgrab 2017-10-22 21:19:49 -04:00