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

feat(log) no progress when --log-json option #212

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

sadayuki-matsuno
Copy link
Collaborator

@sadayuki-matsuno sadayuki-matsuno commented Jul 3, 2024

If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.

What did you implement:

no progress when --log-json option

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

before

$ go-exploitdb fetch exploitdb --log-json
{"lvl":"info","msg":"Fetching Offensive Security Exploit","t":"2024-07-04T16:27:30.396943139+09:00"}
{"URL":"https://cve.mitre.org/data/downloads/allitems-cvrf.xml","lvl":"info","msg":"Fetching","t":"2024-07-04T16:27:30.39725692+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_exploits.csv","lvl":"info","msg":"Fetching","t":"2024-07-04T16:28:23.123808431+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_shellcodes.csv","lvl":"info","msg":"Fetching","t":"2024-07-04T16:28:23.661596644+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb-papers/-/raw/main/files_papers.csv","lvl":"info","msg":"Fetching","t":"2024-07-04T16:28:24.060105586+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb/-/raw/main/ghdb.xml","lvl":"info","msg":"Fetching","t":"2024-07-04T16:28:24.402305658+09:00"}
{"count":60138,"lvl":"info","msg":"Offensive Security Exploit","t":"2024-07-04T16:28:25.116201178+09:00"}
{"db":"sqlite3","lvl":"info","msg":"Insert Exploit into go-exploitdb.","t":"2024-07-04T16:28:25.116312321+09:00"}
{"lvl":"info","msg":"Inserting 60138 Exploits","t":"2024-07-04T16:28:25.116334638+09:00"}
{"lvl":"info","msg":"Inserting new Exploits","t":"2024-07-04T16:28:25.179692747+09:00"}
60138 / 60138 [----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 6852 p/s
{"count":29206,"lvl":"info","msg":"No CveID Exploit Count","t":"2024-07-04T16:28:34.158326086+09:00"}
{"count":30932,"lvl":"info","msg":"CveID Exploit Count","t":"2024-07-04T16:28:34.158392725+09:00"}

after

$ go-exploitdb fetch exploitdb --log-json
{"lvl":"info","msg":"Fetching Offensive Security Exploit","t":"2024-07-04T16:29:26.164413081+09:00"}
{"URL":"https://cve.mitre.org/data/downloads/allitems-cvrf.xml","lvl":"info","msg":"Fetching","t":"2024-07-04T16:29:26.164525004+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_exploits.csv","lvl":"info","msg":"Fetching","t":"2024-07-04T16:30:19.362401322+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_shellcodes.csv","lvl":"info","msg":"Fetching","t":"2024-07-04T16:30:19.949999287+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb-papers/-/raw/main/files_papers.csv","lvl":"info","msg":"Fetching","t":"2024-07-04T16:30:20.37316689+09:00"}
{"URL":"https://gitlab.com/exploit-database/exploitdb/-/raw/main/ghdb.xml","lvl":"info","msg":"Fetching","t":"2024-07-04T16:30:20.715533578+09:00"}
{"count":60138,"lvl":"info","msg":"Offensive Security Exploit","t":"2024-07-04T16:30:21.356218238+09:00"}
{"db":"sqlite3","lvl":"info","msg":"Insert Exploit into go-exploitdb.","t":"2024-07-04T16:30:21.356261988+09:00"}
{"lvl":"info","msg":"Inserting 60138 Exploits","t":"2024-07-04T16:30:21.356271119+09:00"}
{"lvl":"info","msg":"Deleting old Exploits","t":"2024-07-04T16:30:21.400603542+09:00"}
{"lvl":"info","msg":"Inserting new Exploits","t":"2024-07-04T16:30:22.68531134+09:00"}
{"count":29206,"lvl":"info","msg":"No CveID Exploit Count","t":"2024-07-04T16:30:27.519650935+09:00"}
{"count":30932,"lvl":"info","msg":"CveID Exploit Count","t":"2024-07-04T16:30:27.519688127+09:00"}

$ go-exploitdb fetch exploitdb
INFO[07-04|16:31:23] Fetching Offensive Security Exploit 
INFO[07-04|16:31:23] Fetching                                 URL=https://cve.mitre.org/data/downloads/allitems-cvrf.xml
INFO[07-04|16:32:18] Fetching                                 URL=https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_exploits.csv
INFO[07-04|16:32:18] Fetching                                 URL=https://gitlab.com/exploit-database/exploitdb/-/raw/main/files_shellcodes.csv
INFO[07-04|16:32:19] Fetching                                 URL=https://gitlab.com/exploit-database/exploitdb-papers/-/raw/main/files_papers.csv
INFO[07-04|16:32:19] Fetching                                 URL=https://gitlab.com/exploit-database/exploitdb/-/raw/main/ghdb.xml
INFO[07-04|16:32:20] Offensive Security Exploit               count=60138
INFO[07-04|16:32:20] Insert Exploit into go-exploitdb.        db=sqlite3
INFO[07-04|16:32:20] Inserting 60138 Exploits 
INFO[07-04|16:32:20] Deleting old Exploits 
60138 / 60138 [---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 53969 p/s
INFO[07-04|16:32:21] Inserting new Exploits 
60138 / 60138 [---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 100.00% 13077 p/s
INFO[07-04|16:32:26] No CveID Exploit Count                   count=29206
INFO[07-04|16:32:26] CveID Exploit Count                      count=30932

Checklist:

You don't have to satisfy all of the following.

  • Write tests
  • Write documentation
  • Check that there aren't other open pull requests for the same issue/feature
  • Format your source code by make fmt
  • Pass the test by make test
  • Provide verification config / commands
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES

Reference

@MaineK00n MaineK00n changed the title feat(db) no progress when --log-json option feat(log) no progress when --log-json option Jul 4, 2024
@MaineK00n MaineK00n merged commit 1d9c13d into master Jul 4, 2024
6 checks passed
@MaineK00n MaineK00n deleted the no_progress_when_log_json branch July 4, 2024 07:33
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

Successfully merging this pull request may close these issues.

2 participants