vulsio / go-exploitdb

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

fix(fetch/inthewild): change gorm type #120

Closed MaineK00n closed 1 year ago

MaineK00n commented 1 year ago

What did you implement:

Fixes #114

Type of change

How Has This Been Tested?

before

$ docker run --name postgres --rm -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
$ go-exploitdb fetch inthewild --dbtype postgres --dbpath "host=localhost user=postgres dbname=postgres sslmode=disable password=postgres"
INFO[02-20|01:51:59] Fetching inTheWild Poc Exploit 
INFO[02-20|01:52:01] inTheWild Poc Exploit                    count=84170
INFO[02-20|01:52:01] Insert Exploit into go-exploitdb.        db=postgres
INFO[02-20|01:52:01] Inserting 84170 Exploits 
INFO[02-20|01:52:01] Inserting new Exploits 
10000 / 84170 [------>____________________________________________] 11.88% ? p/sFailed to insert. dbpath: host=localhost user=postgres dbname=postgres sslmode=disable password=postgres, err: Failed to insert. err: ERROR: value too long for type character varying(255) (SQLSTATE 22001)

after

$ docker run --name postgres --rm -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
$ go-exploitdb fetch inthewild --dbtype postgres --dbpath "host=localhost user=postgres dbname=postgres sslmode=disable password=postgres"
INFO[02-20|01:53:16] Fetching inTheWild Poc Exploit 
INFO[02-20|01:53:18] inTheWild Poc Exploit                    count=84170
INFO[02-20|01:53:18] Insert Exploit into go-exploitdb.        db=postgres
INFO[02-20|01:53:18] Inserting 84170 Exploits 
INFO[02-20|01:53:18] Inserting new Exploits 
84170 / 84170 [----------------------------------------------] 100.00% 50697 p/s
INFO[02-20|01:53:20] No CveID Exploit Count                   count=0
INFO[02-20|01:53:20] CveID Exploit Count                      count=84170

Checklist:

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

Is this ready for review?: YES

Reference