Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,18 @@ Ensure you have **Python 3.12 or later** installed before proceeding with the in

```bash
python3 --version
```
```

Subdominator core modules doesn't include PDF generation dependency, if you fancy a PDF report, use PDF extra tags when installing:
```bash
pipx install 'subdominator[PDF]'
```

#### ✅ **Install Subdominator from PyPI** (Recommended)
The easiest way to install Subdominator is via PyPI:

```bash
pip install --upgrade subdominator
pip install --upgrade 'subdominator[PDF]'
```

#### ✅ **Install the Latest Version from GitHub**
Expand All @@ -226,13 +231,13 @@ pip install --upgrade git+https://github.com/RevoltSecurities/Subdominator
To avoid dependency conflicts, you can install Subdominator using `pipx`:

```bash
pipx install subdominator
pipx install 'subdominator[PDF]'
```

To install the latest version from GitHub with `pipx`:

```bash
pipx install git+https://github.com/RevoltSecurities/Subdominator
pipx install 'subdominator[PDF] @ git+https://github.com/RevoltSecurities/Subdominator'
```

#### ✅ **Install from Git Source** (For Development)
Expand All @@ -242,7 +247,7 @@ For users who want to contribute or modify the tool, clone and install directly
git clone https://github.com/RevoltSecurities/Subdominator.git
cd Subdominator
pip install --upgrade pip
pip install -r requirements.txt
pip install -e . # or pip install -e ".[PDF]" to support PDF report generation
```

After installation, you can verify if Subdominator is installed correctly by running:
Expand Down
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@
'setuptools>=75.6.0',
'SQLAlchemy>=2.0.32',
'tldextract>=5.1.2',
'weasyprint>=65.0',
'aiosqlite>=0.21.0',
],
extra_require={
"PDF": [
'weasyprint>=65.0',
],
},
entry_points={
'console_scripts': [
'subdominator = subdominator.subdominator:main'
Expand Down
11 changes: 8 additions & 3 deletions subdominator/modules/shell/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from rich.console import Console
from rich.table import Table
from jinja2 import Environment, FileSystemLoader
from weasyprint import HTML

console = Console()

Expand Down Expand Up @@ -191,7 +190,6 @@ async def generate_report(self,domain,output_file,format_type):
console.print(f"[bold green]HTML report saved as {output_file}[/bold green]")
elif format_type.lower() == "pdf":
self.generate_pdf_report(html_report, output_file)
console.print(f"[bold green]PDF report saved as {output_file}[/bold green]")
else:
console.print(f"[bold yellow]Report generation only supports pdf/html format, please use a valid report generation format.[/bold yellow]")
return
Expand All @@ -201,7 +199,14 @@ def generate_html_report(self, report_data, template_path):
return template.render(domain=report_data["domain"], subdomains=report_data["subdomains"])

def generate_pdf_report(self,html_report, output_file):
try:
from weasyprint import HTML
except ModuleNotFoundError:
console.print("[bold red]PDF report requires weasyprint module[/bold red]")
console.print("[bold green]Hint:[/bold green] pip install 'subdominator[PDF]'")
return
HTML(string=html_report).write_pdf(output_file)
console.print(f"[bold green]PDF report saved as {output_file}[/bold green]")

def load_subdomains_from_file(self, filename):
if not os.path.exists(filename):
Expand All @@ -228,4 +233,4 @@ async def do_help(self):
[bold][green]help[/green][/bold] [bold]- Show this help menu[/bold]
[bold][green]System Commands[/green][/bold] [bold]- ls, clear, pwd, cd, cat, echo, mkdir, rm, cp, mv[/bold]
"""
)
)