# NetRecon

A browser-based cybersecurity toolkit for pentesters, sysadmins, and security researchers. Runs as a Chrome side panel extension with a local companion server for OS-level operations.

**Only use against systems you own or have explicit written authorization to test.**

---

## Tools

| Module | Method | External API |
|---|---|---|
| Nmap Scanner | WebSocket stream | — |
| Port Scanner | WebSocket stream | — |
| DNS Recon | Node `dns.promises` | — |
| WHOIS Lookup | `whois` npm package | — |
| SSL/TLS Inspector | Node `tls.connect()` | — |
| HTTP Headers | `fetch` via server | — |
| Subdomain Enumerator | crt.sh + DNS brute | crt.sh |
| IP Geo & ASN | — | ipapi.co |
| CVE Lookup | — | NVD API |
| Reverse IP | — | HackerTarget |

---

## Install

**Step 1 — Start the companion server**

```bash
cd /root/netrecon
npm install
node companion-server.js
```

Server binds to `127.0.0.1:31337`. Requires Node.js 18+ and `nmap` installed (`apt install nmap` / `brew install nmap`).

**Step 2 — Load the extension**

1. Open Chrome → `chrome://extensions`
2. Enable **Developer mode** (top-right toggle)
3. Click **Load unpacked** → select the `netrecon/` folder

**Step 3 — Open the panel**

Click the NetRecon icon in the Chrome toolbar to open the side panel. The ⚡ banner at the top confirms the companion server is reachable.

---

## File Structure

```
netrecon/
├── manifest.json
├── background.js
├── popup.html
├── popup.css
├── popup.js
├── package.json
├── companion-server.js       # Node.js local agent (port 31337)
├── lib/
│   ├── agent-client.js       # HTTP/WebSocket client for companion
│   └── history-manager.js    # chrome.storage.local scan history
└── modules/
    ├── nmap-scanner.js
    ├── port-scanner.js
    ├── dns-recon.js
    ├── whois-lookup.js
    ├── ssl-inspector.js
    ├── http-headers.js
    ├── subdomain-enum.js
    ├── ip-geo.js
    ├── cve-lookup.js
    ├── reverse-ip.js
    └── history-tab.js
```

---

## Security Notes

- Companion server only binds to `127.0.0.1` — not accessible from the network
- CORS restricted to `chrome-extension://` origins
- All shell commands use `spawn()` with array arguments — no shell injection surface
- Extension `connect-src` is limited to `127.0.0.1:31337` only
- Nmap SYN scan (`-sS`) requires root/sudo privileges

---

## Legal

This tool is for authorized security testing only. Unauthorized scanning, enumeration, or exploitation of systems you do not own is illegal in most jurisdictions. The authors accept no liability for misuse.
