HurricaneLabs / machinae

Machinae Security Intelligence Collector
MIT License
504 stars 101 forks source link

Error from VirusTotal File Report: module 'signal' has no attribute 'SIGALRM' #68

Closed Lester0142 closed 5 months ago

Lester0142 commented 1 year ago

Command ran: machinae -c "path to config file" -o N https://google.com/ Please help me :( Thanks.

cschmidt0121 commented 1 year ago

Hi, this is likely being caused by one of Machinae's dependencies having poor Windows compatibility. Was there any more info provided with the error? I'd like to nail down which dependency it is to see if we can do anything about it.

Lester0142 commented 1 year ago

Hi @cschmidt0121 thank you for responding. I am running windows and have pip3 install machinae then pip3 install libmagic.

machinae -c "etc\machinae.yml -o N https://google.com/

Traceback (most recent call last): File "etc\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "etc\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "etc\Python39\Scripts\machinae.exe__main.py", line 7, in File "etc\Python39\lib\site-packages\machinae\cmd.py", line 218, in main cmd.run() File "etc\Python39\lib\site-packages\machinae\cmd.py", line 202, in run output = outputs.MachinaeOutput.get_formatter(fmt).run(self.results) File "etc\Python39\lib\site-packages\machinae\outputs.py", line 46, in run for row in result_sets: File "etc\Python39\lib\site-packages\machinae\cmd.py", line 129, in results scraper = Site.from_conf(site_conf, creds=creds, proxies=proxies) # , verbose=self.verbose) File "etc\Python39\lib\site-packages\machinae\sites__init__.py", line 48, in from_conf from . import csv, html, rss, json, ipwhois File "etc\Python39\lib\site-packages\machinae\sites\csv.py", line 7, in from .base import HttpSite File "etc\Python39\lib\site-packages\machinae\sites\base.py", line 9, in import magic File "etc\Python39\lib\site-packages\magic\init__.py", line 18, in from magic.identify import Magic, MagicError File "etc\Python39\lib\site-packages\magic\identify.py", line 16, in from magic import api File "etc\Python39\lib\site-packages\magic\api.py", line 22, in raise ImportError('Unable to find magic library') ImportError: Unable to find magic library

Could you perhaps guide me on machinae.yml configuration file as well and share with me a general command to check if things are running well.

What I have done for the machinae.yml file was to remove those that require "YOUR_API_KEY" as I do not. I am looking to just test on normal api like ipwhois.

Thanks a lot!

cschmidt0121 commented 1 year ago

libmagic is a dependency of python-magic. I haven't done this myself as I'm on Mac OS, but according to the pypi page for python-magic...

You'll need DLLs for libmagic. @julian-r maintains a pypi package with the DLLs, you can fetch it with:

pip install python-magic-bin

What you've done with machinae.yml is what I'd recommend. The yml file that is in the repo is intended for exactly that purpose.

For testing it, the easiest way would be to just run something like

machinae google.com

Lester0142 commented 1 year ago

What I have done:

  1. pip install machinae
  2. pip uninstall filemagic
  3. pip install libmagic
  4. pip install python-magic-bin

C:>machinae -c "etc\machinae.yml" google.com


[!] Error from URLVoid: module 'signal' has no attribute 'SIGALRM' [!] Error from URL Unshorten: module 'signal' has no attribute 'SIGALRM' [!] Error from Malc0de: module 'signal' has no attribute 'SIGALRM' [!] Error from Fortinet Category: module 'signal' has no attribute 'SIGALRM' [!] Error from VirusTotal pDNS: module 'signal' has no attribute 'SIGALRM' [!] Error from Reputation Authority: module 'signal' has no attribute 'SIGALRM' [!] Error from McAfee Threat: module 'signal' has no attribute 'SIGALRM'

C:>machinae google.com Warning: operating without a config file. This is probably not what you want. To correct this, fetch a copy of the default configuration file from https://github.com/hurricanelabs/machinae and place it in /etc/machinae.yml or ~/.machinae.yml and run again.


cschmidt0121 commented 5 months ago

I started noticing the filemagic module failing to find libmagic on my laptop, and saw these days most people use python-magic. I've updated Machinae to use python-magic instead in version 1.4.11 which is now live on pypi. Not sure if that was the issue you were having, but check it out and let me know.