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

fix: JsonParsingError when vt-lookup failed with invalid api key #40

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

fukusuket
Copy link
Collaborator

What Changed

Environment1

  • OS: macOS montery version 13.4.1
% nim -v
Nim Compiler Version 2.0.0 [MacOSX: amd64]
% nimble -v
nimble v0.14.2 compiled at 2023-08-19 16:19:52

Test

vt-domain-lookup command with invalid api key does not fail as follows.

./takajo-new vt-domain-lookup -a invalidkey --domainList domain.txt -o out.csv
╔════╦═══╦╗╔═╦═══╗ ╔╦═══╗
║╔╗╔╗║╔═╗║║║╔╣╔═╗║ ║║╔═╗║
╚╝║║╚╣║ ║║╚╝╝║║ ║║ ║║║ ║║
  ║║ ║╚═╝║╔╗╖║╚═╝╠╗║║║ ║║
 ╔╝╚╗║╔═╗║║║╚╣╔═╗║╚╝║╚═╝║
 ╚══╝╚╝ ╚╩╝╚═╩╝ ╚╩══╩═══╝
  by Yamato Security

Started the VirusTotal Domain Lookup command

This command will lookup a list of domains on VirusTotal.
Specify -j results.json to save the original JSON responses.
The default rate is 4 requests per minute so increase this if you have a premium membership.

Loading domains. Please wait.

Loaded domains: 2
Rate limit per minute: 4

Estimated time: 0 hours, 0 minutes, 30 seconds

  0%|                         | 0/2 [ 0.0s<  ??s,      ??/sec]
Unknown error: 0 - example.com
100%|█████████████████████████| 2/2 [15.0s< 0.0s,  83.16m/sec]
Unknown error: 0 - invalid
100%|█████████████████████████| 2/2 [30.0s< 0.0s,  83.16m/sec]

Finished querying domains
Malicious domains found: 0
Saved CSV results to out.csv (0 Bytes)

Elapsed time: 0 hours, 0 minutes, 30 seconds

Notes

I created an issue treeform/puppy#110 because Puppy was the cause of the response code being 0(Unknown error: 0) instead of 401 Unauthorized.

I would appreciate it if you could review when you have time🙏

@fukusuket fukusuket self-assigned this Sep 17, 2023
@fukusuket fukusuket added the bug Something isn't working label Sep 17, 2023
@fukusuket fukusuket changed the title fix: JsonParsingError when vt-lookup failed with invalid api key fix: JsonParsingError when vt-lookup failed with invalid api key Sep 17, 2023
Copy link
Collaborator

@hitenkoku hitenkoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fukusuket Thanks for your pull request. LGTM.

Copy link
Collaborator

@YamatoSecurity YamatoSecurity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fukusuket LGTM! Thanks for adding this fix!

@YamatoSecurity YamatoSecurity merged commit 1334a87 into main Sep 18, 2023
2 checks passed
@fukusuket fukusuket deleted the fix-vt-lookup-error branch September 19, 2023 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] JsonParsingError occurs when specifying an invalid key to vt-lookup command
3 participants