Data Shield
Secure Data Wiping and Recovery Too
The problem Data Shield solves
This repository provides a web based utility for secure data wiping and file recovery across multiple platforms (Windows, Linux, Android). It’s structured as:
hacknwin/
├── cyber_tool/ ← primary Python/Flask application
│ ├── app.py ← Flask routes & controller logic
│ ├── wiper.py ← device‑detection & wiping logic
│ ├── recovery.py ← PhotoRec wrapper for file recovery
│ ├── templates/ ← Jinja2 HTML templates
│ │ └── index.html
│ ├── static/ ← CSS/JS assets
│ └── recovered_files/ ← output from recovery tool
├── .gitignore
├── README.md
└── requirements.txt
🛠 Technologies Used
Layer Technology Purpose
Backend Python 3.13 Primary language
Framework Flask (micro web framework) Routing, templating, JSON API
Templating Jinja2 (bundled with Flask) Dynamic HTML rendering (render_template)
Frontend HTML, CSS, JavaScript Simple interface and AJAX calls
Storage tools ADB (Android Debug Bridge), PhotoRec Device access & file recovery
Version control Git with GitHub remote Source management
Environment Python venv (.venv) Dependency isolation
Why Flask?
Flask is minimalist, letting us wire endpoints quickly and serve templates without extra scaffolding—perfect for a prototype/security tool.
🧠 Core Components and Theory
- app.py – Flask application
• Routes:
o / – renders the main interface.
o /detect_devices (GET) – returns a JSON list of storage devices.
o /wipe (POST) – executes a secure wipe on the chosen device.
o /android_wipe (POST) – triggers an ADB-based wipe on a connected Android device.
• Workflow: - Client sends AJAX request.
- Flask handler parses JSON and calls EnhancedSecureWiper or RecoveryTool.
- Results returned as JSON and displayed via browser alert.
- wiper.py – Secure wiping logic
• Device detection:
o Uses platform.system() to branch between Windows/Linux.
o On Linux: runs lsblk to list block devices.
o On Windows: enumerates drive letters via wmic logicaldisk.
o Always detects Android by checking adb devices.
• Wipe methods:
o Quick (1 pass), Standard (3 passes), DOD (7 passes) – based on the US DoD 5220.22 M overwriting standard.
o Implements overwriting using file level operations (dd on Android, open/write cycles on attached storage).
• Android-specific:
o Uses ADB commands to remove user directories (rm -rf /sdcard/DCIM, etc.).
o Overwrites storage with zeros (dd if=/dev/zero of=/sdcard/wipefile).
o Sends am broadcast -a android.intent.action.MASTER_CLEAR for factory reset.
• Theory:
Overwriting storage multiple times reduces the chance of data remanence; accepted patterns like the DoD method specify multiple passes with varying byte patterns. - recovery.py – Data recovery wrapper
• PhotoRec integration:
o The class points to the PhotoRec executable path.
o Three recovery types: deleted files, USB, SSD.
o Each method launches PhotoRec (subprocess.Popen) for user guided scanning.
• Theory:
PhotoRec is a forensic tool that ignores filesystem metadata, scanning raw sectors to reconstruct files—useful when the filesystem is damaged or when files were removed. - Frontend (index.html, static/*)
• UI layout:
Cards for “Secure Data Wiper” and “Android Device Wiper” plus buttons that call JS functions.
• JavaScript:
o Uses fetch API to send POST requests with JSON payloads.
o Alerts users with operation status or error messages.
• Styling:
o Dark theme with neon green accents to evoke a “hacker style” interface. - Project configuration
• .gitignore excludes virtual environment, caches, IDE files, and optionally recovered_files.
• requirements.txt pins Flask and Werkzeug versions.
• README.md documents setup, usage, and warnings.
⚠️ Warnings & Best Practices
• Data destruction is irreversible—never run wipe operations on drives that contain needed data.
• Always test on disposable media or virtual machines.
• Keep the Android device in USB debugging mode if you want to use the ADB functionality.
• Recovery only works when data hasn’t been overwritten; once wiping has run, recovery is effectively impossible.
✅ Summary
This project leverages Python and Flask to provide a lightweight but powerful interface for secure data wiping and recovery. It combines platform detection, system utilities (ADB, PhotoRec), and simple web technologies to deliver cross platform functionality.
If you need theory elaborations (e.g., data remanence principles, secure delete algorithms, filesystem behavior), let me know—I can expand further!
•
•
•
Raptor mini (Preview) • 1x
Challenges I ran into
This repository provides a web based utility for secure data wiping and file recovery across multiple platforms (Windows, Linux, Android). It’s structured as:
hacknwin/
├── cyber_tool/ ← primary Python/Flask application
│ ├── app.py ← Flask routes & controller logic
│ ├── wiper.py ← device‑detection & wiping logic
│ ├── recovery.py ← PhotoRec wrapper for file recovery
│ ├── templates/ ← Jinja2 HTML templates
│ │ └── index.html
│ ├── static/ ← CSS/JS assets
│ └── recovered_files/ ← output from recovery tool
├── .gitignore
├── README.md
└── requirements.txt
🛠 Technologies Used
Layer Technology Purpose
Backend Python 3.13 Primary language
Framework Flask (micro web framework) Routing, templating, JSON API
Templating Jinja2 (bundled with Flask) Dynamic HTML rendering (render_template)
Frontend HTML, CSS, JavaScript Simple interface and AJAX calls
Storage tools ADB (Android Debug Bridge), PhotoRec Device access & file recovery
Version control Git with GitHub remote Source management
Environment Python venv (.venv) Dependency isolation
Why Flask?
Flask is minimalist, letting us wire endpoints quickly and serve templates without extra scaffolding—perfect for a prototype/security tool.
🧠 Core Components and Theory
- app.py – Flask application
• Routes:
o / – renders the main interface.
o /detect_devices (GET) – returns a JSON list of storage devices.
o /wipe (POST) – executes a secure wipe on the chosen device.
o /android_wipe (POST) – triggers an ADB-based wipe on a connected Android device.
• Workflow: - Client sends AJAX request.
- Flask handler parses JSON and calls EnhancedSecureWiper or RecoveryTool.
- Results returned as JSON and displayed via browser alert.
- wiper.py – Secure wiping logic
• Device detection:
o Uses platform.system() to branch between Windows/Linux.
o On Linux: runs lsblk to list block devices.
o On Windows: enumerates drive letters via wmic logicaldisk.
o Always detects Android by checking adb devices.
• Wipe methods:
o Quick (1 pass), Standard (3 passes), DOD (7 passes) – based on the US DoD 5220.22 M overwriting standard.
o Implements overwriting using file level operations (dd on Android, open/write cycles on attached storage).
• Android-specific:
o Uses ADB commands to remove user directories (rm -rf /sdcard/DCIM, etc.).
o Overwrites storage with zeros (dd if=/dev/zero of=/sdcard/wipefile).
o Sends am broadcast -a android.intent.action.MASTER_CLEAR for factory reset.
• Theory:
Overwriting storage multiple times reduces the chance of data remanence; accepted patterns like the DoD method specify multiple passes with varying byte patterns. - recovery.py – Data recovery wrapper
• PhotoRec integration:
o The class points to the PhotoRec executable path.
o Three recovery types: deleted files, USB, SSD.
o Each method launches PhotoRec (subprocess.Popen) for user guided scanning.
• Theory:
PhotoRec is a forensic tool that ignores filesystem metadata, scanning raw sectors to reconstruct files—useful when the filesystem is damaged or when files were removed. - Frontend (index.html, static/*)
• UI layout:
Cards for “Secure Data Wiper” and “Android Device Wiper” plus buttons that call JS functions.
• JavaScript:
o Uses fetch API to send POST requests with JSON payloads.
o Alerts users with operation status or error messages.
• Styling:
o Dark theme with neon green accents to evoke a “hacker style” interface. - Project configuration
• .gitignore excludes virtual environment, caches, IDE files, and optionally recovered_files.
• requirements.txt pins Flask and Werkzeug versions.
• README.md documents setup, usage, and warnings.
⚠️ Warnings & Best Practices
• Data destruction is irreversible—never run wipe operations on drives that contain needed data.
• Always test on disposable media or virtual machines.
• Keep the Android device in USB debugging mode if you want to use the ADB functionality.
• Recovery only works when data hasn’t been overwritten; once wiping has run, recovery is effectively impossible.
✅ Summary
This project leverages Python and Flask to provide a lightweight but powerful interface for secure data wiping and recovery. It combines platform detection, system utilities (ADB, PhotoRec), and simple web technologies to deliver cross platform functionality.
If you need theory elaborations (e.g., data remanence principles, secure delete algorithms, filesystem behavior), let me know—I can expand further!
•
•
•
Raptor mini (Preview) • 1x
Tracks Applied (1)
Requestly – Creative Use Challenge
Requestly
Technologies used