atenreiro / opensquat

The openSquat is an open-source tool for detecting domain look-alikes by searching for newly registered domains that might be impersonating legit domains and brands.
https://opensquat.com
GNU General Public License v3.0
685 stars 130 forks source link

Crash when using csv output #51

Closed arthurblabla closed 3 years ago

arthurblabla commented 3 years ago

Hi there,

When I run the program with -t csv in the command, it always craches: python3 opensquat.py --phishing phishing_domains.txt --dns --ct --subdomains --portcheck -c 4 --vt -p day -t csv -o results.csv

No problem with json or txt type.

This is the error I get :


+---------- Checking Domain Squatting ----------+
[*] Checking for the latest feeds...
[*] You have the latest feeds

[*] keywords: mykeywords.txt
[*] keywords total: 1
[*] Total domains: 137,271
[*] Threshold: very low confidence

[*] Verifying keyword: bluesky [ 1 / 1 ]
[+] suspicious certificate detected between bluesky and bluemountainbluesky.online
[+] suspicious certificate detected between bluesky and blueskyb-consultancy.com
[+] suspicious certificate detected between bluesky and blueskydogtoys.com
[+] suspicious certificate detected between bluesky and blueskye.site
[+] suspicious certificate detected between bluesky and blueskyit.net
[+] suspicious certificate detected between bluesky and blueskymyk.com

[*] Total found: 6

+---------- Checking for Subdomains ----------+
[*] bluemountainbluesky
 \_ VirusTotal might be throttling/blocking
[*] blueskyb-consultancy
 \_ VirusTotal might be throttling/blocking
[*] blueskydogtoys
 \_ VirusTotal might be throttling/blocking
[*] blueskye
 \_ VirusTotal might be throttling/blocking
[*] blueskyit
 \_ VirusTotal might be throttling/blocking
[*] blueskymyk
 \_ VirusTotal might be throttling/blocking
[*] Total found: 0

+---------- VirusTotal ----------+
[*] Total found: 0

+---------- Checking Phishing sites ----------+
[*] Downloading fresh Phishing DB from https://raw.githubusercontent.com/mitchellkrogza/Phishing.Database/master/phishing-domains-ACTIVE.txt
[*] Download volume: 0.59 MB

[*] Verifying keyword: bluesky [ 1 / 1 ]
  \_ Similarity detected between bluesky and blueskyint.com.np
  \_ Similarity detected between bluesky and blueskyparts.com
  \_ Similarity detected between bluesky and blueskypropertiesinc.com

+---------- Domains with open webserver ports ----------+
[*] Total found: 0
Traceback (most recent call last):
  File "opensquat.py", line 150, in <module>
    output.SaveFile().main(args.output, args.type, file_content)
  File "/home/user/cert/opensquat/opensquat/output.py", line 113, in main
    self.as_csv()
  File "/home/user/cert/opensquat/opensquat/output.py", line 68, in as_csv
    file_csv.close()
AttributeError: '_csv.writer' object has no attribute 'close'
atenreiro commented 3 years ago

Hello @arthurblabla

Thanks for reporting this. I will take a look and pull a fix.

thanks,

htanskanen commented 3 years ago

Made a pull request to fix this: https://github.com/atenreiro/opensquat/pull/60

atenreiro commented 3 years ago

Made a pull request to fix this: https://github.com/atenreiro/opensquat/pull/60

Awesome! Thanks for your contribution ☺️