Advanced forensic analysis tool for detecting security threats in smart vehicular networks.
- Sybil Attack Detection: Identify malicious nodes creating multiple fake identities
- Position Falsification Detection: Detect vehicles broadcasting false GPS coordinates
- Automated Analysis: Python-based backend for comprehensive forensic investigation
- PDF Report Generation: Professional forensic reports with detailed findings
- Modern Web Interface: React-based frontend with intuitive user experience
autoforensics/
├── backend/
│ ├── app.py # Flask application
│ ├── config.py # Configuration
│ ├── requirements.txt # Python dependencies
│ ├── forensics/
│ │ ├── __init__.py
│ │ ├── sybil_attack.py # Sybil detection logic
│ │ └── position_falsification.py # Position detection logic
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── file_handler.py # File operations
│ │ └── pdf_generator.py # PDF generation
│ └── uploads/ # Temporary file storage
├── frontend/
│ ├── public/
│ │ └── index.html
│ ├── src/
│ │ ├── App.js # Main component
│ │ ├── index.js # Entry point
│ │ ├── index.css # Global styles
│ │ └── services/
│ │ └── api.js # API service
│ └── package.json
└── README.md
- Navigate to the backend directory:
cd backend- Create a virtual environment:
python -m venv venv-
Activate the virtual environment:
- Windows:
venv\Scripts\activate - macOS/Linux:
source venv/bin/activate
- Windows:
-
Install dependencies:
pip install -r requirements.txt- Create necessary directories:
mkdir uploads reports- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm installcd backend
python app.pyThe backend will run on http://localhost:5000
cd frontend
npm startThe frontend will run on http://localhost:3000
- Upload File: Select a forensic data file (CSV, JSON, TXT, LOG)
- Choose Analysis: Select either Sybil Attack or Position Falsification analysis
- Review Results: Examine detailed findings and threat indicators
- Download Report: Export comprehensive PDF forensic report
Edit backend/forensics/sybil_attack.py:
def analyze(self, filepath: str) -> Dict[str, Any]:
# Your investigation logic here
# 1. Extract vehicle identities
# 2. Analyze identity patterns
# 3. Check for duplicate behaviors
# 4. Calculate threat level
passEdit backend/forensics/position_falsification.py:
def analyze(self, filepath: str) -> Dict[str, Any]:
# Your investigation logic here
# 1. Extract GPS data
# 2. Validate coordinates
# 3. Analyze movement patterns
# 4. Detect impossible movements
passGET /api/health- Health checkPOST /api/upload- Upload file for analysisPOST /api/analyze/sybil- Analyze for Sybil attackPOST /api/analyze/position- Analyze for position falsificationPOST /api/download/pdf/<type>- Download PDF reportDELETE /api/cleanup/<filename>- Clean up uploaded file
Edit backend/config.py to modify:
- Upload folder location
- Maximum file size
- Allowed file extensions
- Session timeout
- CORS origins
vehicle_id,timestamp,latitude,longitude,speed,...
VEH001,2024-01-01T10:00:00,23.0225,72.5714,45,...
{
"vehicles": [
{
"id": "VEH001",
"timestamp": "2024-01-01T10:00:00",
"position": {"lat": 23.0225, "lon": 72.5714},
"speed": 45
}
]
}- File uploads are sanitized and validated
- Files are stored with unique timestamps
- Automatic cleanup of old files
- CORS configuration for allowed origins
- Input validation on all endpoints
- Create new detector class in
backend/forensics/ - Add API endpoint in
backend/app.py - Create report page component in frontend
- Update API service in
frontend/src/services/api.js
Edit backend/utils/pdf_generator.py to modify:
- Report layout and styling
- Sections and content
- Tables and visualizations
- Header and footer
- Port already in use: Change port in
app.py - Module not found: Ensure virtual environment is activated
- File upload fails: Check
uploads/directory permissions
- API connection fails: Verify backend is running on port 5000
- Module not found: Run
npm install - Build fails: Clear node_modules and reinstall
[Your License Here]
[Your Contact Information]
Developed for vehicular network security research and forensic analysis.