Code Monkey home page Code Monkey logo

domlink's Introduction

DomLink

Blog Post

https://vincentyiu.co.uk/red-team/reconaissance/domlink-automating-domain-discovery

Author

Vincent Yiu (@vysecurity)

Contributors

John Bond (@b4ldr) Jan Rude (@whoot)

What is DomLink?

DomLink is a tool that uses a domain name to discover organisation name and associated e-mail address to then find further associated domains.

This is useful for bug bounty and red team engagements where you need to discover more domains associated with the target.

How does it work?

How it works

Usage

  1. Get an API key from WHOXY.com
  2. Set that API key in a file named domLink.cfg in the same directory.
python domLink.py -D target.com -o target.out.txt

Example

Example

domlink's People

Contributors

b4ldr avatar bsysop avatar jaywon avatar mlinton avatar pdelteil avatar vysec avatar vysecurity avatar whoot 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

domlink's Issues

configparser

Can someone help me how to fix this issue? I have already installed configparser
image

REDACTED FOR PRIVACY issue

Because of the EU General Data Protection Regulation, whois entries from servers which are located in the EU are stripped down to the following information:

% Restricted rights.
% [...]
% [...]
Domain: [...]
Nserver: [...]
Nserver: [...]
Nserver: [...]
Status: connect
Changed: [...]

In this case DomLink will generate the following result:

### Company Names:
REDACTED FOR PRIVACY

### Domain Names:
[the domain used]

### Email Addresses:

Possible solutions:

  • check for this string and do not add it as a company name
  • Maybe perform a whoxy history api request?

error!!

ERROR:root:Could not find 'domLink.cfg' and no API key was defined.

Error

UnboundLocalError: cannot access local variable 'results' where it is not associated with a value

hidden emails

Hi,

Sometimes emails are hidden: ********@*****.***
This crash the program in the next step:

Traceback (most recent call last):
  File "domLink.py", line 176, in <module>
    expand()
  File "domLink.py", line 150, in expand
    pages = content["total_pages"]
KeyError: 'total_pages'

I think you should add a test to check the presence of total_pages but for now I added a very small function to test the email (a regexp would be much better but Python is not my cup of tea):

def append_email(email):
        if email.find('*') == -1:
	        company_emails.append(email)

Then replace:

company_emails.append(...)

By:

append_email(...)

Best regards,

Gwen

Not able to run script

! When running the script with python3 domLink.py -D starlink.com . Getting below error
<class 'type'>
Traceback (most recent call last):
File "domLink.py", line 221, in
main()
File "domLink.py", line 150, in main
api_key = args.api if args.api else read_key_from_config()
File "domLink.py", line 47, in read_key_from_config
return config.get('API_KEYS', 'whoxy')
File "/usr/lib/python3.8/configparser.py", line 781, in get
d = self._unify_values(section, vars)
File "/usr/lib/python3.8/configparser.py", line 1149, in _unify_values
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'API_KEYS'

Error in running

root@kali:~/DomLink# python ./domLink.py -D google.com
Traceback (most recent call last):
File "./domLink.py", line 3, in
from configparser import RawConfigParser
ImportError: No module named configparser

i used python2 and API

error occured and there is no file named domLink.cfg. I have added key in domLink.cfg.example which i got in repo.

Traceback (most recent call last):
File "domLink.py", line 218, in
main()
File "domLink.py", line 147, in main
api_key = args.api if args.api else read_key_from_config()
File "domLink.py", line 44, in read_key_from_config
return config.get('API_KEYS', 'whoxy')
File "/usr/lib/python2.7/ConfigParser.py", line 330, in get
raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'API_KEYS'

Missing encoding results in false output

Hey,
when i try to use DomLink on "heckler-koch.com", the results are completey messed up.
Example:

python domLink.py -D heckler-koch.com -A $WHOXY_API_KEY -C

DomLink Domain Discovery Tool
Author: Vincent Yiu (@vysecurity)
Contributors: John Bond (@b4ldr)
https://www.github.com/vysec/DomLink
Version: 0.1.1

Do you want to check "HECKLER & KOCH GMBH" [Y/n] Y
Do you want to check "sinarahimpour.com" [Y/n] n
Do you want to check "artdesignportal.com" [Y/n] n
Do you want to check "Heckler" [Y/n] Y

### Company Names:
HECKLER & KOCH GMBH
Heckler

### Domain Names:
heckler-koch.com

### Email Addresses:
[email protected]
[email protected]
[email protected]

This is because you dont encode '&' characters, so the actual search query will only be "HECKLER".
See here:

# wget -q "http://api.whoxy.com/?key=$WHOXY_API_KEY&reverse=whois&company=HECKLER+&+KOCH+GMBH" -O huk
# cat huk
{
    "status": 1,
    "api_query": "reverse_whois",
    "search_identifier": {
        "company": "HECKLER"
    },
    "total_results": 5,
    "total_pages": 1,
    "current_page": 1,
    "search_result": [
        {
            "num": 1,
            "domain_name": "sinarahimpour.com",
            "query_time": "2014-10-09 07:00:00",
[...]

However, if you encode the '&' character, the result is correct:

# wget -q "http://api.whoxy.com/?key=$WHOXY_API_KEY&reverse=whois&company=HECKLER+%26+KOCH+GMBH" -O huk
# less huk
{
    "status": 1,
    "api_query": "reverse_whois",
    "search_identifier": {
        "company": "HECKLER & KOCH GMBH"
    },
    "total_results": 23,
    "total_pages": 1,
    "current_page": 1,
    "search_result": [
        {
            "num": 1,
            "domain_name": "heckler-koch.com",
            "query_time": "2015-07-12 17:05:30",
            "create_date": "1997-09-10",
            "update_date": "2014-11-05",
[...]

API Key file location not found

Hey there,

if you use the tool outside of the DomLink directory, you get an API key file error.

Example:

python DomLink/domLink.py -D example.com
DomLink Domain Discovery Tool
Author: Vincent Yiu (@vysecurity)
Contributors: John Bond (@b4ldr)
https://www.github.com/vysec/DomLink
Version: 0.1.1

Traceback (most recent call last):
  File "DomLink/domLink.py", line 213, in <module>
    main()
  File "DomLink/domLink.py", line 142, in main
    api_key = args.api if args.api else read_key_from_config()
  File "DomLink/domLink.py", line 42, in read_key_from_config
    return config.get('API_KEYS', 'whoxy')
  File "/usr/lib/python2.7/ConfigParser.py", line 330, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'API_KEYS'

This can be fixed by using the correct path. Instead of using config.read('domLink.cfg') you should use:

import os, sys

config.read(os.path.join(os.path.dirname(sys.argv[0]), 'domLink.cfg'))

weird issue with dictionaries

In the original code there were 3 lines:

while any(results['domains'].values() + results['companies'].values() + results['emails'].values()):

The issue it ain't really working for me, as I am getting a parser error telling me it is not possible to use "+" with the dict keys and dict values.
I have resolved it in a 'noob' way (my Python ain't great) - I have just purged the second part as I am interested in domains more than emails:

while any(results['domains'].values())

But the way I understand it - it is not supposed to work this way. Did it change in Python 3.8 - I mean the work with dict values?
Thanks!

api key problem

I have just created an account in whoxy.com and added API key in domLink.cfg file but i was getting this error that API KEY is invalid,so i tried creating another API key , i got the same error again.

<class 'type'>
ERROR:root:WHOIS lookup failed, your API key is probably invalid or credits have been exhausted
Traceback (most recent call last):
File "domLink.py", line 221, in
main()
File "domLink.py", line 159, in main
while any(results['domains'].values() +
TypeError: unsupported operand type(s) for +: 'dict_values' and 'dict_values'

Compatibility with Python 3.6

Hey, your print statements don't have parentheses around them, were you planning on providing support for python 3x?

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.