Te-k / harpoon

CLI tool for open source and threat intelligence
https://www.randhome.io/blog/2018/02/23/harpoon-an-osint-/-threat-intelligence-tool/
GNU General Public License v3.0
1.16k stars 181 forks source link

Error in ip.py #117

Closed RevThreat closed 4 years ago

RevThreat commented 5 years ago

So only some IP's work. It is literally just random which ones work, compared to which ones don't. I have had this issue on multiple VPS's I thought it was just a servers issue, until I spun up some new ones, and I'm constantly getting the same errors. And like I said, it's just random IP's they break it, while some go through just fine.

harpoon@Node2:~$ harpoon ip intel 59.126.107.90                                                                         ###################### 59.126.107.90 ###################                                                                [+] Downloading BinaryEdge information...                                                                               BinaryEdge request failed, you need a paid subscription                                                                 
[+] Downloading OTX information....                                                                                     
[+] Downloading Robtex information....                                                                                  
[+] Downloading Passive Total information....                                                                           
Traceback (most recent call last):                                                                                        
File "/usr/local/bin/harpoon", line 11, in <module>                                                                       load_entry_point('harpoon==0.1.3', 'console_scripts', 'harpoon')()                                                    
File "/usr/local/lib/python3.5/dist-packages/harpoon-0.1.3-py3.5.egg/harpoon/main.py", line 61, in main 
plugins[args.command].run(config, args, plugins)                                                                      
File "/usr/local/lib/python3.5/dist-packages/harpoon-0.1.3-py3.5.egg/harpoon/commands/ip.py", line 336, in run            
"first": parse(res["firstSeen"]).astimezone(pytz.utc),                                                              
ValueError: astimezone() cannot be applied to a naive datetime               `                                           
harpoon@Node2:~$ harpoon ip intel 125.138.217.102                                                                       ###################### 125.138.217.102 ###################                                                              [+] Downloading BinaryEdge information...                                                                               BinaryEdge request failed, you need a paid subscription                                                                 
[+] Downloading OTX information....                                                                                     
[+] Downloading Robtex information....                                                                                  
[+] Downloading Passive Total information....                                                                           
Quota exceeded for Passive Total                                                                                        
[+] Downloading GreyNoise information....                                                                               
----------------- Intelligence Report                                                                                   
OTX: Not found in any pulse                                                                                             
GreyNoise: IP identified as                                                                                                     TELNET_BRUTEFORCER (2019-09-09T19:19:32Z -> 2019-09-09T19:24:49Z)
        TELNET_SCANNER_HIGH (2019-09-09T05:16:49Z -> 2019-09-09T19:24:46Z)
        WEB_SCANNER_HIGH (2019-09-09T18:13:49Z -> 2019-09-09T19:19:32Z)
        TELNET_SCANNER_HIGH (2019-09-09T05:16:49Z -> 2019-09-09T18:16:39Z)
        WEB_SCANNER_LOW (2019-09-09T18:13:49Z -> 2019-09-09T18:13:49Z)
        TELNET_SCANNER_LOW (2019-09-09T05:16:49Z -> 2019-09-09T05:16:49Z)
        MIRAI (2019-09-08T03:05:26Z -> 2019-09-08T03:05:26Z)
PT: Nothing found!
harpoon@Node2:~$
Te-k commented 4 years ago

Thanks, it seems to be a but with Passive Total date format, have you installed the last version recently ? I was not able to reproduce that bug with 59.126.107.90 , do you have other IPs that create the same issue ?

RevThreat commented 4 years ago

Let me get some samples together, and yes, i git cloned this install maybe a week ago.

harpoon@Node2:~$ harpoon ip intel 71.6.146.130
###################### 71.6.146.130 ###################
[+] Downloading BinaryEdge information...
BinaryEdge request failed, you need a paid subscription
[+] Downloading OTX information....
[+] Downloading Robtex information....
Traceback (most recent call last):
  File "/usr/local/bin/harpoon", line 11, in <module>
    load_entry_point('harpoon==0.1.3', 'console_scripts', 'harpoon')()
  File "/usr/local/lib/python3.5/dist-packages/harpoon-0.1.3-py3.5.egg/harpoon/main.py", line 61, in main
    plugins[args.command].run(config, args, plugins)
  File "/usr/local/lib/python3.5/dist-packages/harpoon-0.1.3-py3.5.egg/harpoon/commands/ip.py", line 319, in run
    'first': a['date'].astimezone(pytz.utc),
ValueError: astimezone() cannot be applied to a naive datetime
harpoon@Node2:~$ harpoon ip intel 59.126.107.99
###################### 59.126.107.99 ###################
[+] Downloading BinaryEdge information...
BinaryEdge request failed, you need a paid subscription
[+] Downloading OTX information....
[+] Downloading Robtex information....
[+] Downloading Passive Total information....
Traceback (most recent call last):
  File "/usr/local/bin/harpoon", line 11, in <module>
    load_entry_point('harpoon==0.1.3', 'console_scripts', 'harpoon')()
  File "/usr/local/lib/python3.5/dist-packages/harpoon-0.1.3-py3.5.egg/harpoon/main.py", line 61, in main
    plugins[args.command].run(config, args, plugins)
  File "/usr/local/lib/python3.5/dist-packages/harpoon-0.1.3-py3.5.egg/harpoon/commands/ip.py", line 336, in run
    "first": parse(res["firstSeen"]).astimezone(pytz.utc),
ValueError: astimezone() cannot be applied to a naive datetime

So here (above) is a good example showing that different IP's give different errors. Oddly though, I have seen it work sometimes on an IP and then break another time on the same one. But for proof that I'm running the current one, I just wget'd all the command files, and ran them through the harpoon directory and still the same errors (below)

harpoon@Node2:~/harpoon/harpoon$ python3 main.py ip intel 71.6.146.130
###################### 71.6.146.130 ###################
[+] Downloading BinaryEdge information...
BinaryEdge request failed, you need a paid subscription
[+] Downloading OTX information....
[+] Downloading Robtex information....
Traceback (most recent call last):
  File "main.py", line 66, in <module>
    main()
  File "main.py", line 61, in main
    plugins[args.command].run(config, args, plugins)
  File "/home/harpoon/harpoon/harpoon/commands/ip.py", line 319, in run
    'first': a['date'].astimezone(pytz.utc),
ValueError: astimezone() cannot be applied to a naive datetime
harpoon@Node2:~/harpoon/harpoon$ python3 main.py ip intel 59.126.107.99
###################### 59.126.107.99 ###################
[+] Downloading BinaryEdge information...
BinaryEdge request failed, you need a paid subscription
[+] Downloading OTX information....
[+] Downloading Robtex information....
[+] Downloading Passive Total information....
Traceback (most recent call last):
  File "main.py", line 66, in <module>
    main()
  File "main.py", line 61, in main
    plugins[args.command].run(config, args, plugins)
  File "/home/harpoon/harpoon/harpoon/commands/ip.py", line 336, in run
    "first": parse(res["firstSeen"]).astimezone(pytz.utc),
ValueError: astimezone() cannot be applied to a naive datetime
harpoon@Node2:~/harpoon/harpoon$
Te-k commented 4 years ago

Ok, I think it was fixed with recent commits, could you pull the last version from github and confirm that it is working for you ?

Te-k commented 4 years ago

Please reopen if it is still an issue