Skip to main content

Extract subdomains from HTTPS sites

Project description

GSAN (Get Subject Alternative Names)

PyPI - Python Version PyPI Build Status Coverage Status GitHub license

GSAN (Get Subject Alternative Names) is a tool that can extract Subject Alternative Names found in SSL Certificates directly from HTTPS web sites which can provide you with DNS names (subdomains) or virtual servers.

This tool extract subdomain names from https sites and return a list or json output of its findings. It is not a subdomain brute-force tool, and you can actually find those subdomains manually, this tools is about the automation of that process, it also offers the following features:

  • Input a single host or Nmap XML file to scan and return subdomains.
  • List or JSON output, useful if you want to export data into other tools.
  • You can optionally filter out domain names that doesn't match the domain name that you're analyzing.
  • Integration with crt.sh so you can extract more subdomains from certificates of the same entity.
  • Also works with Self-signed certificates.
  • Copy to your clipboard the domain names as a list or string if you don't want to deal with files, this is also useful for tools that doesn't accept file input.

You can read more about how this tool works from my post in getroot.info (in Spanish).

Usage:


     ██████╗    ███████╗    █████╗    ███╗   ██╗
    ██╔════╝    ██╔════╝   ██╔══██╗   ████╗  ██║
    ██║  ███╗   ███████╗   ███████║   ██╔██╗ ██║
    ██║   ██║   ╚════██║   ██╔══██║   ██║╚██╗██║
    ╚██████╔╝██╗███████║██╗██║  ██║██╗██║ ╚████║
     ╚═════╝ ╚═╝╚══════╝╚═╝╚═╝  ╚═╝╚═╝╚═╝  ╚═══╝

       Get - Subjective - Alternative - Names

usage: gsan [-h] [-p PORT] [-s [timeout]] [-m] [-q] [-o OUTPUT]
                   [-f {json,text}] [-c {l,s}] [-d] [-V]
                   hostname

positional arguments:
  hostname                              Host or Nmap XML to analyze.

optional arguments:
  -h, --help                            show this help message and exit
  -p PORT, --port PORT                  Destiny port (default 443)
  -s [timeout], --search-crt [timeout]  Retrieve subdomains found in crt.sh
  -m, --match-domain                    Matching domain names only
  -q, --quiet                           Supress output.
  -o OUTPUT, --output OUTPUT            Set output filename
  -f {json,text}, --format {json,text}  Set output format
  -c {l,s}, --clipboard {l,s}           Copy the output to the clipboard as a
                                        List or a Single string
  -d, --debug                           Set debug enable
  -V, --version                         Print version information.

Example

In this case the tool give you sub-domains that you probably didn't find with a sub-domain brute force tool.

Example Image

Demo

Disclaimer: The tool was renamed from getaltname to GSAN. asciicast

Installation

$ pip install --user gsan

TO-DO

  • File output
  • Output to clipboard
  • Clean sub-domains wildcards
  • Remove duplicates
  • A filter system for main domain and TLD's.
  • Add colors (so l33t. /s)
  • Get additional sub-domains from crt.sh
  • Read Nmap XML and analyze them
  • JSON Output
  • Unit Tests
  • Coverage Reports

Contributors

Contribution Guidelines

Contribution is welcome, just remember:

  • Fork the repo.
  • Make changes to the develop branch.
  • Make a Pull Request.

Support this project

If you like the project and would like to support me you can buy me a cup of coffee, you will also be inmortalized as a patreon, thank you 🙏

Buy Me A Coffee Buy Me a Coffee at ko-fi.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gsan-3.0.14.tar.gz (10.7 kB view details)

Uploaded Source

File details

Details for the file gsan-3.0.14.tar.gz.

File metadata

  • Download URL: gsan-3.0.14.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.5.6

File hashes

Hashes for gsan-3.0.14.tar.gz
Algorithm Hash digest
SHA256 09dbf0aab6c6d7b360ae4c102be5d349a3245d59e4f4015ced04b6061a66354e
MD5 723ec8ce63e1b8a78776867b8ee82712
BLAKE2b-256 41d397d04dedfe956e4fb3b6c3fa6b7c08428300730cad7f206ff568dab61922

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page