Skip to content
niraj-cmdPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 NPHISHER β€” Web Snapshot & Local Testing Tool

Automated Website Rendering β€’ HTML Snapshot β€’ Screenshot Verification β€’ Localhost Hosting

Python Playwright Localhost


πŸ“Œ About

NPHISHER is a Python-based web snapshot utility built with Playwright.

It launches a headless Chromium browser, loads an authorized target website, renders the page, triggers lazy-loaded content, saves the resulting HTML, creates a full-page screenshot, and finally hosts the generated snapshot locally.

The main implementation is:

πŸ‘‰ NPHISHER.py

Important: Despite the filename, this project should only be used for authorized website testing, development, UI research, CTF/lab environments, and archiving. Do not use it to impersonate services or collect credentials.


✨ Features

  • πŸš€ Automated Chromium rendering
  • 🌐 Supports HTTP and HTTPS URLs
  • πŸ“„ Saves the rendered HTML snapshot
  • πŸ“Έ Creates a full-page screenshot
  • πŸ”„ Scrolls the page to trigger lazy-loaded content
  • πŸ“ Automatically creates the output directory
  • πŸ–₯️ Built-in localhost HTTP server
  • ⚑ Asynchronous Playwright automation
  • πŸ” Useful for UI testing and visual verification

πŸ“‚ Project Structure

site-cloner/
β”‚
β”œβ”€β”€ NPHISHER.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”‚
└── cloned_exact_site/
    β”œβ”€β”€ index.html
    └── screenshot.png

The cloned_exact_site directory is created automatically when the script runs.


🧰 Requirements

  • Python 3.10+
  • Playwright
  • Chromium browser installed through Playwright

πŸ“¦ Installation

1. Clone the repository

git clone https://github.com/niraj-cmd/site-cloner.git
cd site-cloner

2. Install Python dependencies

pip install -r requirements.txt

3. Install Chromium

playwright install chromium

▢️ Running NPHISHER

Start the script:

python NPHISHER.py

You will be prompted for a URL:

=== 100% VISUAL ACCURACY SITE COPIER & LOCAL HOST ===

Enter the full website URL to clone:

Enter an authorized URL, for example:

https://example.com

The program then:

Target URL
    β”‚
    β–Ό
Playwright / Chromium
    β”‚
    β–Ό
Render webpage
    β”‚
    β–Ό
Trigger lazy-loaded content
    β”‚
    β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β–Ό               β–Ό
index.html     screenshot.png
    β”‚               β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
            β–Ό
      Local HTTP Server
            β”‚
            β–Ό
   http://localhost:8080

πŸ“ Generated Files

After the script finishes:

cloned_exact_site/
β”œβ”€β”€ index.html
└── screenshot.png

index.html

Contains the HTML generated from the rendered page.

screenshot.png

Contains a full-page screenshot captured by Playwright for visual verification.


πŸ–₯️ Localhost

NPHISHER automatically starts a local HTTP server on port 8080.

Open:

http://localhost:8080

The terminal will display:

[Server] Active! Open your browser and go to:
http://localhost:8080

Stop the server with:

Ctrl + C

βš™οΈ Configuration

The default port is:

start_local_host(port=8080)

To use another port:

start_local_host(port=3000)

Then visit:

http://localhost:3000

πŸ” How the Script Works

1. URL Validation

The program checks that the supplied URL starts with:

http://

or:

https://

2. Chromium Launch

Playwright starts Chromium in headless mode.

3. Page Rendering

The target page is loaded using:

wait_until="networkidle"

with a 60-second timeout.

4. Lazy-Load Trigger

The script scrolls to the bottom of the page and waits briefly before returning to the top.

This can cause lazy-loaded page elements to render.

5. HTML Capture

The final rendered DOM is retrieved using Playwright and written to:

cloned_exact_site/index.html

6. Screenshot

A full-page screenshot is generated:

cloned_exact_site/screenshot.png

7. Local Hosting

Python's built-in HTTP server serves the generated directory.


⚠️ Important Limitations

This project captures the rendered HTML, not necessarily a completely self-contained offline copy.

External resources may still be referenced from their original locations, including:

  • CSS
  • JavaScript
  • Images
  • Fonts
  • APIs
  • CDN resources

Therefore, some websites may not function correctly when hosted locally.

Server-side functionality is also not copied by this script.


πŸ§ͺ Safe Testing

For testing, use:

  • Your own website
  • Local development applications
  • Authorized staging environments
  • CTF/lab applications
  • Intentionally vulnerable training applications

For example:

http://localhost:9000

You can create a simple local test server with:

python -m http.server 9000

Then run:

python NPHISHER.py

and enter:

http://localhost:9000

πŸ›‘οΈ Responsible Use

This tool is intended for authorized security research, development, testing, education, and website archiving.

Do not use it to:

  • Impersonate legitimate services
  • Deploy phishing pages
  • Collect usernames or passwords
  • Harvest authentication information
  • Deceive users
  • Bypass authentication
  • Reproduce websites without authorization

Only snapshot websites that you own or have explicit permission to test.


πŸ› Troubleshooting

ModuleNotFoundError: No module named 'playwright'

Run:

pip install -r requirements.txt

Chromium is missing

Run:

playwright install chromium

Port 8080 is already in use

Change:

start_local_host(port=8080)

to:

start_local_host(port=8081)

Website does not load

Check:

  • URL is valid
  • Internet connection is available
  • Website is reachable
  • Target permits access
  • Page does not require unavailable authentication/session state

Some assets are missing

The current implementation saves the rendered HTML but does not download every external resource into the output directory. External assets may therefore continue to depend on the original website.


πŸ“œ License

If you distribute this project publicly, consider adding an appropriate open-source license such as MIT.


πŸ‘¨β€πŸ’» Author

Niraj Ashtaputre

GitHub:

https://github.com/niraj-cmd

Repository:

https://github.com/niraj-cmd/site-cloner


⭐ Project Purpose

NPHISHER is designed as a learning and research project for:

Web Automation
       β”‚
       β”œβ”€β”€ Playwright
       β”œβ”€β”€ Chromium
       β”œβ”€β”€ HTML Rendering
       β”œβ”€β”€ Screenshot Testing
       └── Local Web Hosting

Built for authorized testing, learning, and security research.


About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages