Domainia 2.0.0
Domainia helps to find subdomains, DNS records, IP addresses, SSL Certificates, HTTP info, etc. of domain by doing the passive reconnaissance.
License: MIT
Keywords: dns,ssl,osint,certificate,ipv6,whois,ipv4,subdomain,ip,ssl-certificates,whois-lookup,certifi,subdomain-scanner,subdomain-enumeration,osint-python,scanner

[![PyPI](https://img.shields.io/pypi/v/domainia?style=flat-square)](https://pypi.org/project/Domainia/) ![GitHub last commit](https://img.shields.io/github/last-commit/namnamir/domainia?style=flat-square) [![CodeFactor](https://www.codefactor.io/repository/github/namnamir/domainia/badge)](https://www.codefactor.io/repository/github/namnamir/domainia) [![GitHub issues](https://img.shields.io/github/issues-raw/namnamir/domainia?style=flat-square)](https://github.com/namnamir/domainia/issues) ![GitHub branch checks state](https://img.shields.io/github/checks-status/namnamir/domainia/main?style=flat-square) [![License](https://img.shields.io/github/license/namnamir/domainia?style=flat-square)](LICENSE)

<img src="https://raw.githubusercontent.com/namnamir/domainia/main/img/logo.png" width="150px" align="right">

**Domainia** Scanner is an automated Open-source Intelligence (OSINT) tool that enumerates subdomains, all DNS records, IP addresses, related domains/subdomains, certificate details, site info, HTTP status, name servers (NS), domain whois, and etc. of a single domain or a list of domains by using the passive and active reconnaissance techniques.

❤ Support Domainia: ![GitHub Sponsors](https://img.shields.io/github/sponsors/namnamir?style=flat-square) [![Liberapay patrons](https://img.shields.io/liberapay/patrons/namnamir?style=flat-square)](https://liberapay.com/namnamir/donate)

<img src="https://raw.githubusercontent.com/namnamir/domainia/main/img/logo2.png">

---
# How to Use
If you look for the changelog history, you can find it [here](https://github.com/namnamir/domainia/blob/main/CHANGELOG.md).

## 1. Installation
### 1.1. Installation Through [PyPi](https://pypi.org/project/Domainia/) 
[![PyPI](https://img.shields.io/pypi/v/domainia?style=flat-square)](https://pypi.org/project/Domainia/)

If you would like to install it as a Python package, run the following command.
```bash
pip install Domainia
# or
python -m pip install Domainia
```
### 1.2. Installation form the Source
First, clone the package from Github.
```bash
git clone https://github.com/namnamir/domainia.git
```
Then, by running the following command, install all required dependencies for the current user.
```Bash
pip install requirements.txt --user
```

## 2. Add API Keys
Modify the file `api_keys.py` and add the API keys of the mentioned tools.
![Define APIs](https://raw.githubusercontent.com/namnamir/domainia/main/img/api.png)

## 3. Check the Configuration File
Open the file `config.py` and modify it if needed. For each section of it, there is an explanation as the comment.

There are many options can be modified in the config file. Here are a list of the options:
- `date_format` to set the data and time format
- `scan_type` to set the scan type
- `dns_records` to set which DNS records should be enumerated
- `include_txt_records` to set which TXT records should be written in the output file
- `dns_servers` to set the DNS servers
- `delimiter` to set the delimiters for each data to be written into the CSV file
- `whois` to set which Whois detail should be written into the CSV file
- `ssl` to set which SSL detail should be written into the CSV file
- `api` to modify details of the APIs including the data/time format

## 4. Run the Script
The script can be run in 2 modes, loading the list of domains from a file or from the command.
```bash
  -h, --help
                        Show this help message and exit
  -f FILE, --file FILE  
                        Path to the list of domain names, e.g. domains.txt
  -d DOMAIN, --domain DOMAIN
                        The comma separated list of domains
  -w WHOIS, --whois WHOIS
                        Whois API; default "whoisxml".
                        Possible options: "whoisxml" and "whoxy"
-t TYPE, --type TYPE  
                       Type of the scan. If it is set, it will ignore the config file value for the scan type.
                       Possible options: "quick" and "deep"
  -o OUTPUT, --output OUTPUT
                        The name of the output CSV file, e.g. results.csv
```
![Run Domainia Scanner](https://raw.githubusercontent.com/namnamir/domainia/main/img/scan.gif)

## 5. Results (CSV)
Result of the scan would be saved in a CSV file. You can manage the path of the output file by the argument `-o` or `--output`.
![Results in CSV](https://raw.githubusercontent.com/namnamir/domainia/main/img/result.png)
![Results in CSV](https://raw.githubusercontent.com/namnamir/domainia/main/img/result2.png)

---
⚖️ **Copyright**
Domainia tool is released under copy left; there is no right. Just kidding, it is under MIT license; read more about it on the [LICENSE page](https://github.com/namnamir/domainia/blob/main/LICENSE).

⚠️ **Disclaimer**
Domainia tool is tool for legitimate purposes. Do not use it in any illegitimate or illegal activities.

# Change Log
All notable changes to **Domainia** project will be documented in this file.
 
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [1.2.0] - 2022-09-22
### Fixed
- N/A

### Changed
- Improve the print format of graph lines.
- Change the name of the file `basic_status.py` to `html_status.py`.
- Fix issues of the code based on [CodeFactor suggestions](https://www.codefactor.io/repository/github/namnamir/domainia/issues).
- Make the function in `html_status.py` better in formatting and logic.
- Reformat the `config.py` file to make it more readable.

### Added
- Add disclaimer.
- Add the IP geo-location and ASN ([#3](https://github.com/namnamir/domainia/issues/3)).
- Add the random User Agent to the HTTP requests ([#24](https://github.com/namnamir/domainia/issues/24)).
- Add the delay between loading domains, DNS queries, and downloading SSL certificates ([#1](https://github.com/namnamir/domainia/issues/1)).
- Add DNSSec validation ([#7](https://github.com/namnamir/domainia/issues/7)).
- Add DKIM, SPF, and DMARC validator ([#10](https://github.com/namnamir/domainia/issues/10)).
- Add the Hacker Target API for subdomain enumeration ([#30](https://github.com/namnamir/domainia/issues/30)).
- Add a list of DKIM default selectors to the `config.py` file.
- Add a new module for subdomain finding.
- Add SSLMate (CertPotter) API to parse SSL ([#8](https://github.com/namnamir/domainia/issues/8)).
- Add a function to `utils.py` that sanitizes domain names before starting the analysis ([#35](https://github.com/namnamir/domainia/issues/35)).
- Add a set to check if the domain is already analyzed to prevent repetition ([#34](https://github.com/namnamir/domainia/issues/34)).
- Add a function to check the domain name and find it in the given text.
- Add more data from parsing the HTML file: Google UA ID, robots, Twitter, account ([#33](https://github.com/namnamir/domainia/issues/33)).
- Add a file `output_csv.py` to separate the CSV writer.
- The console output (STDOUT) will be saved into a `.txt` file ([#39](https://github.com/namnamir/domainia/issues/39)).
- The console output (STDOUT) verbosity can be set by the argument `-v` or `--verbosity` in 5 levels ([#38](https://github.com/namnamir/domainia/issues/38)).
- Add the error handling in exporting to CSV.
- The output would be written in a JSON file too ([#40](https://github.com/namnamir/domainia/issues/40)).

### Removed
- Remove subdomain and related domain sections of `ssl_parser.py` and add to the `subdomain_finder.py` module.


## [1.2.0] - 2022-09-22
### Fixed
- N/A

### Changed
- Change the `url1` and `url2` in the `config.py` to be more understandable.
- Change the relative links in `README.md` to absolute ones.
- Remove the last `newline` from `whois.py` and add it to `__init.py`.
- Clean up the codes in `whois.py` and `ssl_parser.py`.
- Change the text of some error messages.
- Make the print of the results in the STDOut more readable.

### Added
- Add IP Whois ([#3](https://github.com/namnamir/domainia/issues/3)).
- Add more exceptions to `whois.py` and `ssl_parser.py` to handle more errors.
- Add the font to the repository.

### Removed
- N/A


## [1.1.0] - 2022-09-17
### Fixed
- Fix the situation when the API key is not set.
- Fix the issue of showing empty results when the API call is not made.

### Changed
- Change `init.py` to `__init.py` to make it compiled with PyPi guidelines.
- Change the `README.md` with more useful text.
- Make the `ssl_parser.py` cleaner.
- Change the logo and social preview ([#17](https://github.com/namnamir/domainia/issues/17)).

### Added
- Add `CHANGELOG.md` to log versions in a human readable format.
- Add `.gitignore` to ignore pushing some files to Github.
- Add `setup.py` to make the package ready uploaded to PyPi.
- Add the page [domainia.irsec.eu](https://domainia.irsec.eu).
- Add `*.csv` to `.gitignore` except the sample one.
- Add the color plate: `#323232`, `#c32266`, and `#4c4b4b` for logo and future designs.

### Removed
- All previous commits were deleted as mistakenly the API keys were publicized.
- Remove `.travis.yml` as it was not used.


## [1.0.0] - 2022-10-07
The project was abandoned for about a year. It's revived and some changes are 
made. Let's see it as te initial version, 1.0.0.