Neo23x0 / munin

Online hash checker for Virustotal and other services
Apache License 2.0
809 stars 147 forks source link

Debug parameter isn't passed to getVTInfo function #53

Open graememeyer opened 2 years ago

graememeyer commented 2 years ago

The --debug parameter isn't passed to the getVTInfo function which can result in an endless silent failure loop, even with the debug switch applied.

I believe the problem is on this line:

https://github.com/Neo23x0/munin/blob/3a05795b644f7ee8fa3b3b34b2f44031a93de6fc/munin.py#L174

I have just been experiencing #29 (VT API query failure due to SSL interception), which manifests in a silent failure and getting stuck in the while loop. I think this could be considered a separate issue as well, since silent failure is less than ideal, even if the user doesn't supply the debug switch.

https://github.com/Neo23x0/munin/blob/3a05795b644f7ee8fa3b3b34b2f44031a93de6fc/lib/munin_vt.py#L26-L35

The biggest issue here is that the debug parameter, even if supplied, doesn't make it to the getVTInfo function, so the debug info never prints in the while loop, even if the user sets debug switch.

I'm pretty bad at python, but I think changing munin.py#L174 to the following would fix it:

       vt_info = munin_vt.getVTInfo(hashVal, args.debug)

Edit: actually just to be clear, I did try the suggested fix and it does indeed print debug lines as expected (when the debug switch is applied). I'm just uncertain whether the presentation would be considered ideal enough to implement as-is (spams the same debug message endlessly in a loop).

Edit 2: Also happy to supply more info or submit a PR - unclear on etiquette for this repo and whether a single-line fix like this would be useful or whether you'd want to review the other function calls in munin.py for the same issue.

graememeyer commented 2 years ago

Screw it I decided to yolo a 1 line pull request in - let me know if any problems: https://github.com/Neo23x0/munin/pull/54