Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug parameter isn't passed to getVTInfo function #53

Open
graememeyer opened this issue Feb 23, 2022 · 1 comment
Open

Debug parameter isn't passed to getVTInfo function #53

graememeyer opened this issue Feb 23, 2022 · 1 comment

Comments

@graememeyer
Copy link

graememeyer commented Feb 23, 2022

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:

munin/munin.py

Line 174 in 3a05795

vt_info = munin_vt.getVTInfo(hashVal)

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.

munin/lib/munin_vt.py

Lines 26 to 35 in 3a05795

while not success:
try:
response_dict_code = requests.get(VT_REPORT_URL % hash, headers=headers, proxies=PROXY)
response_dict = json.loads(response_dict_code.content.decode("utf-8"))
success = True
if response_dict_code.status_code == 429:
print("VirusTotal Quota exceeded.")
except Exception as e:
if debug:
traceback.print_exc()

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
Copy link
Author

Screw it I decided to yolo a 1 line pull request in - let me know if any problems: #54

Neo23x0 added a commit that referenced this issue Mar 8, 2022
Fix for #53 (debug switch not passed to getVTInfo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant