Skip to content
Merged
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ pip install -r requirements.txt

1. Basic Network Scan:
```bash
python network_scanner.py 192.168.1.0/24
python src/network_scanner.py 192.168.1.0/24
```

2. Advanced Scan with Custom Ports:
```bash
python network_scanner.py 192.168.1.0/24 -s 2 -p 80 443 3389 8080
python src/network_scanner.py 192.168.1.0/24 -s 2 -p 80 443 3389 8080
```

3. Full Security Assessment:
```bash
python network_scanner.py 192.168.1.0/24 --security-check --format json
python src/network_scanner.py 192.168.1.0/24 --security-check --format json
```

### Command Line Arguments
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tqdm>=4.66.1
colorama>=0.4.6
texttable>=1.7.0
argparse>=1.4.0
cryptography>=3.4.7
22 changes: 22 additions & 0 deletions network_scanner.py → src/network_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import random
import os
import shutil
from cryptography.fernet import Fernet

# Initialize colorama for cross-platform colored output
init()
Expand Down Expand Up @@ -277,6 +278,27 @@ def save_results(self, format: str = "csv"):

print(f"\n{Fore.GREEN}Results saved to: {filename}{Style.RESET_ALL}")

# Encrypt the results file
self.encrypt_file(filename)

def encrypt_file(self, filename: str):
key = Fernet.generate_key()
cipher_suite = Fernet(key)

with open(filename, 'rb') as file:
file_data = file.read()

encrypted_data = cipher_suite.encrypt(file_data)

with open(filename, 'wb') as file:
file.write(encrypted_data)

key_filename = f"{filename}.key"
with open(key_filename, 'wb') as key_file:
key_file.write(key)

print(f"\n{Fore.GREEN}Results encrypted. Encryption key saved to: {key_filename}{Style.RESET_ALL}")

def parse_arguments():
parser = argparse.ArgumentParser(
description='Enhanced Network Scanner',
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions security_checks.py → src/security_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import requests
from concurrent.futures import ThreadPoolExecutor
import nmap
from src.scanner_logging import SecurityLogger

class SecurityChecker:
def __init__(self, logger):
Expand Down
Loading