The Secure Syscall Interface is a web-based application designed to provide a secure and user-friendly interface for managing system calls. It includes features such as user authentication, file operations, syscall execution, and logging. The project is built using a Python backend with SQLite database and a responsive frontend.
- Login: Users can log in with their credentials to access the system.
- Registration: New users can register with a username, password, and role (e.g.,
useroradmin). - Role-Based Access: The application supports role-based access control for different functionalities.
- Read Files: Users can read file content using the read syscall.
- Write Files: Users can write content to files using the write syscall.
- File Management: Users can open and close files using the open and close syscalls.
- File Information: Users can get file information using the stat syscall.
- Syscall Explorer: Users can view available system calls including:
open: Open a fileread: Read from a filewrite: Write to a fileclose: Close a filegetpid: Get process IDstat: Get file information
- Execute Syscalls: Users can select a syscall, provide parameters, and execute it securely.
- Dynamic Parameters: The interface dynamically adjusts based on the selected syscall's requirements.
- Syscall Logs: All executed syscalls are logged with details such as:
- Username
- Syscall name
- Parameters
- Result
- Timestamp
- Filter Logs: Users can filter logs by username or syscall name.
- A theme toggle button allows users to switch between light and dark modes.
- Python 3.8 or higher
- SQLite (included with Python)
pipfor installing Python dependencies- A modern web browser (e.g., Chrome, Firefox)
-
Clone the repository:
git clone https://github.com/your-repo/secure-syscall-interface.git cd secure-syscall-interface -
Install Python dependencies:
pip install -r requirements.txt
-
Start the application:
python app.py
-
Open the application: Navigate to
http://localhost:5000in your browser.
The project is organized as follows:
Secure Syscall Interface/
│
├── app.py # Main Python backend application
├── requirements.txt # Python dependencies
│
├── static/ # Frontend static files
│ ├── index.html # Main HTML file
│ ├── styles.css # CSS for styling the application
│ ├── script.js # JavaScript for frontend functionality
│
├── templates/ # Flask templates folder
│ └── index.html # Main template file
│
└── data/ # Folder for storing user-created files
-
Register:
- Navigate to the registration page.
- Enter a username, password, and role.
- Submit the form to create an account.
-
Login:
- Enter your username and password on the login page.
- Upon successful login, you'll be redirected to the syscall explorer dashboard.
-
File Operations:
- Use the file input field to specify a file name.
- Perform open, read, write, close, or stat operations as needed.
-
Execute Syscalls:
- Select a syscall from the dropdown menu.
- Provide the required parameters.
- Execute the syscall and view the result.
-
View Logs:
- Navigate to the logs section to view recent syscall logs.
- Use filter options to narrow down logs by username or syscall name.
-
POST /api/register
- Description: Registers a new user.
- Request Body:
{ "username": "string", "password": "string", "role": "string" } - Response:
{ "message": "User registered successfully" } - Status: 201 (Success), 400 (Invalid input)
-
POST /api/login
- Description: Authenticates a user.
- Request Body:
{ "username": "string", "password": "string" } - Response:
{ "message": "Login successful", "token": "string" } - Status: 200 (Success), 401 (Unauthorized)
-
GET /api/syscalls
- Description: Fetches available syscalls.
- Response:
{ "syscalls": ["open", "read", "write", "close", "getpid", "stat"] } - Status: 200 (Success)
-
POST /api/execute
- Description: Executes a specified syscall.
- Request Body:
{ "syscall": "string", "params": { "param1": "value1", ... } } - Response:
{ "result": "string" } - Status: 200 (Success), 400 (Invalid syscall)
-
GET /api/logs
- Description: Retrieves syscall logs.
- Response:
{ "logs": [{ "username": "string", "syscall": "string", "params": {}, "result": "string", "timestamp": "string" }] } - Status: 200 (Success)
- Syscall Execution: Syscalls are executed in a restricted environment to prevent unauthorized access.
- Authentication: Passwords are hashed using bcrypt before storage.
- Input Validation: All user inputs are sanitized to prevent common vulnerabilities.
- Role-Based Access: Admin users have elevated privileges, while regular users are restricted to safe operations.
-
Invalid Credentials:
- Issue: Login fails with an "Invalid credentials" error.
- Solution: Ensure the username and password are correct.
-
File Descriptor Errors:
- Issue: File operations fail with descriptor errors.
- Solution: Ensure files are opened correctly before performing operations.
-
Port Conflict:
- Issue:
http://localhost:5000is not accessible. - Solution: Check if another service is using port 5000.
- Issue:
- Add support for more syscall types.
- Implement advanced role-based access control.
- Improve logging with export options.
- Add unit tests for backend and frontend components.
This project is licensed under the MIT License.
- Harsh Kumar, Aditya Gupta and Prakhar Mishra - Developer