Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

zgrab: log target address/port on panic #305

Merged
merged 2 commits into from
Feb 20, 2018

Conversation

justinbastress
Copy link
Contributor

@justinbastress justinbastress commented Jan 29, 2018

If there is a panic() while scanning a target in GrabBanner, trap it and log the target to the standard logger at the ERROR level, before re-throwing the panic.

How to Test

There is no place place that intentionally panics, so I have been testing by adding a panic() call to e.g. Scan@modules/ftp.go.

Notes & Caveats

This arose from debugging https://ichnaea.eecs.umich.edu/admin/tasks/a47e2ae2-4f47-4ae4-86da-b8cc3a85a5c9 -- since the code panicked, the IP address did not get written to the output. We don't log the IP in non-panic cases since in those cases, the IP address should be available in the output.

Issue Tracking

Re https://trello.com/c/CcL2qo60/1191-zgrab-https-scan-segfault, which was fixed by zmap/zcrypto#107.

@zakird
Copy link
Member

zakird commented Jan 29, 2018

oh that's awesome! I didn't know you could do that in golang!

@justinbastress justinbastress merged commit 4d61f56 into master Feb 20, 2018
@justinbastress justinbastress deleted the feature/logTargetOnPanic branch February 20, 2018 14:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants