Git Product home page Git Product logo

machinae's Introduction

Build Status CII Best Practices Quality Gate Status

Machinae Logo

Machinae Security Intelligence Collector

Machinae is a tool for collecting intelligence from public sites/feeds about various security-related pieces of data: IP addresses, domain names, URLs, email addresses, file hashes and SSL fingerprints. It was inspired by Automater, another excellent tool for collecting information. The Machinae project was born from wishing to improve Automater in 4 areas:

  1. Codebase - Bring Automater to python3 compatibility while making the code more pythonic
  2. Configuration - Use a more human readable configuration format (YAML)
  3. Inputs - Support JSON parsing out-of-the-box without the need to write regular expressions, but still support regex scraping when needed
  4. Outputs - Support additional output types, including JSON, while making extraneous output optional

Installation

Machinae can be installed using pip3:

pip3 install machinae

Or, if you're feeling adventurous, can be installed directly from github:

pip3 install git+https://github.com/HurricaneLabs/machinae.git

You will need to have whatever dependencies are required on your system for compiling Python modules (on Debian based systems, python3-dev), as well as the libyaml development package (on Debian based systems, libyaml-dev).

You'll also want to grab the latest configuration file and place it in /etc/machinae.yml.

Configuration File

Machinae supports a simple configuration merging system to allow you to make adjustments to the configuration without modifying the machinae.yml we provide you, making configuration updates a snap. This is done by finding a system-wide default configuration (default /etc/machinae.yml), merging into that a system-wide local configuration (/etc/machinae.local.yml) and finally a per-user local configuration (~/.machinae.yml). The system-wide configuration can also be located in the current working directory, can be set using the MACHINAE_CONFIG environment variable, or of course by using the -c or --config command line options. Configuration merging can be disabled by passing the --nomerge option, which will cause Machinae to only load the default system-wide configuration (or the one passed on the command line).

As an example of this, say you'd like to enable the Fortinet Category site, which is disabled by default. You could modify /etc/machinae.yml, but these changes would be overwritten by an update. Instead, you can put the following in either /etc/machinae.local.yml or ~/.machinae.yml:

fortinet_classify:
  default: true

Or, conversely, to disable a site, such as Virus Total pDNS:

vt_ip:
  default: false
vt_domain:
  default: false

Usage

Machinae usage is very similar to Automater:

usage: machinae [-h] [-c CONFIG] [--nomerge] [-d DELAY] [-f FILE] [-i INFILE] [-v]
            [-o {D,J,N,S}] [-O {ipv4,ipv6,fqdn,email,sslfp,hash,url}] [-q]
            [-s SITES] [-a AUTH] [-H HTTP_PROXY]
            [--dump-config | --detect-otype]
            ...
  • See above for details on the -c/--config and --nomerge options.

  • Machinae supports a -d/--delay option, like Automater. However, Machinae uses 0 by default.

  • Machinae output is controlled by two arguments:

    • -o controls the output format, and can be followed by a single character to indicated the desired type of output:
      • N is the default output ("Normal")
      • D is the default output, but dot characters are replaced
      • J is JSON output
    • -f/--file specifies the file where output should be written. The default is "-" for stdout.
  • Machinae will attempt to auto-detect the type of target passed in (Machinae refers to targets as "observables" and the type as "otype"). This detection can be overridden with the -O/--otype option. The choices are listed in the usage

  • By default, Machinae operates in verbose mode. In this mode, it will output status information about the services it is querying on the console as they are queried. This output will always be written to stdout, regardless of the output setting. To disable verbose mode, use -q

  • By default, Machinae will run through all services in the configuration that apply to each target's otype and are not marked as "default: false". To modify this behavior, you can:

    • Pass a comma separated list of sites to run (use the top level key from the configuration).
    • Pass the special keyword all to run through all services including those marked as "default: false"

    Note that in both cases, otype validation is still applied.

  • Machinae supports passing an HTTP proxy on the command line using the -H/--http-proxy argument. If no proxy is specified, machinae will search the standard HTTP_PROXY and HTTPS_PROXY environment variables, as well as the less standard http_proxy and https_proxy environment variables.

  • Lastly, a list of targets should be passed. All arguments other than the options listed above will be interpreted as targets.

Out-of-the-Box Data Sources

Machinae comes with out-of-the-box support for the following data sources:

  • IPVoid
  • URLVoid
  • URL Unshortener (http://www.toolsvoid.com/unshorten-url)
  • Malc0de
  • SANS
  • FreeGeoIP (freegeoip.io)
  • Fortinet Category
  • VirusTotal pDNS (via web scrape - commented out)
  • VirusTotal pDNS (via JSON API)
  • VirusTotal URL Report (via JSON API)
  • VirusTotal File Report (via JSON API)
  • Reputation Authority
  • ThreatExpert
  • VxVault
  • ProjectHoneypot
  • McAfee Threat Intelligence
  • StopForumSpam
  • Cymru MHR
  • ICSI Certificate Notary
  • TotalHash (disabled by default)
  • DomainTools Parsed Whois (Requires API key)
  • DomainTools Reverse Whois (Requires API key)
  • DomainTools Reputation
  • IP WHOIS (Using RIR REST interfaces)
  • Hacked IP
  • Metadefender Cloud (Requires API key)
  • GreyNoise (Requires API key)
  • IBM XForce (Required API key)

With additional data sources on the way.

HTTP Basic Authentication and Configuration

Machinae supports HTTP Basic Auth for sites that require it through the --auth/-a flag. You will need to create a YAML file with your credentials, which will include a key to the site that requires the credentials and a list of two items, username and password or API key. For example, for the included PassiveTotal site this might look like:

passivetotal: ['[email protected]', 'my_api_key']

Inside the site configuration under request you will see a key such as:

json:
  request:
    url: '...'
    auth: passivetotal

The auth: passivetotal points to the key inside the authentication config passed via the command line.

Disabled by default

The following sites are disabled by default

  • Fortinet Category (fortinet_classify)
  • Telize Geo IP (telize)
  • TotalHash (totalhash_ip)
  • DomainTools Parsed Whois (domaintools_parsed_whois)
  • DomainTools Reverse Whois (domaintools_reverse_whois)
  • DomainTools Reputation (domaintools_reputation)
  • PassiveTotal Passive DNS (passivetotal_pdns)
  • PassiveTotal Whois (passivetotal_whois)
  • PassiveTotal SSL Certificate History (passivetotal_sslcert)
  • PassiveTotal Host Attribute Components (passivetotal_components)
  • PassiveTotal Host Attribute Trackers (passivetotal_trackers)
  • MaxMind GeoIP2 Passive Insight (maxmind)
  • FraudGuard (fraudguard)
  • Shodan (shodan)
  • Hacked IP
  • Metadefender Cloud (Requires API key)
  • GreyNoise (Requires API key)
  • IBM XForce (Requires API key)

Output Formats

Machinae comes with a limited set of output formats: normal, normal with dot escaping, and JSON. We plan to add additional output formats in the future.

Adding additional sites

*** COMING SOON ***

Known Issues

  • Some ISP's on IPvoid contain double-encoded HTML entities, which are not double-decoded

Upcoming Features

  • Add IDS rule search functionality (VRT/ET)
  • Add "More info" link for sites
  • Add "dedup" option to parser settings
  • Add option for per-otype request settings
  • Add custom per-site output for error codes

Version History

Version 1.4.9 (2020-11-25)

  • Fix bug in JSON as_time processing when time is an epoch time, but str type

Version 1.4.1 (2018-08-31)

  • New Features
    • Automatically Defangs output
    • MISP Support (example added to machinae.yml)

Version 1.4.0 (2016-04-20)

  • New features
    • "-a"/"--auth" option for passing an auth config file
      • Thanks johannestaas for the submission
    • "-H"/"--http-proxy" option, and environment support, for HTTP proxies
  • New sites
    • Passivetotal (various forms, thanks johannestaas)
    • MaxMind
    • FraudGuard
    • Shodan
  • Updated sites
    • FreeGeoIP (replaced freegeoip.net with freegeoip.io)

Version 1.3.4 (2016-04-01)

  • Bug fixes
    • Convert exceptions to str when outputting to JSON
      • Should actually close #14

Version 1.3.3 (2016-03-28)

  • Bug fixes
    • Correctly handle error results when outputting to JSON
      • Closes #14
      • Thanks Den1al for the bug report

Version 1.3.2 (2016-03-10)

  • New features
    • "Short" output mode - simply output yes/no/error for each site
    • "-i"/"--infile" option for passing a file with list of targets

Version 1.3.1 (2016-03-08)

  • New features
    • Prepend "http://" to URL targets when not starting with http:// or https://

Version 1.3.0 (2016-03-07)

  • New sites
    • Cymon.io - Threat intel aggregator/tracker by eSentire
  • New features
    • Support simple paginated responses
    • Support url encoding 'target' in request URL
    • Support url decoding values in results

Version 1.2.0 (2016-02-16)

  • New features
    • Support for sites returning multiple JSON documents
    • Ability to specify time format for relative time parameters
    • Ability to parse Unix timestamps in results and display in ISO-8601 format
    • Ability to specify status codes to ignore per-API
  • New sites
    • DNSDB - FarSight Security Passive DNS Data base (premium)

Version 1.1.2 (2015-11-26)

  • New sites
    • Telize (premium) - GeoIP site (premium)
    • Freegeoip - GeoIP site (free)
    • CIF - CIFv2 API support, from csirtgadgets.org
  • New features
    • Ability to specify labels for single-line multimatch JSON outputs
    • Ability to specify relative time parameters using relatime library

Version 1.0.1 (2015-10-13)

  • Fixed a false-positive bug with Spamhaus (Github#10)

Version 1.0.0 (2015-07-02)

  • Initial release

License Info

The MIT License (MIT)

Copyright (c) 2015 Hurricane Labs LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

machinae's People

Contributors

akostyuk avatar ashbyca avatar billford avatar cschmidt0121 avatar gliptak avatar johannestaas avatar lwcolton avatar mcm avatar spaddex avatar tcwaddell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

machinae's Issues

Requests.packages

root@tw-linux:~/Downloads# python3 /usr/local/bin/machinae -c /etc/machinae.yml -o N 184.105.247.196
Traceback (most recent call last):
File "/usr/local/bin/machinae", line 9, in
load_entry_point('machinae==1.3.4', 'console_scripts', 'machinae')()
File "/usr/local/lib/python3.4/dist-packages/machinae/cmd.py", line 183, in main
cmd.run()
File "/usr/local/lib/python3.4/dist-packages/machinae/cmd.py", line 167, in run
output = outputs.MachinaeOutput.get_formatter(fmt).run(self.results)
File "/usr/local/lib/python3.4/dist-packages/machinae/outputs.py", line 40, in run
for row in result_sets:
File "/usr/local/lib/python3.4/dist-packages/machinae/cmd.py", line 98, in results
scraper = Site.from_conf(site_conf) # , verbose=self.verbose)
File "/usr/local/lib/python3.4/dist-packages/machinae/sites/init.py", line 46, in from_conf
from . import csv, html, rss, json, ipwhois
File "/usr/local/lib/python3.4/dist-packages/machinae/sites/csv.py", line 7, in
from .base import HttpSite
File "/usr/local/lib/python3.4/dist-packages/machinae/sites/base.py", line 14, in
from requests.packages.urllib3 import exceptions
ImportError: No module named 'requests.packages'

root@tw-linux:~/Downloads# pip3 list
requests (2.2.1)
urllib3 (1.7.1)

Changed line 14 in /usr/local/lib/python3.4/dist-packages/machinae/sites/base.py
from requests.packages.urllib3 import exceptions

To
from urllib3 import exceptions

Works now.

Spamhaus 503 Errors

The Spamhaus Domain BL checks seem to be failing with a 503 error. I suspect this may be a result of Spamhaus's anti-automation checks.

[!] Error from Spamhaus Domain BL: 503 Server Error: Service Temporarily Unavailable for url: https://www.spamhaus.org/query/domain/www.google.com

The same URL in the browser works as expected, but fetching the HTML page is not the preferred method of checking the Spamhaus RBL. The appropriate way to query Spamhaus is via the DNSRBL.

Sample multi-DNSRBL resolver: http://pastebin.com/sCPeqtum

List of DNSRBLs: https://mxtoolbox.com/problem/blacklist/

Package not found error

Hello,

I've installed the 'Machinae' successfully in Mac OS 13.3.1 using the below command. However, I am getting 'package not found' error as shown below.

pip3 install git+https://github.com/HurricaneLabs/machinae.git

machinae <ip_address>
Traceback (most recent call last):
  File "/Users/user1/Library/Python/3.9/bin/machinae", line 8, in <module>
    sys.exit(main())
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/cmd.py", line 218, in main
    cmd.run()
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/cmd.py", line 202, in run
    output = outputs.MachinaeOutput.get_formatter(fmt).run(self.results)
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/outputs.py", line 46, in run
    for row in result_sets:
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/cmd.py", line 129, in results
    scraper = Site.from_conf(site_conf, creds=creds, proxies=proxies)  # , verbose=self.verbose)
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/sites/__init__.py", line 48, in from_conf
    from . import csv, html, rss, json, ipwhois
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/sites/csv.py", line 7, in <module>
    from .base import HttpSite
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/machinae/sites/base.py", line 9, in <module>
    import magic
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/magic/__init__.py", line 18, in <module>
    from magic.identify import Magic, MagicError
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/magic/identify.py", line 16, in <module>
    from magic import api
  File "/Users/user1/Library/Python/3.9/lib/python/site-packages/magic/api.py", line 22, in <module>
    raise ImportError('Unable to find magic library')
ImportError: Unable to find magic library

CSV Output

It would be a nice improvement to have ouput in CSV format.

Connecting via proxy

Hi, is there a way to use it with http proxy?
I have my env variables http_proxy and https_proxy set up, but machinae seems not to be using that.

Ipvoid Issues

When attempting to pull events from ipvoid I am unable to return any results. I am always provided with "[-] No IPVoid Results". I was going out of my way to use the command "-s ipvoid" to only use ipvoid since it does not require an API key according to the documentation.

It's possible this has been busted for a while. The scraping may no longer be working since IPvoid now appears to have a paid-for API key.

I was able to confirm that the regex for "ipvoid_status" and "ipvoid_blacklist" are working correctly.

I was testing with the IP "185.175.93.104" which is currently top attacker on SANS right now (https://isc.sans.edu/sources.html) which is blacklisted. https://www.ipvoid.com/ip-blacklist-check/

Error on a clean system install with machinae 1.4.0

Hi,
I'm not sure what the issue is, but I'm getting this error output when trying to run for the first time after a clean install via "pip3 install machinae". Can you help please?

user@data:/opt/machinae$ machinae -c /opt/machinae/machinae.yml -f /opt/machinae/machinae.txt
Traceback (most recent call last):
File "/usr/local/bin/machinae", line 9, in
load_entry_point('machinae==1.4.0', 'console_scripts', 'machinae')()
File "/usr/local/lib/python3.4/dist-packages/machinae/cmd.py", line 209, in main
cmd.run()
File "/usr/local/lib/python3.4/dist-packages/machinae/cmd.py", line 178, in run
if len(self.conf) == 0:
File "/usr/local/lib/python3.4/dist-packages/machinae/cmd.py", line 68, in conf
conf = utils.safe_load(f)
File "/usr/local/lib/python3.4/dist-packages/machinae/utils.py", line 35, in safe_load
return yaml.load(_args, *_kwargs)
File "/usr/local/lib/python3.4/dist-packages/yaml/init.py", line 72, in load
return loader.get_single_data()
File "/usr/local/lib/python3.4/dist-packages/yaml/constructor.py", line 35, in get_single_data
node = self.get_single_node()
File "/usr/local/lib/python3.4/dist-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/usr/local/lib/python3.4/dist-packages/yaml/composer.py", line 58, in compose_document
self.get_event()
File "/usr/local/lib/python3.4/dist-packages/yaml/parser.py", line 118, in get_event
self.current_event = self.state()
File "/usr/local/lib/python3.4/dist-packages/yaml/parser.py", line 193, in parse_document_end
token = self.peek_token()
File "/usr/local/lib/python3.4/dist-packages/yaml/scanner.py", line 128, in peek_token
self.fetch_more_tokens()
File "/usr/local/lib/python3.4/dist-packages/yaml/scanner.py", line 220, in fetch_more_tokens
return self.fetch_value()
File "/usr/local/lib/python3.4/dist-packages/yaml/scanner.py", line 580, in fetch_value
self.get_mark())
yaml.scanner.ScannerError: mapping values are not allowed here
in "/opt/machinae/machinae.yml", line 7, column 19

Defang URLs

Some responses, such as VirusTotal, return malicious URLs. Can code be put in to automatically defang those URLs? (e.g. http -> hxxp, etc)

Add rudimentary time parsing to limit size of output

Sources like VirusTotal pDNS can print hundreds of lines of output. This makes some machinae output incredibly unwieldy. It would be helpful to have some means of filtering this output by age to decrease output size and improve relevancy.

[!] Error from Shodan: 'str' object has no attribute 'copy'

So I tried to figure this out I promise.... I thought I was even getting better at python!! When I enable shodan the error in the title is what I get. I tried debug and it didn't really offer me any help either. :)

root@ossec-lab:/etc# python -m pdb machinae
Traceback (most recent call last):
File "/usr/lib/python2.7/pdb.py", line 1314, in main
pdb._runscript(mainpyfile)
File "/usr/lib/python2.7/pdb.py", line 1233, in _runscript
self.run(statement)
File "/usr/lib/python2.7/bdb.py", line 400, in run
exec cmd in globals, locals
File "", line 1, in
File "machinae", line 1
ipwhois:
^
SyntaxError: invalid syntax

Cymon was shut down

cymon.io was shutdown by eSentire. You probably want to take that out as a data source.

GeoIP within URL search

When triggering a search on a URL (with -O url), the script dosen't search for geo ip locations of the associated ips of the domain.

New lines in site output (see ipwhois)

steve > ~ > machinae -s ipwhois 8.8.8.8
********************************************************************************
* Information for 8.8.8.8
* Observable type: ipv4 (Auto-detected: True)
********************************************************************************

[+] IP Whois results
    [-] ASN Information: ('15169', '8.8.8.0/24', '', 'arin', 'US')
    [-] Network Information: ('8.0.0.0/8', 'NET-8-0-0-0-1', 'LVLT-ORG-8-8', '8.0.0.0 - 8.255.255.255')
    [-] Network Information: ('8.8.8.0/24', 'NET-8-8-8-0-1', 'LVLT-GOGL-8-8-8', '8.8.8.0 - 8.8.8.255')
    [-] Registration Info: ('Level 3 Communications, Inc.', '1992-12-01', '2012-02-24')
    [-] Registration Info: ('Google Inc.', '2014-03-14', '2014-03-14')
    [-] Registration Locality: ('Broomfield', 'CO', '80021', 'US')
    [-] Registration Locality: ('Mountain View', 'CA', '94043', 'US')
    [-] Abuse Email: [email protected]
[email protected]
    [-] Abuse Email: [email protected]
    [-] Tech Email: [email protected]
    [-] Tech Email: [email protected]
 steve > ~ >

Make Logging Work

I can't tell what I did/am doing wrong because no error and no logs...I added domaintools api user and key but it doesn't appear to be actually checking domaintools for a domain.

freegeoip.net offline

It appears the resource at freegeoip.net has been taken down by the author. It may be time to add a more reliable geolocation option, perhaps one with an API you can subscribe to for volume-heavy work.

An alternative to freegeoip.net was spun up in its place at freegeoip.io, but it's not certain how long that will stay available.

Reference: fiorix/freegeoip#165

Add option to skip Shodan IPs

Add option to check reverse DNS and see if the IP belongs to Shodan, and skip if so.

Could be similar in use to #4 -- maybe an option for a site that says "if output from site X matches Y, skip remaining sites".

Error with -f option

The following traceback occurs when any file is given to the -f option, existing or not.

 steve > ~ > machinae -s ipwhois -f test 8.8.8.8
Traceback (most recent call last):
  File "/Users/steve/Library/Python/3.4/bin/machinae", line 9, in <module>
    load_entry_point('Machinae==1.0', 'console_scripts', 'machinae')()
  File "/Users/steve/git/hurricane/machinae/src/machinae/cmd.py", line 170, in main
    cmd.run()
  File "/Users/steve/git/hurricane/machinae/src/machinae/cmd.py", line 161, in run
    ofile.write(output)
TypeError: 'str' does not support the buffer interface
 steve > ~ >

Caching

Add option for caching either per-site or globally.

Add Cymon.io

Found your tool, i was actually started to write a similar tool myself here. Since your tool have much more sources, i think i am going to use your tool instead!

Please integrate https://cymon.io/

Your could copy my code if you want.

add MISP example stanza to machinae.yml

I'd do it myself, but my UID isn't on this particular HL project. ;-)

# misp:
#   name: MISP
#   default: true
#   otypes:
#     - ipv4
#     - url
#     - email
#     - fqdn
#     - hash
#     - hash.sha1
#     - hash.sha256
#   json:
#     request:
#       url: https://***YOUR_MISP_HERE***/events/restSearch/download/{target}/null/null/null/null/7
#       method: get
#       headers:
#         Authorization: ***YOUR_APIKEY_HERE***
#     results:
#       - key: response
#         pretty_name: MISP Events
#         multi_match:
#           keys:
#             - Event.date
#             - Event.id
#             - Event.info

Observable type in JSON

The Observable type output is not included in the JSON formatted output.
It would be great to have it in.

Provide indication of invalid site

When an invalid site is specified with the '-s' argument, machinae does not give obvious feedback indicating that the site is invalid.

user@ubuntu:~$ machinae -s not_a_real_source A8EDE5B4E9AD5F52A3C28142FA26A4C2CAA2D9BD9E73AEAD41942D31986E4ABE
********************************************************************************
* Information for A8EDE5B4E9AD5F52A3C28142FA26A4C2CAA2D9BD9E73AEAD41942D31986E4ABE
* Observable type: hash.sha256 (Auto-detected: True)
********************************************************************************

user@ubuntu:~$

Make a version option

Because I confused easily...like super easily...needed a version option (-v) since we're doing releases now and stuff. This is complete

WSL not supported

When running machinae in WSL i get the following traceback when trying to execute:

Traceback (most recent call last):
File "/home/user/venvs/dev/bin/machinae", line 11, in
load_entry_point('machinae==1.4.9', 'console_scripts', 'machinae')()
File "/home/user/venvs/dev/lib/python3.8/site-packages/machinae/cmd.py", line 218, in main
cmd.run()
File "/home/user/venvs/dev/lib/python3.8/site-packages/machinae/cmd.py", line 185, in run
if not self.conf:
File "/home/user/venvs/dev/lib/python3.8/site-packages/machinae/cmd.py", line 71, in conf
conf = utils.safe_load(f)
File "/home/user/venvs/dev/lib/python3.8/site-packages/machinae/utils.py", line 37, in safe_load
return yaml.load(args, **kwargs)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/init.py", line 114, in load
return loader.get_single_data()
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/constructor.py", line 49, in get_single_data
node = self.get_single_node()
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 36, in get_single_node
document = self.compose_document()
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 55, in compose_document
node = self.compose_node(None, None)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 84, in compose_node
node = self.compose_mapping_node(anchor)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/composer.py", line 64, in compose_node
if self.check_event(AliasEvent):
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/parser.py", line 98, in check_event
self.current_event = self.state()
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/parser.py", line 449, in parse_block_mapping_value
if not self.check_token(KeyToken, ValueToken, BlockEndToken):
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/scanner.py", line 116, in check_token
self.fetch_more_tokens()
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/scanner.py", line 227, in fetch_more_tokens
return self.fetch_alias()
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/scanner.py", line 610, in fetch_alias
self.tokens.append(self.scan_anchor(AliasToken))
File "/home/user/venvs/dev/lib/python3.8/site-packages/yaml/scanner.py", line 922, in scan_anchor
raise ScannerError("while scanning an %s" % name, start_mark,
yaml.scanner.ScannerError: while scanning an alias
in "machinae.yml", line 1418, column 14
expected alphabetic or numeric character, but found '
'
in "machinae.yml", line 1418, column 15

outside venv same error occurs.

Multiple errors in /usr/local/bin/machinae, /usr/local/lib/python3.9/dist-packages

Hi.
I have installed a couple of fresh 64-bit OS (Kali and Debian) with the necessary Python 3 environment with necessary packages according to the requirements.txt. File "machinae.yml" is fresh and latest. A couple years ago there were no problems when I have used MACHINAE. The problem is reproduced on any Unix-like OS with a classic installation (pip3 install machinae).
I run the MACHINAE and get multiple errors like that:

# machinae scanme.org
Traceback (most recent call last):
  File "/usr/local/bin/machinae", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/machinae/cmd.py", line 218, in main
    cmd.run()
  File "/usr/local/lib/python3.9/dist-packages/machinae/cmd.py", line 185, in run
    if not self.conf:
  File "/usr/local/lib/python3.9/dist-packages/machinae/cmd.py", line 71, in conf
    conf = utils.safe_load(f)
  File "/usr/local/lib/python3.9/dist-packages/machinae/utils.py", line 37, in safe_load
    return yaml.load(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/yaml/__init__.py", line 81, in load
    return loader.get_single_data()
  File "/usr/local/lib/python3.9/dist-packages/yaml/constructor.py", line 49, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/local/lib/python3.9/dist-packages/yaml/composer.py", line 64, in compose_node
    if self.check_event(AliasEvent):
  File "/usr/local/lib/python3.9/dist-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/local/lib/python3.9/dist-packages/yaml/parser.py", line 449, in parse_block_mapping_value
    if not self.check_token(KeyToken, ValueToken, BlockEndToken):
  File "/usr/local/lib/python3.9/dist-packages/yaml/scanner.py", line 116, in check_token
    self.fetch_more_tokens()
  File "/usr/local/lib/python3.9/dist-packages/yaml/scanner.py", line 227, in fetch_more_tokens
    return self.fetch_alias()
  File "/usr/local/lib/python3.9/dist-packages/yaml/scanner.py", line 610, in fetch_alias
    self.tokens.append(self.scan_anchor(AliasToken))
  File "/usr/local/lib/python3.9/dist-packages/yaml/scanner.py", line 922, in scan_anchor
    raise ScannerError("while scanning an %s" % name, start_mark,
yaml.scanner.ScannerError: while scanning an alias
  in "/etc/machinae.yml", line 1418, column 14
expected alphabetic or numeric character, but found '*'
  in "/etc/machinae.yml", line 1418, column 15

What's wrong?
Thank you.

Exception in the JSON output option

There's an exception when trying to output via the JSON flag,
Traceback (most recent call last): File "/usr/local/bin/machinae", line 9, in <module> load_entry_point('machinae==1.3.2', 'console_scripts', 'machinae')() File "/usr/local/lib/python3.5/dist-packages/machinae/cmd.py", line 183, in main cmd.run() File "/usr/local/lib/python3.5/dist-packages/machinae/cmd.py", line 167, in run output = outputs.MachinaeOutput.get_formatter(fmt).run(self.results) File "/usr/local/lib/python3.5/dist-packages/machinae/outputs.py", line 142, in run for record in super().run(result_sets): File "/usr/local/lib/python3.5/dist-packages/machinae/outputs.py", line 115, in run for result in item.resultset: AttributeError: 'ErrorResult' object has no attribute 'resultset'

I have managed to fix it by forcing a value check in line 115 in "/usr/local/lib/python3.5/dist-packages/machinae/outputs.py".

Output

Do we need the progress output? Seems like it's fast enough that just a simply progress meter would do, other stuff seems extraneous.

AttributeError: module 'cmd' has no attribute 'Cmd'

I am trying to run code via Liclipse but stock at following problem! Do you have any idea what is my problem?

warning: Debugger speedups using cython not found. Run '"/usr/bin/python3.5" "/home/lab/Downloads/liclipse/plugins/org.python.pydev_5.5.0.201701191611/pysrc/setup_cython.py" build_ext --inplace' to build.
pydev debugger: starting (pid: 6095)
Traceback (most recent call last):
  File "/home/lab/Downloads/liclipse/plugins/org.python.pydev_5.5.0.201701191611/pysrc/pydevd.py", line 1537, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "/home/lab/Downloads/liclipse/plugins/org.python.pydev_5.5.0.201701191611/pysrc/pydevd.py", line 976, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "/home/lab/Downloads/liclipse/plugins/org.python.pydev_5.5.0.201701191611/pysrc/_pydev_imps/_pydev_execfile.py", line 25, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/cmd.py", line 215, in <module>
    main()
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/cmd.py", line 210, in main
    cmd.run()
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/cmd.py", line 194, in run
    output = outputs.MachinaeOutput.get_formatter(fmt).run(self.results)
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/outputs.py", line 138, in run
    for record in super().run(result_sets):
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/outputs.py", line 108, in run
    for row in result_sets:
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/cmd.py", line 125, in results
    scraper = Site.from_conf(site_conf, creds=creds, proxies=proxies)  # , verbose=self.verbose)
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/sites/__init__.py", line 48, in from_conf
    from src.machinae.sites import csv, html, rss, json, ipwhois
  File "/home/lab/Documents/LiClipse Workspace/Machinae/src/machinae/sites/html.py", line 6, in <module>
    from bs4 import BeautifulSoup, Comment
  File "/usr/lib/python3/dist-packages/bs4/__init__.py", line 30, in <module>
    from .builder import builder_registry, ParserRejectedMarkup
  File "/usr/lib/python3/dist-packages/bs4/builder/__init__.py", line 4, in <module>
    from bs4.element import (
  File "/usr/lib/python3/dist-packages/bs4/element.py", line 3, in <module>
    from pdb import set_trace
  File "/usr/lib/python3.5/pdb.py", line 135, in <module>
    class Pdb(bdb.Bdb, cmd.Cmd):
AttributeError: module 'cmd' has no attribute 'Cmd'

Spamhaus false positives

Some spamhaus pages have comments that trigger a false positive match. 173.208.83.3 is a good example IP.

~ ❯❯❯ machinae -q -s spamhaus_ip 173.208.83.3
********************************************************************************
* Information for 173.208.83.3
* Observable type: ipv4 (Auto-detected: True)
********************************************************************************

[+] Spamhaus Zen BL results
    [-] Spamhaus Zen BL: listed in the XBL
~ ❯❯❯

Add Shodan

Would be nice to have shodan results as well

malc0de domain

- regex: '<tr class=\"class1\">\n*\s*<td>\d{4}-\d{2}-\d{2}<\/td>\n*\s*<td>(.+)<\/td>'
  values:
      - malc0de_domain
  pretty_name: "MC Domain"

Install failed with python 2.7

Hi,
Can you give me the requirements for installing the lastest version of machine.
regards,

Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 290, in
run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
e=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1235, in prepare_file
s
req_to_install.assert_source_matches_version()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 465, in assert_source
_matches_version
% (display_path(self.source_dir), version, self))
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 71, in display_path
if path.startswith(os.getcwd() + os.path.sep):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 7: ordinal
not in range(128)

installation.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.