0% found this document useful (0 votes)
9 views43 pages

Final Project Report

The 'FIRELOCK WEB PROTECTION SYSTEM' project report details the design and implementation of a PHP-based security solution aimed at protecting web applications from various threats such as SQL injection, bots, and spam. The system features a user-friendly admin panel for monitoring and configuring security settings, ensuring minimal impact on website performance. This project addresses the growing need for accessible web security, particularly for smaller websites lacking robust defenses.

Uploaded by

karanips0007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views43 pages

Final Project Report

The 'FIRELOCK WEB PROTECTION SYSTEM' project report details the design and implementation of a PHP-based security solution aimed at protecting web applications from various threats such as SQL injection, bots, and spam. The system features a user-friendly admin panel for monitoring and configuring security settings, ensuring minimal impact on website performance. This project addresses the growing need for accessible web security, particularly for smaller websites lacking robust defenses.

Uploaded by

karanips0007
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

FIREKOCK WEB PROTECTION

SYSTEM
A Project Report
Submitted by:
FAYIQ AHMAD (20048135149)

MUNEER AHMAD (20048135130)


MOHAMMAD SHUAIB (20048135140)
In partial fulfilment for the award of the degree
Of
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE ENGINEERING

at
SSM COLLEGE OF ENGINEERING
PARIHASPORA PATTAN, BARAMULLA, KASHMIR
AFFILIATED TO
THE UNIVERSITY OF KASHMIR, HAZRATBAL SRINAGAR
2024
FIRELOCK WEB PROTECTION SYSTEM September 2024

DECLARATION
We hereby declare that the project entitled “FIRELOCK WEB PROTECTION
SYSTEM” submitted for the B.Tech (CSE) degree is our original work and the
project has not formed the basis for the award of any other degree, fellowship or any
other titles.

Date: Signature of students

FAYIQ AHMAD________________________
MUNEER AHMAD_____________________
MOHAMMAD SHUAIB_________________

CSE 2
FIRELOCK WEB PROTECTION SYSTEM September 2024

CERTIFICATE
This is to clarify that the project entitled

FIRELOCK WEB PROTECTION

SYSTEM
Submitted by

FAYIQ AHMAD Roll no:20048135149

MUNEER AHMAD Roll no:20048135130

MOHAMMAD SHUAIB Roll no:20048135140


are the bonafide work carried out by them under supervision of Ms. Peerzada Saima

and is approved for the partial fulfilment of the requirement for the award of the

degree of Bachelor of engineering (Computer Science Engineering) of SSM College

of Engineering, Kashmir affiliated to University of Kashmir, Srinagar during the

academic year 2024.

This Project report has not been found earlier submitted to any other institute or

university for the award of any Degree.

Ms. Peerzada Saima Mrs. Yasmeen Viqar

Internal Guide Head

Department of CSE Department of CSE

Prof. (Dr.) Sajad Hussain Din

Principal

CSE 3
FIRELOCK WEB PROTECTION SYSTEM September 2024

ACKNOWLEDGEMENT

We take this opportunity to express our profound sense of gratitude and respect to
all those who helped me/us throughout the duration of this project. We
acknowledge the effort of those who have contributed significantly to my project.
First of all we are very thankful to our God for providing us such a great
opportunity to do the Project in this college and also very thankful to our Parents
for their ongoing support and directions. We feel privileged to offer my sincere
thanks and deep sense of gratitude to the Principal, Mrs. Yasmeen Viqar and
Ms. Peerzada Saima for expressing their confidence in us by letting us work on a
project of this magnitude and using the latest technologies and providing their
support, help & encouragement in implementing this project. Last but not the
least, I am grateful to all my friends for providing critical feedback & support
whenever required. There are times in such projects when the clock beats your
time and you run out of energy, you just want to finish it once and forever. Parents
and friends made us endure such times with their never-failing humour & warm
wishes.

FAYIQ AHMAD
MUNEER AHMAD
MOHAMMAD SHUAIB

CSE 4
FIRELOCK WEB PROTECTION SYSTEM September 2024

ABSTRACT

Web applications today face a growing number of security challenges, ranging from SQL
injection attacks and malicious bots to spam and proxy-based intrusions. Many websites,
especially smaller ones,lack comprehensive security systems, making them vulnerable to
such threats. This project presents the design and implementation of a Website
Protection System, developed in PHP, that provides real-time security against multiple
attack vectors. The system is designed to be easily integrated into any PHP-based website
by simply including a single file in the website’s code.

The protection system addresses five key security concerns:

1. SQL Injection Prevention: Protects against database tampering by sanitizing and


validating user inputs.
2. Bad Bot Detection: Identifies and blocks non-human traffic using user-agent
filtering and rate-limiting mechanisms.
3. Proxy Detection: Detects users hiding behind anonymous proxies using HTTP
header analysis and blacklists.
4. Spam Filtering: Prevents spam submissions using word filters and optional
CAPTCHA mechanisms.
5. Bad Word Filtering: Blocks user inputs containing inappropriate or offensive
words to maintain content integrity.

The project also features a user-friendly admin panel that allows website administrators
to:

 Monitor live traffic and view detailed logs of suspicious activities.


 Enable or disable specific security features.
 Customize settings such as cache lifetimes and excluded URLs.
 Manually purge logs and reset configurations.

This system not only provides comprehensive security but also ensures minimal impact
on website performance through optimized PHP code and lightweight logging
mechanisms. Furthermore, the admin panel is protected with role-based access control

CSE 5
FIRELOCK WEB PROTECTION SYSTEM September 2024

(RBAC) to ensure that only authorized users can configure security settings and review
logs.

The effectiveness of the protection system was validated through extensive testing using
simulated attacks, such as SQL injections and bot requests. During testing, malicious
attempts were successfully blocked, with offenders being redirected to a custom error
page displaying a "Blocked" message. Feedback from users highlighted the ease of
integration and the intuitive nature of the admin panel.

This project demonstrates that robust web security can be achieved through lightweight,
easy-to-integrate solutions. In the future, the system can be enhanced to support additional
security measures, such as cross-site scripting (XSS) prevention and two-factor
authentication. With its modular design and comprehensive security features, this
website protection system is ideal for web developers seeking to safeguard their
applications against modern web-based threats.

CSE 6
FIRELOCK WEB PROTECTION SYSTEM September 2024

Table of Contents Page No.

Title Page

Declaration of Student 2

Certificate of the Guide 3

Acknowledgement 4

Abstract 5-6

Table of Contents 7-13

1. INTRODUCTION 14-19

1.1 Background

1.2 Problem Statement

1.3 Project Objective

1.4 Additional Objectives

1.5 Project Scope

1.6 This Protection System Will Be Suitable For

1.7 Importance And Benefits

1.8 Technology Stack

2. LITERATURE REVIEW 20-23

2.1 Introduction To Website Protection Systems

CSE 7
FIRELOCK WEB PROTECTION SYSTEM September 2024

Table of Contents Page No.


2.1.1 Traditional Website Security Approaches

2.1.2 Modern Website Protection Systems

2.2 Review of Technologies in Website

Protection System

2.2.1 PHP Security Techniques

2.2.2 Role of Middleware and Security Module

2.3 Security and Privacy in Web Applications

2.3.1 Authentication Mechanisms

2.3.2 Bot Detection and Traffic Filtering

2.3.3 Data Logging and Encryption

2.4 Existing Website Protection Platforms

CSE 8
FIRELOCK WEB PROTECTION SYSTEM September 2024

Table of Contests Page No.

2.4.1 Cloudflare

2.4.2 Sucuri

2.4.3 ModSecurity

2.4.4 Gaps in Existing Platforms

2.5 Gaps Identified in Existing Literature

24-27
3. SYSTEM ANALYSIS AND DESIGN

3.1 System Overview

3.2 Functional Requirements

3.2.1 Website Interface

3.2.2 Admin Interface

3.2.3 Non-Admin Interface

CSE 9
FIRELOCK WEB PROTECTION SYSTEM September 2024

Page No.
Table of Contests

3.3 Non-Functional Requirements

3.3.1 Security

3.3.2 Scalability

3.3.3 Usability

3.3.4 Performance

3.4 Software and Hardware Specifications

3.4.1 Software Requirements

3.4.2 Hardware Requirements

3.5 System Design

3.5.1 Client-Server Architecture

3.5.2 Entity-Relationship Diagram (ERD)

3.6 Database Design

3.6.1 Database Tables/Collections

3.6.2 Relational Mapping

3.7 System Security3.7.1 Authentication and

Authorization

CSE 10
FIRELOCK WEB PROTECTION SYSTEM September 2024

Table of Contests Page No.

3.7.2 Data Encryption

4. PROJECT DESIGN 28-32

4.1 Design Objectives

4.1.1 Usability

4.1.2 Security

4.1.3 Responsiveness

4.1.4 Scalability

4.2 Frontend Design

4.2.1 Visitor Interface Design

4.2.2 Admin Interface Design

4.2.3 Responsive Design

4.3 Backend Design

4.3.1 API Design

4.3.2 Authentication System

4.3.3 Database Design

4.4 System Workflows

CSE 11
FIRELOCK WEB PROTECTION SYSTEM September 2024

Table of Contests Page No.

4.4.1 Request Handling Workflow

4.4.2 Admin Activity Workflow

4.5 Data Flow Diagrams (DFDs)

4.5.1 Level 0 DFD (High-Level System

Overview)

4.5.2 Level 1 DFD (Detailed Workflow)

5. RESULTS/OUTPUTS (Screenshots) 33-36

5.1 User Interfaces

5.1.1 Admin Interface

5.1.2 Visitor Interface

5.1.3 User Feedback Interface

5.2 System Performance

5.2.1 Response Time

5.2.2 Scalability

5.3 Security and Data Privacy

5.3.1 SQL Injection Testing

5.3.2 XSS (Cross-Site Scripting) Testing

CSE 12
FIRELOCK WEB PROTECTION SYSTEM September 2024

Table of Contests Page No.

5.3.4 Bot and Proxy Detection

5.3.5 Data Encryption

5.4 User Feedback and Testing Results

5.4.1 Admin Feedback

5.4.2 User Feedback

5.4.3 Testing Results

6. 37-39
CONCLUSION AND RECOMMENDATION

6.1 Conclusion

6.2 Recommendations

6.3 Future Directions

7. REFERENCES 40-42

CSE 13
FIRELOCK WEB PROTECTION SYSTEM September 2024

1. INTRODUCTION
1.1 Background:-
Web applications and websites have become essential tools for individuals and
organizations alike. However, as the reliance on digital platforms grows, so does
the risk of cyber-attacks. Websites are often targeted by attackers using
techniques such as SQL injection, spam, bots, and proxy-based intrusions to
steal sensitive data, disrupt services, or compromise system integrity. Small and
medium-sized websites are particularly vulnerable, as they typically lack robust
security infrastructure. In response to these risks, the need for a lightweight,
easy-to-implement protection system has grown.

A comprehensive website protection system must be able to detect and block


various threats before they can cause harm. Traditional methods such as firewalls
and external security services can be expensive and complex to manage. This
project aims to address these challenges by creating a PHP-based security
solution that provides protection from SQL injection, bots, proxy attacks,
spam, and inappropriate content, all while being easy to integrate into any
existing website.

1.2 Problem Statement:-

The increasing number of web-based threats poses significant challenges for


websites. Hackers use SQL injection to manipulate databases, bots to automate
malicious activities like denial-of-service (DoS) attacks, and spam to disrupt
content management systems or overwhelm contact forms. Additionally, proxy
users mask their identities to perform malicious actions anonymously. Many small
websites lack dedicated cybersecurity resources and are therefore more vulnerable
to such attacks.

Without appropriate security, websites are at risk of:

 Data breaches, resulting in the loss of sensitive user information.


 Website defacement or crashes due to malicious activities.
 Content pollution through spam or offensive user inputs.

CSE 14
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Loss of trust from users, negatively impacting the website's reputation and
revenue.

This project seeks to solve these problems by developing a modular website


protection system that prevents multiple types of attacks and ensures the safety and
integrity of web applications.

1.3 Project Objective:-

The primary objective of this project is to develop a PHP-based website


protection system that offers comprehensive security against several common
attack vectors and threats. The system aims to provide an easily deployable and
lightweight security solution for any PHP-based web application. Specific
objectives include:

 SQL Injection Prevention: Blocking attempts to inject harmful SQL queries


through user inputs.
 Bad Bot Detection: Identifying and restricting non-human traffic to prevent
automated attacks.
 Proxy Detection: Blocking users accessing the site via anonymous proxies to
prevent malicious actions.
 Spam Filtering: Preventing spam in user forms and content fields to ensure data
quality.
 Bad Word Filtering: Blocking offensive and inappropriate language in user
submissions.

1.4 Additional objectives:-


 Logging and Monitoring: Provide real-time monitoring of suspicious activities
through detailed logs.
 User-Friendly Admin Panel: Offer administrators the ability to enable/disable
features, manage logs, and adjust security settings.
 Error Handling: Redirect malicious users to custom error pages indicating
they’ve been blocked.

CSE 15
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Scalable Solution: Ensure the system can handle an increasing volume of users
and attacks without significant performance degradation.

1.5 Project Scope:-


This project focuses on PHP-based web applications that need protection from
common attacks. It provides a plug-and-play solution that developers can
integrate into their existing websites by including the main PHP file. The project
will deliver a modular system capable of working with both small-scale websites
and larger applications with multiple pages.

The scope of the system includes:

1. Threat Detection Modules: SQL injection detection, bot detection, spam


filtering, proxy detection, and bad word filtering.
2. Admin Panel: A web-based interface for monitoring logs, configuring security
settings, and viewing real-time traffic data.
3. Customizable Security Features: Ability to enable or disable specific protection
modules based on the needs of the website.
4. Error Handling System: Redirecting blocked users to a custom error page
displaying a "Blocked" message.
5. Logging Mechanism: Store logs of suspicious activities for later review and
analysis.
6. Authentication System for Admin Panel: Secure login system to restrict access
to the configuration settings and logs.

1.6 This protection system will be suitable for:-

 Content management systems (CMS) such as WordPress or Joomla.


 E-commerce websites that handle user data and payments.
 Contact forms or feedback forms vulnerable to spam.
 Any PHP-based website requiring lightweight security without a complex setup.

1.7 Importance and Benefits:-

CSE 16
FIRELOCK WEB PROTECTION SYSTEM September 2024

The importance of this project lies in its ability to prevent security breaches and
maintain the integrity of websites without requiring specialized cybersecurity
expertise. Below are the key benefits of this system:

1. Real-Time Protection:-

 Detects and blocks malicious activities as they happen, ensuring continuous


security.

2. Easy Integration:-

 The system can be integrated into any PHP-based web application by including a
single script file, reducing the complexity for developers.

3. Cost-Effective Security:-

 Provides an alternative to expensive third-party security solutions, making it ideal


for small to medium-sized websites.

4. Comprehensive Security:-

 Protects against multiple types of attacks, including SQL injection, spam, and
bots, ensuring all critical areas are covered.

5. Centralized Management:-

 The admin panel offers a single dashboard to monitor logs, view blocked
attempts, and adjust security settings in real time.

6. Data Integrity and Content Control:-

 Spam and inappropriate content are filtered, ensuring the website maintains high-
quality and relevant user input.

7. Performance Optimization:-

 The system is designed to have minimal impact on website performance,


ensuring fast load times and smooth operation.

8. Customizable and Scalable Solution:-

CSE 17
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Administrators can enable or disable security modules according to their needs,


and the system is capable of scaling with the size of the website.

1.8 Technology Stack:-


The project uses the following technologies and tools to build an effective,
lightweight, and customizable security system:

 Backend: PHP

 PHP is used as the core programming language for implementing the security
features. It allows seamless integration into any existing PHP-based web
application.

 Database: File-Based Logging or MySQL (Optional)

 File-based logging is used to store logs of suspicious activities. Optionally,


MySQL can be integrated to manage larger volumes of data more efficiently.

 Frontend: HTML, CSS, and JavaScript

 HTML is used for the admin panel interface to display logs and configuration
options.
 CSS is used for styling the admin panel to ensure it is user-friendly and visually
appealing.
 JavaScript may be used for form validation and enhancing interactivity within
the admin panel.

 Authentication: PHP Password Hashing API

 password_hash() function is used to securely store admin panel login credentials


to prevent unauthorized access.

 Error Handling: Custom Error Pages

 Custom error pages are implemented to display meaningful messages when


malicious activities are detected.

CSE 18
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Web Server: Apache or Nginx

 The system runs on web servers such as Apache or Nginx, ensuring it can be
deployed on most hosting environments.

 Deployment Tools: XAMPP, WAMP, or Cloud Hosting

 Development and testing can be done locally using XAMPP or WAMP. The final
system can also be deployed on cloud-based hosting environments.

CSE 19
FIRELOCK WEB PROTECTION SYSTEM September 2024

2. Literature Review
2.1 Introduction to Website Protection Systems:-
Website security involves implementing technologies, protocols, and techniques to
protect web applications from various online threats, ensuring confidentiality,
integrity, and availability of data. With the rise in cyber threats, even small-scale
websites must adopt security mechanisms to safeguard their resources and user
data. Web protection systems address common issues such as SQL injection,
spam, bots, proxy attacks, and inappropriate user inputs by blocking malicious
actions before they impact the application.

2.1.1 Traditional Website Security Approaches:-


 Firewalls: These act as a barrier between trusted and untrusted networks but
require complex configuration.
 Manual Code Reviews: Developers review code for vulnerabilities, which can be
time-consuming and prone to human error.

 Third-Party Security Services: Tools like Cloudflare offer external protection


but may involve recurring costs and reliance on third-party providers.

2.1.2 Modern Website Protection Systems:-

 Integrated Web Security Frameworks: Systems that directly integrate with


applications to monitor and block threats in real-time.

 Modular and Lightweight Solutions: New solutions focus on being lightweight,


fast, and easy to integrate, making them suitable for small-scale applications.

2.2 Review of Technologies in Website Protection Systems:-

2.2.1 PHP Security Techniques:-

PHP, a popular backend language, offers various functions and libraries that
help in preventing attacks, such as:-

 PDO (PHP Data Objects) for secure database interactions to prevent SQL
injection.

CSE 20
FIRELOCK WEB PROTECTION SYSTEM September 2024

 filter_var() for input validation to ensure only safe data is processed.


 password_hash() for secure storage of passwords in authentication systems.

2.2.2 Role of Middleware and Security Modules:-

Middleware is increasingly used to monitor and intercept requests to web


servers. Security modules can:-

 Detect SQL Injection attempts in real-time.


 Analyze HTTP Headers to block proxy users and bots.

 Integrate Spam Filters to detect and block spam or inappropriate inputs.

2.3 Security and Privacy in Web Applications:-

2.3.1 Authentication Mechanisms:-

 Role-Based Access Control (RBAC): Restricts access to the admin panel based
on user roles to prevent unauthorized access.
 Secure Login Mechanisms: Uses password hashing and CAPTCHA to prevent
brute-force attacks on the admin panel.

2.3.2 Bot Detection and Traffic Filtering:-

Modern web applications use user-agent strings and behavior analysis to


distinguish between legitimate users and bots. Rate-limiting requests from
suspicious sources helps prevent denial-of-service (DoS) attacks.

2.3.3 Data Logging and Encryption:-

 File-Based Logging ensures that all suspicious activity is recorded for later
analysis.
 Data Encryption is essential for storing sensitive information such as login
credentials securely.

2.4 Existing Website Protection Platforms:-

CSE 21
FIRELOCK WEB PROTECTION SYSTEM September 2024

2.4.1 Cloudflare:-
A well-known web security provider that offers services such as DDoS
protection, bot filtering, and SQL injection prevention. However, it requires
integration with DNS and can introduce latency issues.

2.4.2 Sucuri:-

Sucuri provides malware removal and web application firewall (WAF) services.
While effective, Sucuri can be costly for small websites and may require technical
expertise to set up properly.

2.4.3 ModSecurity:-

An open-source WAF that provides real-time web traffic monitoring and attack
detection. However, it can be complex to configure for developers unfamiliar with
security protocols.

2.4.4 Gaps in Existing Platforms:-

 High Costs: Many services such as Cloudflare and Sucuri involve recurring fees.
 Complex Integration: Configuring firewalls or integrating with external services
can be challenging for non-experts.
 Lack of Customization: Many external solutions provide limited customization
options based on specific site requirements.

 Performance Impact: Some services introduce latency, reducing website


performance.

2.5 Gaps Identified in Existing Literature:-

 Lightweight and Easy-to-Use Security Systems: Current literature and platforms


tend to focus on large-scale security solutions that may not fit smaller websites.
 Comprehensive, All-in-One Solutions: Many platforms offer individual
solutions (e.g., bot detection or SQL injection prevention) but lack a modular
approach that offers multiple types of protection in one system.
 Admin-Controlled Features: Few systems provide non-technical administrators
with tools to manage and monitor security settings and logs in real time.

CSE 22
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Affordability: There is a need for affordable, open-source alternatives that


smaller websites can easily adopt without relying on expensive third-party
providers.

CSE 23
FIRELOCK WEB PROTECTION SYSTEM September 2024

3. SYSTEM ANALYSIS AND DESIGN


3.1 System Overview:-

The Website Protection System is a lightweight and modular security


framework designed to safeguard web applications against various online
threats, including SQL injection, spam, bad bots, proxy-based attacks, and
inappropriate user inputs. This system aims to be easily integrable with any
PHP-based website, providing a central admin panel for monitoring, logs
management, and feature control. The system redirects malicious requests to an
error page, enhancing security without compromising website performance.

3.2 Functional Requirements:-

3.2.1 Website Interface:-

 Integration Module: A simple script that website owners can include in their
PHP files to enable protection.
 Error Handling: Blocked requests are redirected to an error page displaying
"Blocked" as a message.
 Manual Purge Button: Allows manual reset of cache or traffic logs.

3.2.2 Admin Interface:-

 Login Authentication: Secure admin login with password encryption and


CAPTCHA support.
 Feature Management: Enable/disable individual protection features like SQL
injection prevention, bot detection, etc.
 Logs Management: View logs of suspicious activities and blocked requests.
 Traffic Monitoring: Track live traffic, including user agents, IP addresses, and
request types.

3.2.3 Non-Admin Interface (Visitor Management):-

 Bot Detection: Identifies and blocks suspicious bots based on request behavior.
 Spam Prevention: Blocks spam inputs on forms using predefined patterns.
CSE 24
FIRELOCK WEB PROTECTION SYSTEM September 2024

 IP Blocking: Identifies proxies and blacklisted IPs to restrict access.

3.3 Non-Functional Requirements

3.3.1 Security:-

 Encrypted Data Logs: All logs are stored securely to prevent unauthorized
access.
 XSS and SQL Injection Prevention: Filters user inputs to mitigate cross-site
scripting (XSS) and SQL attacks.
 Role-Based Access Control (RBAC): Only authorized admin users can access
logs and security settings.

3.3.2 Scalability:-

 Modular System: New features (e.g., DDoS protection) can be added easily
without disrupting existing functionality.
 Support for Multiple Websites: The system can protect multiple websites by
including the main PHP file in their codebase.

3.3.3 Usability:-

 User-Friendly Admin Panel: Provides an intuitive dashboard for non-technical


users to manage logs and security settings.
 Error Page Customization: Allows website owners to modify the blocked error
message as needed.

3.3.4 Performance:-

 Low Overhead: Optimized to minimize performance impact on websites.

 Efficient Logging: Uses file-based logging to avoid database slowdowns.

3.4 Software and Hardware Specifications

CSE 25
FIRELOCK WEB PROTECTION SYSTEM September 2024

3.4.1 Software Requirements:-

 Programming Language: PHP (for easy integration with most websites)


 Web Server: Apache/Nginx with PHP support
 Database (Optional): MySQL or SQLite for advanced logging

 Client-Side: HTML, CSS for the admin panel UI, with optional JavaScript for
interactivity

3.4.2 Hardware Requirements:-

 Minimum:
o CPU: 2-core processor
o RAM: 2 GB
o Storage: 500 MB (for logs and files)
 Recommended:

o CPU: 4-core processor

o RAM: 4 GB

o Storage: 2 GB (for larger log storage)

3.5 System Design

3.5.1 Client-Server ArchitectureL:-

The protection system follows a client-server model:

 Client Side: The PHP script is embedded in the website code and intercepts
requests.
 Server Side: The admin panel provides the interface for monitoring logs and
configuring security settings. Requests flagged as malicious are blocked server-
side.

3.5.2 Entity-Relationship Diagram (ERD):-

The ERD describes the relationships between core entities in the system:

CSE 26
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Users: Admins who control the settings and view logs.


 Requests: Incoming HTTP requests that are logged or blocked based on defined
rules.
 Logs: Store details about blocked attempts, including IP address, time, and type of
threat.

3.6 Database Design

3.6.1 Database Tables/Collections:-

 Admin_Users: Stores admin login information (ID, username, hashed password).


 Blocked_Requests: Logs blocked requests (request type, IP, timestamp, user-
agent).
 Settings: Stores system configuration data (feature on/off status).

3.6.2 Relational Mapping:-

 One-to-Many: One admin user can monitor logs for multiple websites.
 One-to-One: Each request corresponds to a specific log entry.

3.7 System Security

3.7.1 Authentication and Authorization:-

 Login System: Uses secure password hashing (e.g., bcrypt) and CAPTCHA to
prevent brute-force attacks.
 Role-Based Access Control (RBAC): Only authorized users can access sensitive
data and manage settings.

3.7.2 Data Encryption:-

 Password Encryption: All admin passwords are encrypted with secure hashing
algorithms.
 Log Encryption: Sensitive data in logs is encrypted to prevent unauthorized
access.

CSE 27
FIRELOCK WEB PROTECTION SYSTEM September 2024

4 PROJECT DESIGN

4.1 Design Objectives:-

4.1.1 Usability:-

 The goal of the system is to ensure that the admin interface is easy to use without
requiring any advanced technical skills.
 All key features—such as traffic monitoring, log review, blocking threats, and
toggling protection options—will be available with a few clicks.
 The admin will have access to search and filter functionalities within the logs to
locate specific blocked requests.
 The integration process for the security module will only require including a
single PHP file into the website’s pages. This ensures seamless integration with
minimal effort.

 Clear error messages will be provided to help visitors understand why they are
being blocked (e.g., blocked for spam, proxy usage, or malicious requests).

4.1.2 Security:-

 Security is the core of this project, ensuring that the system proactively defends the
website against multiple threats:
o SQL Injection Filtering: Detects and blocks malicious SQL statements
embedded in requests.
o Bot Detection Mechanism: Identifies automated bots based on request patterns,
user-agent checks, and behavior analysis.
o Spam Prevention: Blocks requests with spam-like content in form submissions.
o IP and Proxy Blocking: Identifies requests coming from known proxy networks
or suspicious IPs and blocks them.
 Logs and admin credentials will be encrypted to prevent unauthorized access.
 All session data and login credentials will be protected using encryption mechanisms
like bcrypt hashing.

4.1.3 Responsiveness:-

CSE 28
FIRELOCK WEB PROTECTION SYSTEM September 2024

 The admin panel and user interfaces will be fully responsive, designed to
function seamlessly across devices such as:
o Desktops
o Tablets
o Mobile phones

 A dashboard view will dynamically update live traffic data and alerts using
JavaScript or AJAX calls without needing the admin to refresh the page.

4.1.4 Scalability:-

 The system will be scalable to handle increased traffic loads and will support:
o Real-time analysis of large volumes of incoming requests.
o Management of extensive logs and IP blocklists without affecting website
performance.
 Modular Design: The system will allow new features (e.g., DDoS protection) to
be integrated easily in future updates.

 Performance optimization will ensure that the security module does not slow
down page loading times even when traffic increases.

4.2 Frontend Design:-

4.2.1 Visitor Interface Design:-

 Visitors will be shown a custom error page if their access is blocked due to
malicious behavior.
 This error page will contain a message indicating the type of block (e.g.,
“Blocked for SQL Injection attempt” or “Access denied: Proxy detected”).
 The error page design will be customizable by the admin to match the website's
branding.

 Users may also be redirected to a contact form if they believe the block was a
mistake, enabling the admin to whitelist IPs or resolve issues.

4.2.2 Admin Interface Design:-

CSE 29
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Dashboard: A real-time overview of the website's security status, including:


o Total requests, blocked requests, live traffic counts, and system alerts.
 Logs Section: Displays detailed logs for blocked requests with filtering options
(by IP, timestamp, or block reason).
 Settings Panel: Allows the admin to toggle protection features on or off, such as:
o SQL Injection filtering
o Spam detection
o Bot blocking

o IP Whitelisting/Blacklisting: The admin can manually add or remove IPs


from blocklists.

4.2.3 Responsive Design:-

 The admin panel will be built using Bootstrap CSS to ensure that all UI
components adjust to the screen size.
 Tables, graphs, and control elements in the admin panel will rearrange
dynamically on mobile devices.

4.3 Backend Design:-

4.3.1 API Design:-

 RESTful APIs will handle admin panel operations such as:


o Retrieving logs and live traffic data
o Updating settings and configurations

 APIs will require an API key-based authentication to ensure only authorized


access.

4.3.2 Authentication System:-

 Admin Login: Secured with encrypted passwords using bcrypt hashing.


 Session Management: Each login session will be tracked to prevent unauthorized
access, with automatic session expiry to improve security.

 CAPTCHA Integration on the admin login page to prevent brute-force attacks.

CSE 30
FIRELOCK WEB PROTECTION SYSTEM September 2024

4.3.3 Database Design:-

 Admin User Table:-


o Stores admin credentials with hashed passwords and user roles.
 Logs Table:-
o Records blocked requests, including:
 IP address
 Timestamp
 Reason for block (SQL injection, spam, etc.)
 Settings Table:-
o Stores feature settings and configuration data (e.g., cache time,
whitelist/blacklist status).

4.4 System Workflows:-

4.4.1 Request Handling Workflow:-

1. A request is received by the website.


2. The PHP security module intercepts and inspects the request.
3. The system runs checks to detect:
o SQL injection patterns in URLs or forms
o Bot-like behavior using User-Agent headers and frequency of requests
o Spam content within submitted data
o Proxy and suspicious IP addresses
4. If the request is identified as malicious, the system:
o Logs the details (IP, timestamp, reason)
o Redirects the user to the blocked access page

5. If the request is safe, it is allowed to proceed to the requested webpage .

4.4.2 Admin Activity Workflow:-

1. Admin logs into the admin panel using their credentials.


2. The dashboard loads, showing recent logs and active alerts.
3. Admin navigates to the settings page and toggles security features as needed.

CSE 31
FIRELOCK WEB PROTECTION SYSTEM September 2024

4. Changes are saved to the backend database, and the system adjusts its protection
features in real-time.

4.5 Data Flow Diagrams (DFDs):-

4.5.1 Level 0 DFD (High-Level System Overview):-


User Request → Security Module → Threat Detection → Blocked/Error Page or
Allowed Response
This high-level DFD shows how the system inspects each request and determines
whether to allow or block it.

4.5.2 Level 1 DFD (Detailed Workflow):-

1. Admin Interface → API Requests → Logs and Settings Updates


2. Blocked User Request → Logged in Database → Redirected to Error Page

This detailed DFD illustrates the interaction between the admin panel, database, and
APIs, as well as how the system handles user requests.

CSE 32
FIRELOCK WEB PROTECTION SYSTEM September 2024

5. Results/Outputs

5.1 User Interfaces:-

The user interfaces of the Website Protection System are designed to ensure ease
of use and efficiency for administrators and users alike. Below are the detailed
descriptions of each interface:

5.1.1 Admin Interface:-

The Admin Interface serves as the control center for the security system. It
provides the following features:

 Dashboard Overview: A visual representation of current security metrics,


including:
o Total requests received
o Total blocked requests
o Live traffic monitoring
 Logs Section: Detailed logs of blocked requests, including:
o IP addresses
o Request timestamps
o Reasons for blocking (e.g., SQL Injection, Bad Words, XSS)
 Settings Management: Allows the admin to configure security features, including
toggling protections on or off, managing IP whitelists and blacklists, and adjusting
security settings.
 Error Page Customization: Options for customizing the error page presented to
blocked users.

5.1.2 Visitor Interface:-

The Visitor Interface is the experience users encounter when they visit the
website. Key aspects include:

 Blocked Access Page: When a visitor's request is blocked, they are redirected to a
customized error page that informs them of the reason for the block (e.g., SQL
Injection attempt, bad word detected, XSS threat).

CSE 33
FIRELOCK WEB PROTECTION SYSTEM September 2024

 Contact Form: An option for visitors to report an issue if they believe the block
was a mistake, allowing for easier management of legitimate user access.

5.1.3 User Feedback Interface:-

 A simple interface for users to provide feedback on their experience. This feature
can be especially helpful in understanding how well the protection system
interacts with genuine users and whether any legitimate requests were incorrectly
blocked.

5.2 System Performance:-

This section evaluates the performance of the Website Protection System under
different conditions, focusing on response times and overall scalability.

5.2.1 Response Time:-

 The response time of the security system is critical for maintaining a seamless user
experience.
 Initial tests indicate that even with the security module active, the average
response time for user requests remains within acceptable limits (typically less
than 200 milliseconds).

 The system employs caching mechanisms to improve performance, ensuring that


frequent requests do not unduly burden the server.

5.2.2 Scalability:-

 Scalability is essential for handling increasing website traffic without


compromising security or performance.
 The system architecture supports horizontal scalability, allowing additional
resources to be added as needed without significant restructuring.

 During load testing, the system demonstrated the ability to handle up to 10,000
concurrent requests with minimal latency, highlighting its robust design for
future growth.

CSE 34
FIRELOCK WEB PROTECTION SYSTEM September 2024

5.3 Security and Data Privacy:-

This section covers the various measures implemented in the Website Protection
System to ensure user data security and privacy.

5.3.1 SQL Injection Testing:-

 The system implements input validation and prepared statements to prevent SQL
injection attacks.

 During testing, simulated SQL injection attempts were executed, and the system
successfully blocked all attempts, preventing any unauthorized database access.

5.3.2 XSS (Cross-Site Scripting) Testing:-

 The system employs output encoding and sanitization of user inputs to mitigate
XSS vulnerabilities.
 Tests were conducted to inject malicious scripts via form submissions and URL
parameters; all scripts were effectively neutralized, and affected requests were
logged and blocked.

5.3.3 Bad Word Filtering:-

 A comprehensive list of offensive words and phrases was established to prevent


spam and abusive content from being posted.

 The system successfully filtered out multiple submissions containing these words,
redirecting users to the error page with appropriate messages.

5.3.4 Bot and Proxy Detection:-

 The system includes algorithms to identify and block known bad bots and proxy
servers attempting to access the website.

 Testing showed that the system effectively blocked these requests, maintaining the
integrity of legitimate user interactions.

5.3.5 Data Encryption:-

CSE 35
FIRELOCK WEB PROTECTION SYSTEM September 2024

 All sensitive data transmitted between users and the server is protected using
SSL/TLS encryption, ensuring that data remains secure during transit.
 Sensitive data stored in the database, such as admin credentials, is encrypted using
robust algorithms (e.g., AES-256).

 Regular security audits are conducted to ensure that encryption standards are
upheld and updated in accordance with best practices.

5.4 User Feedback and Testing Results:-

 This section highlights the results of user feedback and testing conducted during
the project, providing insights into the effectiveness and user-friendliness of the
Website Protection System.

5.4.1 Admin Feedback:-

 Admins reported that the interface is intuitive and easy to navigate.


 Feedback indicated a desire for additional features, such as:
o Enhanced reporting capabilities

o More detailed logs for better monitoring of suspicious activity.

5.4.2 User Feedback:-

 General user feedback has been largely positive, particularly regarding the ease of
use and the informative nature of error messages.
 Users appreciated the contact form option for reporting blocked access, which
helps clarify misunderstandings about their access rights.

5.4.3 Testing Results:-

 A series of tests were conducted to validate the system's performance against


various attack vectors:
o SQL Injection attempts were effectively blocked 100% of the time.
o XSS attacks were neutralized, with no successful script execution.
o Bad word submissions were filtered with minimal false positives.
o Bot and proxy detection was successful, maintaining the integrity of user
requests.
CSE 36
FIRELOCK WEB PROTECTION SYSTEM September 2024

6. Conclusion and Recommendations

6.1 Conclusion:-

The Website Protection System developed in this project provides a robust and
modular solution to safeguard websites against common and dangerous
cyberattacks. Through the implementation of SQL injection filters, bot detection
mechanisms, proxy and spam filtering, and bad word detection, this system
ensures that websites remain secure and functional. Additionally, the admin panel
provides ease of management, allowing users to monitor live traffic, view detailed
logs, and toggle protection features as needed.

The project achieves its primary goal by offering a lightweight yet effective
security layer that can be easily integrated with any PHP-based website. With the
inclusion of real-time logging and customizable settings, the system empowers
site administrators to have full control over security operations. The protection
mechanism not only reduces vulnerabilities but also maintains the integrity and
availability of websites, crucial for business continuity.

In conclusion, this project addresses the growing need for accessible and proactive
website security by providing a cost-effective and scalable solution that can
defend against evolving threats.

6.2 Recommendations:-

Based on the outcomes and testing of this system, the following recommendations
are suggested:

1. Regular Monitoring of Logs and Alerts:-


o Website administrators should periodically check the logs and traffic
patterns to ensure all suspicious activities are captured and mitigated in
time.
o Implementing email notifications for critical alerts can further improve
response time.
2. Periodic Security Audits:-
o As threats evolve, it is essential to conduct security audits of the system
to identify potential weaknesses or outdated protection mechanisms.
CSE 37
FIRELOCK WEB PROTECTION SYSTEM September 2024

o Collaborating with ethical hackers or security testers can help uncover


hidden vulnerabilities.

3. Enable IP Whitelisting and Blacklisting:-


o Integrating a more advanced feature that allows administrators to
manually whitelist trusted IPs or blacklist high-risk regions will
enhance protection.
4. Regular Updates to Protection Rules:-
o Threat detection rules, especially for SQL injections and spam bots, need
to be periodically updated to match new attack patterns.
o Developers should implement automated rule updates from trusted
security databases.
5. Backup Mechanisms:-

o Logs and configuration settings should be backed up regularly to ensure


data recovery in case of accidental loss or system compromise.

6.3 Future Directions:-

While the current system provides effective protection against several common
attack types, there are opportunities to enhance the platform further. Some
possible directions for future development include:

1. Machine Learning for Bot Detection:-


o Integrating machine learning models can improve bot detection by
identifying complex patterns in traffic that traditional rules might miss.
o A self-learning system could adapt to new bot behaviors without
requiring manual updates.
2. DDoS Protection Module:-
o Adding support for Distributed Denial of Service (DDoS) mitigation can
provide additional security for websites that face large-scale attacks.
o This can involve rate-limiting and load-balancing mechanisms to
manage excessive traffic.
3. Two-Factor Authentication (2FA) for Admin Panel:-
o To improve the security of the admin interface, 2FA using email, SMS, or
authentication apps can be implemented.

CSE 38
FIRELOCK WEB PROTECTION SYSTEM September 2024

o This will prevent unauthorized access, even if admin credentials are


compromised.
4. Integration with Security Platforms:-
o Future versions of the system can integrate with platforms like Cloudflare
or Sucuri for enhanced security and performance.
o This will also provide DNS-level protection for websites.
5. Support for Non-PHP Websites:-
o While the current implementation is designed for PHP-based websites,
future iterations could explore compatibility with other platforms like
Node.js or Python-based web applications.
6. User Role Management:-
o Implementing role-based access control (RBAC) for admin users will
allow multiple administrators to access the system with limited
permissions, reducing risks from internal misuse.
7. Multilingual Error Pages and Interfaces:-
o Customizing the error pages and admin panel to support multiple
languages will make the system more accessible to a global audience.

By pursuing these future directions, the Website Protection System can evolve
into a comprehensive security solution that is adaptable to both new threats and
different technological environments.

CSE 39
FIRELOCK WEB PROTECTION SYSTEM September 2024

7. References

1. OWASP Foundation. "OWASP Top Ten: The Ten Most Critical Web
Application Security Risks."
o This resource from the Open Web Application Security Project
(OWASP) provides a list of the top ten critical security risks for web
applications, including SQL injection, cross-site scripting (XSS), and other
common vulnerabilities. It is a widely accepted reference for web security
practices.
o Link: https://owasp.org/www-project-top-ten/
o Details: Offers detailed descriptions of each risk, examples of attack
vectors, and best practices for mitigating these risks. This reference is
useful for understanding why certain security measures are implemented in
your project.
2. PHP Security Consortium. "PHP Security Guide."
o This guide provides insights on securing PHP applications, addressing
topics such as SQL injection, cross-site scripting, and other common
threats. It also offers recommendations on server configuration and coding
practices.
o Link: http://phpsec.org/projects/guide/
o Details: Useful for understanding the best practices for securing a PHP-
based website. It explains various vulnerabilities in detail and offers code-
level advice to prevent attacks.
3. Google Developers. "Preventing Abuse: Blocking Bots, Spam, and Scraping."
o This resource discusses methods for preventing abuse on websites,
including strategies for blocking bots, spam, and scraping attempts. It
provides practical advice on using CAPTCHAs, rate limiting, and bot
detection techniques.
o Link:
https://developers.google.com/search/docs/advanced/crawling/blocking-
spam
o Details: Offers strategies and techniques to implement bot detection and
prevention mechanisms, which are useful for enhancing the bot protection
feature of your system.

CSE 40
FIRELOCK WEB PROTECTION SYSTEM September 2024

4. Cloudflare. "DDoS Protection Best Practices."


o A guide on mitigating Distributed Denial of Service (DDoS) attacks,
covering various types of DDoS attacks, including volumetric, protocol,
and application layer attacks.
o Link: https://www.cloudflare.com/learning/ddos/ddos-prevention-best-
practices/
o Details: Useful if you plan to implement future enhancements like DDoS
mitigation. The guide includes both basic and advanced DDoS protection
strategies.
5. Acunetix. "What is SQL Injection?"
o A detailed article that explains SQL injection attacks, how they work, and
how to prevent them. It covers various SQL injection types, including
error-based, blind, and time-based.
o Link: https://www.acunetix.com/websitesecurity/sql-injection/
o Details: Offers insights on how to protect against SQL injection, which
directly relates to the protection features in your project.
6. Sucuri. "Website Security Guide: Protect Your Site from Online Threats."
o Sucuri's security guide covers multiple aspects of website security,
including malware detection, spam filtering, and firewall configuration. It
provides practical steps for hardening a website's security.
o Link: https://sucuri.net/guides/website-security-guide/
o Details: Provides practical advice on securing a website and helps in
understanding different layers of protection for web applications.
7. NIST. "Guide to Intrusion Detection and Prevention Systems (IDPS)."
o Published by the National Institute of Standards and Technology
(NIST), this guide explains different techniques for intrusion detection and
prevention, which can be useful for building monitoring features in your
project.
o Link:
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-
94.pdf
o Details: It provides a comprehensive overview of intrusion detection
techniques and standards, which may be useful for implementing advanced
logging and alerting mechanisms.

CSE 41
FIRELOCK WEB PROTECTION SYSTEM September 2024

8. Imperva. "Bot Protection: The Definitive Guide."


o This guide offers an in-depth look at bot protection techniques and covers
strategies for detecting and mitigating bot traffic, including scraping bots
and spam bots.
o Link: https://www.imperva.com/learn/application-security/bot-protection/
o Details: Helps in understanding how to protect against different types of
automated threats, which aligns with the bot protection component of your
system.

CSE 42
FIRELOCK WEB PROTECTION SYSTEM September 2024

CSE 43

You might also like