Skip to content

Commit 5ec4c25

Browse files
authored
Merge pull request #9 from GYFX35/feature/add-cybersecurity-tools
feat: Add three new cybersecurity tools and update index
2 parents 0b2b5d7 + 9d2ad61 commit 5ec4c25

File tree

14 files changed

+590
-32
lines changed

14 files changed

+590
-32
lines changed

README_port_scanner.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Port Scanner CLI
2+
3+
This is a simple, multi-threaded TCP port scanner written in Python. It is designed to find open ports on a target host.
4+
5+
## Features
6+
7+
* Scans a target host (IP address or hostname).
8+
* Supports scanning a range of ports, a list of ports, or a single port.
9+
* Uses multiple threads for faster scanning.
10+
* Clear and simple output of open ports.
11+
12+
## Prerequisites
13+
14+
* Python 3.6+
15+
* No external libraries are required.
16+
17+
## How to Run
18+
19+
1. **Navigate to the project directory.**
20+
Ensure you have the `port_scanner_main.py` script and the `port_scanner` directory.
21+
22+
2. **Run the application from your terminal.**
23+
Provide the target host and optionally a port range.
24+
25+
```bash
26+
python port_scanner_main.py <target_host> [options]
27+
```
28+
29+
### Command-Line Options
30+
31+
* `host`: (Required) The target host to scan (e.g., `127.0.0.1`, `example.com`).
32+
* `-p, --ports`: (Optional) The port range to scan. Defaults to `1-1024`.
33+
* Formats:
34+
* Range: `1-65535`
35+
* Comma-separated list: `80,443,8080`
36+
* Single port: `22`
37+
* `-t, --threads`: (Optional) The number of threads to use for scanning. Defaults to `20`.
38+
39+
### Example Usage
40+
41+
**Scan the default port range (1-1024) on localhost:**
42+
```bash
43+
python port_scanner_main.py 127.0.0.1
44+
```
45+
46+
**Scan a specific range of ports on a remote host:**
47+
```bash
48+
python port_scanner_main.py example.com -p 1-200
49+
```
50+
51+
**Scan specific ports:**
52+
```bash
53+
python port_scanner_main.py example.com --ports 22,80,443
54+
```
55+
56+
**Increase the number of threads for a faster scan:**
57+
```bash
58+
python port_scanner_main.py scanme.nmap.org -t 50
59+
```
60+
61+
**Example Output:**
62+
```
63+
Scanning host scanme.nmap.org for open ports...
64+
65+
--- Open Ports Found! ---
66+
[+] Port 22 is open
67+
[+] Port 80 is open
68+
```
69+
70+
## Disclaimer
71+
72+
* **LEGALITY**: Unauthorized port scanning of networks is illegal in many countries. This tool is intended for educational purposes and for use on networks where you have explicit permission to conduct scanning. The user assumes all liability for any misuse of this tool.
73+
* **ACCURACY**: The accuracy of the scan can be affected by firewalls, intrusion detection systems (IDS), and network latency. A port that is reported as closed may be filtered or blocked.
74+
* **PERFORMANCE**: Scanning a large range of ports can take a significant amount of time, even with multiple threads.
75+
76+
## File Structure
77+
```
78+
.
79+
├── port_scanner_main.py # Main CLI application script
80+
├── port_scanner/
81+
│ ├── __init__.py # Makes port_scanner a Python package
82+
│ └── scanner.py # Core logic for port scanning
83+
└── README_port_scanner.md # This documentation file
84+
```

README_pwned_checker.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# Account Pwned Checker CLI
2+
3+
This tool checks if an email account has been compromised in a known data breach by using the 'Have I Been Pwned?' (HIBP) API.
4+
5+
## Features
6+
7+
* Checks a single email address against the HIBP database.
8+
* Lists the details of each breach found for the account.
9+
* Provides clear output for both compromised and non-compromised accounts.
10+
11+
## Prerequisites
12+
13+
* Python 3.6+
14+
* `requests` library
15+
* A 'Have I Been Pwned?' API Key
16+
17+
## Installation & Setup
18+
19+
1. **Get an API Key:**
20+
* You must have an API key to use the HIBP API. You can get one for free from the [HIBP API Key Page](https://haveibeenpwned.com/API/Key).
21+
* Once you have your key, open the `pwned_checker/checker.py` file.
22+
* Replace the placeholder `"YOUR_API_KEY_HERE"` with your actual API key:
23+
```python
24+
# In pwned_checker/checker.py
25+
headers = {
26+
"hibp-api-key": "YOUR_API_KEY_HERE" # <-- PASTE YOUR KEY HERE
27+
}
28+
```
29+
30+
2. **Navigate to the project directory.**
31+
Make sure you have the `pwned_main.py` script and the `pwned_checker` directory.
32+
33+
3. **Create a virtual environment (recommended):**
34+
```bash
35+
python -m venv venv_pwned
36+
source venv_pwned/bin/activate # On Windows: venv_pwned\Scripts\activate
37+
```
38+
39+
4. **Install dependencies:**
40+
Navigate to the `pwned_checker` directory and run:
41+
```bash
42+
pip install -r requirements.txt
43+
```
44+
45+
## How to Run
46+
47+
1. Open your terminal or command prompt.
48+
2. Make sure your virtual environment is activated.
49+
3. Navigate to the root directory containing `pwned_main.py`.
50+
4. Run the application with the email you want to check:
51+
```bash
52+
python pwned_main.py "[email protected]"
53+
```
54+
55+
### Example Usage
56+
57+
**To check an email:**
58+
```bash
59+
python pwned_main.py "[email protected]"
60+
```
61+
62+
**Example Output (If Breaches are Found):**
63+
```
64+
Checking account: [email protected]
65+
66+
--- Account Found in Breaches! ---
67+
The account '[email protected]' was found in the following breaches:
68+
69+
- Breach: Adobe
70+
Domain: adobe.com
71+
Date: 2013-10-04
72+
Description: In October 2013, 153 million Adobe accounts were breached...
73+
74+
- Breach: MyFitnessPal
75+
Domain: myfitnesspal.com
76+
Date: 2018-02-25
77+
Description: In February 2018, the health and fitness service MyFitnessPal suffered a data breach...
78+
```
79+
80+
**Example Output (If No Breaches are Found):**
81+
```
82+
Checking account: [email protected]
83+
84+
--- No Breaches Found ---
85+
The account '[email protected]' was not found in any known breaches.
86+
```
87+
88+
## Disclaimer
89+
90+
* This tool relies on the 'Have I Been Pwned?' service. Its accuracy is dependent on the data maintained by HIBP.
91+
* A "not found" result does not guarantee an account is secure, only that it has not appeared in a breach known to HIBP.
92+
* Handle your API key securely. Do not commit it to public repositories. The method of placing it directly in the source code is for simplicity; for more secure applications, use environment variables or a secrets management system.
93+
94+
## File Structure
95+
```
96+
.
97+
├── pwned_main.py # Main CLI application script
98+
├── pwned_checker/
99+
│ ├── __init__.py # Makes pwned_checker a Python package
100+
│ ├── checker.py # Logic for interacting with the HIBP API
101+
│ └── requirements.txt # Python dependencies
102+
└── README_pwned_checker.md # This documentation file
103+
```

README_sensitive_data_scanner.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Sensitive Data Scanner CLI
2+
3+
This tool recursively scans a specified directory to find sensitive data patterns within files, such as API keys, private keys, and credit card numbers.
4+
5+
## Features
6+
7+
* Scans all files within a directory and its subdirectories.
8+
* Uses a predefined set of regular expressions to identify potential sensitive information.
9+
* Reports the file path and the type of sensitive data found.
10+
11+
## Patterns Detected
12+
13+
The scanner looks for the following patterns:
14+
* AWS Access Key ID
15+
* AWS Secret Access Key (Note: this pattern is broad and may cause false positives)
16+
* Google API Key
17+
* Generic API Key patterns
18+
* RSA and SSH Private Keys (looks for the header)
19+
* Credit Card Numbers (Visa, Mastercard, American Express, Discover)
20+
* U.S. Social Security Numbers
21+
22+
## Prerequisites
23+
24+
* Python 3.6+
25+
* No external libraries are required.
26+
27+
## How to Run
28+
29+
1. **Navigate to the project directory.**
30+
Ensure you have the `scanner_main.py` script and the `sensitive_data_scanner` directory.
31+
32+
2. **Run the application from your terminal.**
33+
Provide the path to the directory you want to scan as a command-line argument.
34+
35+
```bash
36+
python scanner_main.py /path/to/your/directory
37+
```
38+
39+
### Example Usage
40+
41+
**To scan a directory named `my_project`:**
42+
```bash
43+
python scanner_main.py ./my_project
44+
```
45+
46+
**Example Output:**
47+
```
48+
Scanning directory: ./my_project
49+
50+
--- Sensitive Data Found! ---
51+
52+
[+] File: ./my_project/config/prod.env
53+
- Found 1 instance(s) of 'AWS Access Key ID'
54+
Example: AKIAIOSFODNN7EXAMPLE
55+
- Found 1 instance(s) of 'AWS Secret Access Key'
56+
Example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
57+
58+
[+] File: ./my_project/src/dev/test_keys.txt
59+
- Found 1 instance(s) of 'RSA Private Key'
60+
Example: -----BEGIN RSA PRIVATE KEY-----
61+
```
62+
63+
**If no data is found:**
64+
```
65+
Scanning directory: ./clean_project
66+
67+
--- No Sensitive Data Found ---
68+
Scan complete. No files with matching sensitive data patterns were found.
69+
```
70+
71+
## Disclaimer
72+
73+
* **This tool is not foolproof.** It uses regular expressions to find patterns, which can result in both **false positives** (flagging data that is not sensitive) and **false negatives** (missing sensitive data that doesn't match a pattern).
74+
* The results should be manually reviewed to confirm if the flagged data is truly sensitive.
75+
* This tool is intended for educational and basic scanning purposes. For enterprise-grade data loss prevention (DLP), consider using more advanced, dedicated security solutions.
76+
* The tool reads all files as text. It may not be effective on binary files and will ignore files it cannot read due to permissions or encoding issues.
77+
78+
## File Structure
79+
```
80+
.
81+
├── scanner_main.py # Main CLI application script
82+
├── sensitive_data_scanner/
83+
│ ├── __init__.py # Makes sensitive_data_scanner a Python package
84+
│ └── scanner.py # Core logic for file scanning and regex matching
85+
└── README_sensitive_data_scanner.md # This documentation file
86+
```

index.html

Lines changed: 60 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,63 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8" />
5-
<link rel="icon" href="/favicon.ico" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Web site created using @vitejs/plugin-react"
11-
/>
12-
<link rel="apple-touch-icon" href="/logo192.png" />
13-
<!--
14-
manifest.json provides metadata used when your web app is installed on a
15-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16-
-->
17-
<link rel="manifest" href="/manifest.json" />
18-
<title>React App</title>
19-
</head>
20-
<body>
21-
<noscript>You need to enable JavaScript to run this app.</noscript>
22-
<div id="root"></div>
23-
<!--
24-
This HTML file is a template.
25-
If you open it directly in the browser, you will see an empty page.
26-
27-
You can add webfonts, meta tags, or analytics to this file.
28-
The build step will place the bundled scripts into the <body> tag.
29-
30-
To begin the development, run `npm start` or `yarn start`.
31-
To create a production bundle, use `npm run build` or `yarn build`.
32-
-->
33-
</body>
34-
<script type="module" src="/src/index.jsx"></script>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Cybersecurity Tools Collection</title>
7+
<style>
8+
body { font-family: sans-serif; line-height: 1.6; margin: 2em; }
9+
h1 { text-align: center; }
10+
ul { list-style: none; padding: 0; }
11+
li { background: #f4f4f4; border: 1px solid #ddd; margin-bottom: 1em; padding: 1em; }
12+
h2 { margin-top: 0; }
13+
a { text-decoration: none; color: #0366d6; }
14+
a:hover { text-decoration: underline; }
15+
</style>
16+
</head>
17+
<body>
18+
<h1>Cybersecurity Tools Collection</h1>
19+
<p>This repository contains a collection of various security-related tools. Click on a tool's documentation to learn more about its functionality and how to use it.</p>
20+
<ul>
21+
<li>
22+
<h2>Account Pwned Checker</h2>
23+
<p>A command-line tool to check if an email account has been compromised in a known data breach using the 'Have I Been Pwned?' API.</p>
24+
<a href="README_pwned_checker.md">View Documentation</a>
25+
</li>
26+
<li>
27+
<h2>Sensitive Data Scanner</h2>
28+
<p>A tool to recursively scan a directory for files containing sensitive data patterns like API keys, private keys, and credit card numbers.</p>
29+
<a href="README_sensitive_data_scanner.md">View Documentation</a>
30+
</li>
31+
<li>
32+
<h2>Port Scanner</h2>
33+
<p>A simple, multi-threaded TCP port scanner to find open ports on a target host.</p>
34+
<a href="README_port_scanner.md">View Documentation</a>
35+
</li>
36+
<li>
37+
<h2>IoT Simulator</h2>
38+
<p>A simulator for IoT devices.</p>
39+
<a href="README_iot_simulator.md">View Documentation</a>
40+
</li>
41+
<li>
42+
<h2>Network Mapper</h2>
43+
<p>A tool to generate network topology diagrams from a CSV file.</p>
44+
<a href="README_netmap.md">View Documentation</a>
45+
</li>
46+
<li>
47+
<h2>Scam Detector</h2>
48+
<p>A tool to detect scams in social media.</p>
49+
<a href="README_scam_detector.md">View Documentation</a>
50+
</li>
51+
<li>
52+
<h2>Simple Browser</h2>
53+
<p>A simple web browser.</p>
54+
<a href="README_simple_browser.md">View Documentation</a>
55+
</li>
56+
<li>
57+
<h2>Wi-Fi Analyzer</h2>
58+
<p>A tool to analyze Wi-Fi networks on Linux systems.</p>
59+
<a href="README_wifi_analyzer.md">View Documentation</a>
60+
</li>
61+
</ul>
62+
</body>
3563
</html>

port_scanner/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)