vulsio / go-exploitdb

Tool for searching Exploits from Exploit Databases, etc.
MIT License
249 stars 56 forks source link

feat(db): add LastFetchedAt in fetchmeta #70

Closed MaineK00n closed 2 years ago

MaineK00n commented 2 years ago

What did you implement:

Add the time when the fetch is completed to fetchmeta.

Type of change

How Has This Been Tested?

RDB

$ go-exploitdb fetch awesomepoc
$ sqlite3 go-exploitdb.sqlite3  
sqlite> SELECT last_fetched_at FROM fetch_meta;
2021-12-26 10:05:14.90520975+09:00

$ go-exploitdb fetch awesomepoc
$ sqlite3 go-exploitdb.sqlite3 
sqlite> SELECT last_fetched_at FROM fetch_meta;
2021-12-26 10:05:35.710005779+09:00

Redis

$ redis-cli -p 6379
127.0.0.1:6379> HGET EDB#FETCHMETA LastFetchedAt
(nil)

$ go-exploitdb fetch awesomepoc --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
$ redis-cli -p 6379
127.0.0.1:6379> HGET EDB#FETCHMETA LastFetchedAt
"2021-12-26T10:06:09.012298276+09:00"

$ go-exploitdb fetch awesomepoc --dbtype redis --dbpath "redis://127.0.0.1:6379/0"
$ redis-cli -p 6379
127.0.0.1:6379> HGET EDB#FETCHMETA LastFetchedAt
"2021-12-26T10:06:27.19301146+09:00"

Checklist:

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

Is this ready for review?: YES

Reference