anandpaithankar / mangobars

Fast bulk check SSL Certificate expirations.
MIT License
15 stars 8 forks source link

Bulk CSV search fails #2

Closed adamandersen closed 1 year ago

adamandersen commented 1 year ago

Hi Bud,

I'm not sure why this fails when I run with parameter -i host.csv - I'm running against the example file, also happens if I make one myself. Any obvious quick solution to this?

Error:

└─$ bin/mangobars -i host.csv panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]: main.dispatch({0x6b5ac0?, 0xc000014098}) /home/floks/Downloads/mangobars/cmd/mangobars/mangobars.go:147 +0x4f7 main.process() /home/floks/Downloads/mangobars/cmd/mangobars/mangobars.go:117 +0x332 main.start() /home/floks/Downloads/mangobars/cmd/mangobars/mangobars.go:49 +0x4d main.main() /home/floks/Downloads/mangobars/cmd/mangobars/mangobars.go:40 +0x19

anandpaithankar commented 1 year ago

Make sure your CSV is formatted correctly. I think it's missing the port number.

Example -

amazon.com,443
google.com,443
cloudflare.com,443

If you have this correct already, can you please paste the CSV file (host.csv) used?

I have tested this quickly using the CSV file from the repo and it worked for me..

$ bin/mangobars -i host.csv
   VALID    cloudflare.com:443 (cloudflare.com | 63 days | 2023-05-07 23:59:59 +0000 UTC)
  EXPIRED   instagram.com:443 (*.instagram.com | 10 days | 2023-03-15 23:59:59 +0000 UTC)
  EXPIRED   facebook.com:443 (*.facebook.com | 10 days | 2023-03-15 23:59:59 +0000 UTC)
   VALID    google.com:443 (*.google.com | 58 days | 2023-05-03 04:34:29 +0000 UTC)
   VALID    youtube.com:443 (*.google.com | 58 days | 2023-05-03 04:34:29 +0000 UTC)
adamandersen commented 1 year ago

Make sure your CSV is formatted correctly. I think it's missing the port number.

Example -

amazon.com,443
google.com,443
cloudflare.com,443

If you have this correct already, can you please paste the CSV file (host.csv) used?

I have tested this quickly using the CSV file from the repo and it worked for me..

$ bin/mangobars -i host.csv
   VALID    cloudflare.com:443 (cloudflare.com | 63 days | 2023-05-07 23:59:59 +0000 UTC)
  EXPIRED   instagram.com:443 (*.instagram.com | 10 days | 2023-03-15 23:59:59 +0000 UTC)
  EXPIRED   facebook.com:443 (*.facebook.com | 10 days | 2023-03-15 23:59:59 +0000 UTC)
   VALID    google.com:443 (*.google.com | 58 days | 2023-05-03 04:34:29 +0000 UTC)
   VALID    youtube.com:443 (*.google.com | 58 days | 2023-05-03 04:34:29 +0000 UTC)

You are absolutely right, a few of my hosts at the top didn't have any port numbers. Doh! - It blended in with the rest of the lines.

It works just fine now after that correction

anandpaithankar commented 1 year ago

Good to know! Thanks for reporting back.

Maybe I can think of improving this a bit to assume 443 when not specified..Maybe will push this change later tonight after work or over the weekend!

I am closing this issue for now.

adamandersen commented 1 year ago

Agree, default to 443 if 2nd argument not found

Thanks again for rapid response, you saved me a bunch of time!