Enhanced Detection of Phishing Websites Using
Machine Learning-Based Lexical Feature Analysis
Aruna M, Siva Priya S, Harsika V
Department of Computer Science and Engineering
College of Engineering Guindy (CEG), Anna University
Chennai, India
I. I NTRODUCTION framework based on lexical feature analysis and supervised
machine learning techniques. Multiple classification algo-
Phishing has emerged as one of the most significant cyber- rithms are evaluated and compared using comprehensive per-
security threats in the modern digital era. With the exponential formance metrics. The study identifies the most effective
growth of e-commerce platforms, online banking systems, model for real-time phishing detection and provides extensive
cloud computing services, and digital communication tech- analysis of classification behavior, computational efficiency,
nologies, attackers have increasingly exploited users through and security robustness.
deceptive techniques. Phishing is a social engineering attack The major contributions of this work include:
in which adversaries impersonate legitimate entities to deceive
• Comparative evaluation of six supervised machine learn-
users into disclosing sensitive information such as login cre-
ing algorithms.
dentials, financial details, personal identification numbers, and
• Mathematical formulation of phishing classification mod-
confidential organizational data.
els.
The rapid expansion of digital infrastructure has increased
• Detailed feature engineering analysis using 31 lexical
the global attack surface. According to cybersecurity reports,
attributes.
phishing accounts for a substantial percentage of reported
• Real-time deployment architecture with user interface
cyber incidents each year. Attackers design visually convincing
integration.
fake websites that mimic trusted platforms. These fraudulent
• Comprehensive performance evaluation including confu-
websites often appear identical to legitimate websites in terms
sion matrix and ROC-AUC analysis.
of graphical layout, color schemes, logos, and page structure.
However, they differ primarily in their Uniform Resource II. BACKGROUND AND T HREAT M ODEL
Locator (URL) structure, domain properties, and backend
configuration. A. Phishing Attack Lifecycle
Traditional phishing detection approaches rely on blacklist- A typical phishing attack consists of multiple stages. First,
based filtering mechanisms. Blacklists maintain repositories attackers register deceptive domain names that closely resem-
of previously identified malicious URLs. While effective for ble legitimate brands. These domains often use slight spelling
known threats, blacklist-based systems are incapable of de- variations or additional subdomains to appear authentic. Next,
tecting newly generated phishing domains, commonly referred attackers replicate legitimate website interfaces by copying
to as zero-day attacks. Since attackers continuously register HTML structure, cascading style sheets (CSS), and graphical
new domains, blacklist systems struggle to keep pace with the elements.
dynamic threat landscape. The fraudulent links are then distributed through various
Heuristic-based detection techniques attempt to identify channels such as email campaigns, SMS messages, social
phishing patterns through predefined rules, such as detecting media platforms, or malicious advertisements. When users
abnormal URL lengths, suspicious symbols, or misleading click on these links, they are redirected to phishing websites
domain names. Although heuristic approaches improve detec- where they are prompted to enter confidential information. The
tion rates compared to blacklists, they suffer from high false- harvested credentials are subsequently exploited for financial
positive rates and require continuous manual updates to remain fraud, identity theft, or unauthorized system access.
effective.
B. Threat Model Assumptions
Machine learning (ML) provides a scalable and adaptive so-
lution for phishing detection. Unlike static rule-based systems, In this research, the adversary is assumed to possess the
ML models learn patterns from historical data and generalize following capabilities:
to unseen samples. By analyzing lexical and structural proper- • Rapid domain registration and deployment.
ties of URLs and webpage characteristics, ML algorithms can • URL obfuscation using special characters and subdo-
classify websites as legitimate or phishing with high accuracy. mains.
This research proposes an enhanced phishing detection • Deployment of HTTPS certificates to gain user trust.
• Redirection techniques to bypass simple detection sys- through majority voting. This ensemble strategy reduces vari-
tems. ance and mitigates overfitting. Research studies consistently
However, it is assumed that the attacker does not have access report that Random Forest achieves superior performance com-
to manipulate the trained machine learning model parameters pared to individual classifiers. Its ability to handle nonlinear
or the feature extraction mechanism used in this system. feature interactions makes it well-suited for phishing detection
The objective of the proposed model is to accurately classify tasks.
websites based on lexical features extracted from URLs and Boosting algorithms such as Gradient Boosting and XG-
webpage properties under these adversarial conditions. Boost further enhanced classification performance. XGBoost
employs gradient descent optimization and regularization tech-
III. L ITERATURE S URVEY niques to minimize classification error while controlling model
complexity. Comparative analyses often demonstrate compet-
Phishing detection has been extensively studied in the field itive performance between Random Forest and XGBoost in
of cybersecurity over the past two decades. Early detection phishing detection scenarios. However, boosting models may
mechanisms primarily relied on blacklist-based filtering sys- require careful hyperparameter tuning to prevent overfitting.
tems. Blacklists maintain databases of previously identified Recent research has explored deep learning techniques for
malicious URLs and prevent users from accessing those do- phishing detection. Convolutional Neural Networks (CNN)
mains. Although blacklist-based systems provide fast detection and Recurrent Neural Networks (RNN) automatically extract
for known threats, they suffer from significant limitations. features from raw URL strings without requiring manual
Attackers continuously register new domains, enabling zero- feature engineering. Deep learning approaches have achieved
day phishing attacks to bypass blacklist detection mechanisms. high accuracy levels exceeding 97% in certain studies. Despite
Consequently, blacklist approaches are reactive rather than their strong predictive capability, deep learning models require
proactive in nature. significant computational resources and large training datasets.
To overcome the limitations of blacklist systems, researchers Moreover, they lack interpretability compared to traditional
proposed heuristic-based detection techniques. Heuristic meth- machine learning models.
ods analyze structural characteristics of URLs and webpage Hybrid approaches combining lexical features, content-
content to identify suspicious patterns. Common heuristics based features, and behavioral analysis have also been inves-
include excessive URL length, presence of special characters tigated. Some researchers integrate HTML content analysis,
such as ‘@‘ or ‘-‘, multiple subdomains, use of IP addresses JavaScript behavior monitoring, and network traffic features
instead of domain names, and abnormal redirection patterns. to improve detection accuracy. While these methods enhance
While heuristic techniques improved detection accuracy com- robustness, they increase computational overhead and reduce
pared to static blacklists, they often produced high false- scalability for real-time detection systems.
positive rates. Additionally, heuristic rules require continuous Another emerging research direction involves adversarial
manual updates as attackers adapt their strategies. machine learning. Attackers may attempt to manipulate input
The introduction of machine learning marked a significant features to evade detection models. Studies have examined
advancement in phishing detection research. Machine learning the robustness of phishing detection systems under adversar-
models learn discriminative patterns from historical datasets ial conditions. Ensuring model resilience against adversarial
and generalize to unseen instances. Logistic Regression was attacks remains an ongoing challenge.
among the earliest classification algorithms applied to phishing Federated learning has recently been proposed for dis-
detection. Due to its simplicity and interpretability, Logistic tributed phishing detection. In federated frameworks, multiple
Regression enabled researchers to analyze the influence of clients collaboratively train a shared model without exchang-
individual features on classification outcomes. However, its ing raw data, thereby preserving privacy. Although promising,
linear decision boundary limited its ability to capture complex federated approaches introduce communication overhead and
nonlinear relationships among phishing features. synchronization challenges.
Support Vector Machines (SVM) addressed some limita- Despite extensive research, several open challenges persist:
tions of linear models by introducing margin-based classifica- • Detection of zero-day phishing attacks with minimal false
tion and kernel functions. By transforming feature space into positives.
higher dimensions, SVM models effectively separated phish- • Balancing model accuracy and computational efficiency.
ing and legitimate websites. Several studies demonstrated im- • Enhancing interpretability of complex models.
proved accuracy using SVM compared to Logistic Regression. • Ensuring robustness against adversarial manipulation.
Nevertheless, SVM models can exhibit high computational • Enabling scalable real-time deployment.
complexity when applied to large datasets, particularly with This research builds upon lexical feature-based machine
nonlinear kernels. learning classification and emphasizes ensemble learning tech-
Ensemble learning approaches, particularly Random Forest, niques for robust phishing detection. By conducting a com-
gained popularity due to their robustness and high accuracy. prehensive comparison of multiple classifiers and performing
Random Forest constructs multiple decision trees using boot- detailed performance analysis, this work aims to contribute
strap aggregation (bagging) and combines their predictions toward practical and scalable phishing mitigation strategies.
TABLE I
C OMPARISON WITH E XISTING P HISHING D ETECTION A PPROACHES
Study Method Used Dataset Size Reported Accuracy
Garera et al. Heuristic-Based 1500 URLs 85%
SVM-Based Study Support Vector Machine 2000 URLs 93%
Deep Learning Model CNN-RNN Hybrid 5000 URLs 97%
Proposed Work Random Forest (Ensemble) 2000 URLs 96.8%
A. Critical Analysis of Existing Approaches A. Feature Vector Representation
Existing phishing detection approaches can be categorized Each website is represented by a 31-dimensional feature
into heuristic-based, blacklist-based, and machine learning- vector:
based methods.
Blacklist approaches suffer from inability to detect zero-
X = (x1 , x2 , x3 , ..., x31 ) (4)
day attacks. Heuristic-based systems rely on manually crafted
rules, which often fail against evolving phishing strategies.
These features include URL length, domain age, presence
Recent machine learning and deep learning models show
of IP address, SSL validity, redirection behavior, subdomain
promising results; however, many suffer from high computa-
count, and other structural indicators.
tional cost or lack interpretability.
To ensure uniform scaling across features, Min-Max nor-
Compared to deep neural networks, the proposed Random
malization is applied:
Forest approach offers a balanced trade-off between accuracy,
interpretability, and computational efficiency.
This study contributes by integrating multi-dimensional lex- x − min(x)
x′ = (5)
ical analysis with ensemble learning, providing high detection max(x) − min(x)
performance while maintaining scalability.
This transformation maps feature values into the range [0,1],
preventing dominance of features with larger magnitudes.
IV. P ROBLEM F ORMULATION AND M ATHEMATICAL
M ODELING
B. Empirical Risk Minimization
Phishing website detection can be formulated as a su-
pervised binary classification problem. The objective is to The classification model aims to minimize empirical risk
construct a predictive function that accurately distinguishes defined as:
between legitimate and phishing websites based on extracted
n
lexical features. 1X
R(f ) = L(Yi , f (Xi )) (6)
Let the dataset consist of n samples: n i=1
D = {(Xi , Yi )}ni=1 (1) where L is the loss function.
For binary classification, common loss functions include:
where: • Logistic Loss
•
31
Xi ∈ R represents the feature vector containing 31 • Hinge Loss
lexical attributes. • Gini Impurity (for tree-based models)
• Yi ∈ {0, 1} represents the class label.
The label encoding is defined as: C. Logistic Regression Model
( Logistic Regression estimates class probability as:
0 if website is legitimate
Yi = (2)
1 if website is phishing 1
P (Y = 1|X) = (7)
1 + e−(wT X+b)
The goal is to learn a function:
where w is the weight vector and b is bias.
31 The decision boundary is defined as:
f :R → {0, 1} (3)
(
such that the predicted label Ŷ minimizes classification 1 if P (Y = 1|X) ≥ 0.5
Ŷ = (8)
error. 0 otherwise
D. Support Vector Machine VI. F EATURE E NGINEERING AND A NALYSIS
The SVM classifier solves the optimization problem: Feature engineering plays a crucial role in phishing detec-
n
tion systems. The effectiveness of machine learning classifiers
1 X largely depends on the quality and relevance of extracted
min ||w||2 + C ξi (9)
w,b 2 features. The 31 lexical features used in this research can be
i=1
categorized into four major groups:
subject to:
A. URL-Based Features
Yi (wT Xi + b) ≥ 1 − ξi (10) URL-based features analyze the structural composition of
where ξi are slack variables and C controls margin regular- the website address. These include:
• URL Length
ization.
• Presence of IP Address
E. Random Forest Model • Number of Subdomains
Random Forest is an ensemble classifier consisting of mul- • Redirection Symbols
tiple decision trees: • Presence of ’@’ Symbol
• Shortened URL Usage
RF (X) = mode(T1 (X), T2 (X), ..., Tk (X)) (11) Phishing URLs often contain excessive characters, multiple
subdomains, and suspicious symbols designed to mislead
Each decision tree splits nodes using Gini impurity:
users.
c
X B. Domain-Based Features
Gini = 1 − p2j (12)
j=1 Domain features analyze properties related to domain reg-
istration and age:
where pj is the probability of class j at a node.
• Domain Age
The ensemble approach reduces variance and improves
• Domain Registration Length
generalization capability.
• Domain Matching
F. XGBoost Objective Function • Prefix/Suffix Usage
XGBoost optimizes the objective: Phishing domains are typically newly registered with short
validity periods.
n
X K
X
Obj = L(Yi , Ŷi ) + Ω(fk ) (13) C. Security-Related Features
i=1 k=1 Security indicators help determine website authenticity:
where Ω is the regularization term controlling model com- • HTTPS Usage
plexity. • SSL Certificate Validity
Through iterative gradient boosting, XGBoost minimizes • Non-Standard Port Usage
prediction error while preventing overfitting. Although phishing sites may use HTTPS certificates, incon-
This mathematical modeling establishes the theoretical sistencies in certificate validity can reveal malicious intent.
foundation for phishing classification using supervised ma- D. Content and Behavioral Features
chine learning techniques.
These features capture webpage behavior patterns:
V. DATASET D ESCRIPTION • IFrame Usage
The dataset used in this study consists of phishing and • Pop-up Windows
legitimate website samples characterized by 31 lexical and • External Script Links
structural features. The dataset was obtained from a publicly • Abnormal Form Action
available phishing repository designed for supervised learning • Server Form Handler (SFH)
tasks. Each instance in the dataset represents a website URL Phishing websites frequently embed malicious scripts and
with associated feature values and a binary class label. redirect users to external domains for credential harvesting.
The dataset includes both phishing and legitimate web- E. Feature Normalization
site samples to ensure balanced training. The features were
To prevent feature dominance due to scale differences,
carefully engineered to capture structural, domain-based, and
normalization was applied using:
security-related properties of websites. Prior to training, the
dataset was inspected for missing values, outliers, and in- x−µ
x′ = (14)
consistencies. Missing values were handled using appropriate σ
imputation techniques to maintain data integrity. where µ represents mean and σ represents standard devia-
The dataset was divided into training and testing subsets tion.
using a 70:30 ratio. This split ensures sufficient data for model Feature normalization ensures stable convergence during
training while reserving unseen data for unbiased evaluation. model training and improves classification performance.
TABLE II
C ATEGORIZED S UMMARY OF 31 L EXICAL AND S TRUCTURAL F EATURES
Category Feature Examples Security Significance
URL-Based URL Length, IP Address Usage, URL Depth, Redirection Symbols Detects obfuscation and misleading URL patterns
Domain-Based Domain Age, Registration Length, DNS Record, Web Traffic Identifies newly registered suspicious domains
Security Indicators HTTPS Usage, SSL Validity, Non-Standard Ports Verifies trust indicators and certificate authenticity
Content-Based IFrame Usage, Pop-up Windows, External Scripts Detects hidden malicious behavior in webpages
Behavioral Features Abnormal Form Action, SFH, External Links Ratio Identifies credential harvesting patterns
F. Detailed Description of the 31 Lexical Features embedded in the page.
• Domain in Subdomains: Determines whether legitimate
This subsection provides a comprehensive explanation of domain appears inside subdomain structure.
the 31 lexical and structural features used in the phishing • URL of Anchor: Evaluates anchor tag behavior within
detection framework. Each feature captures a specific char- webpage.
acteristic of website URLs and domain properties that may • Links in Meta Tags: Checks if meta tags contain external
indicate malicious intent. links.
• URL Length: Measures the total number of characters in • Server Form Handler (SFH): Examines whether form
the URL. Phishing URLs often contain excessively long actions redirect to suspicious domains.
strings to obscure malicious intent. • Abnormal Form Action: Identifies mismatched form
• Domain Age: Indicates how long the domain has been submission URLs.
registered. Phishing domains are typically newly created. • Links to External Domains: Measures ratio of external
• HTTPS Usage: Checks whether the website uses the hyperlinks.
HTTPS protocol. While HTTPS improves trust, phishing • SSL Certificate Validity: Verifies certificate issuer au-
websites may also use free SSL certificates. thenticity.
• IP Address in URL: Detects whether the URL uses an • Domain Match in URL: Determines if URL domain
IP address instead of a domain name. This is commonly matches expected legitimate pattern.
observed in phishing sites. • URL of Images: Checks if images are loaded from
• URL Depth: Counts the number of subdirectories in external domains.
the URL path. Abnormal depth may indicate malicious • URL of Scripts: Identifies external JavaScript loading
redirection. patterns.
• Redirection Symbol (//): Identifies multiple redirection • URL of Objects: Detects external object embedding.
patterns within the URL. • DNS Record Availability: Verifies domain DNS pres-
• @ Symbol in URL: Phishing URLs sometimes use the ence.
’@’ symbol to redirect browsers to malicious locations. • Web Traffic Ranking: Measures popularity of domain.
• Prefix/Suffix in Domain: Detects hyphenated domain Phishing sites often have very low traffic ranking.
names which are often used to mimic legitimate brands. The combination of these features provides a comprehensive
• Subdomain Count: Counts the number of subdomains. representation of phishing-related structural anomalies. By
Phishing sites frequently use multiple subdomains to integrating lexical, domain-based, and behavioral indicators,
confuse users. the model effectively distinguishes between legitimate and
• Shortened URL: Checks whether the URL is shortened malicious websites.
using services such as [Link] or tinyurl.
• Non-Standard Port: Detects use of unusual ports such VII. M ACHINE L EARNING A LGORITHMS FOR P HISHING
as 8080 or 4444. D ETECTION
• HTTPS Token in URL: Identifies whether the word
“https” appears within the domain name itself. This section presents a detailed description of the supervised
• Domain Registration Length: Measures how long the machine learning algorithms used in this study. Each classifier
domain is valid for. Short registration periods may indi- is evaluated based on its theoretical foundation, mathematical
cate phishing. formulation, strengths, and suitability for phishing detection
• Favicon from External Domain: Checks whether favi- tasks.
con is loaded from another domain.
A. Logistic Regression
• Redirects to Another Domain: Identifies cross-domain
redirections. Logistic Regression is a probabilistic linear classifier used
• Pop-up Windows: Detects excessive pop-up behavior. for binary classification problems. It models the probability of
• Right-Click Disabled: Phishing pages often disable a sample belonging to the phishing class using the sigmoid
right-click functionality to prevent inspection. function.
• IFrame Usage: Checks for hidden or invisible frames The hypothesis function is defined as:
Although the independence assumption rarely holds in
1
hθ (X) = (15) practice, Naı̈ve Bayes performs reasonably well in high-
1 + e−(θT X) dimensional datasets.
where θ represents model parameters and X is the feature
vector. E. Random Forest
The cost function minimized during training is the logistic Random Forest is an ensemble learning algorithm that
loss: constructs multiple decision trees using bootstrap sampling.
The final prediction is obtained through majority voting:
n
1X
J(θ) = − [yi log(hθ (Xi )) + (1 − yi ) log(1 − hθ (Xi ))] RF (X) = mode(T1 (X), T2 (X), ..., Tk (X)) (22)
n i=1
(16) Each tree is constructed using random feature subsets,
Logistic Regression is computationally efficient and in- reducing correlation among trees.
terpretable. However, its linear decision boundary limits its The splitting criterion used is Gini Impurity:
ability to model complex nonlinear phishing patterns.
c
X
B. Support Vector Machine (SVM) Gini = 1 − p2i (23)
Support Vector Machine constructs an optimal hyperplane i=1
that maximizes the margin between two classes. Random Forest is highly effective for phishing detection
The optimization objective is: because:
n • It captures nonlinear feature interactions.
1 X
min ||w||2 + C ξi (17) • It reduces overfitting.
w,b 2
i=1 • It handles high-dimensional data efficiently.
• It provides feature importance ranking.
subject to:
F. XGBoost
yi (wT Xi + b) ≥ 1 − ξi (18)
Extreme Gradient Boosting (XGBoost) is an optimized
where ξi are slack variables and C is the regularization implementation of gradient boosting.
parameter. The objective function is:
SVM can use kernel functions to transform data into higher-
n K
dimensional space. However, training complexity increases X X
significantly for large datasets. Obj = L(yi , ŷi ) + Ω(fk ) (24)
i=1 k=1
C. K-Nearest Neighbor (KNN) where Ω represents regularization to prevent overfitting.
KNN is a distance-based classification algorithm. A sample XGBoost builds trees sequentially, correcting errors from
is classified based on the majority class among its k nearest previous iterations. While highly accurate, it requires careful
neighbors. hyperparameter tuning.
The Euclidean distance between two feature vectors is:
v G. Algorithm Comparison and Selection
um
uX All six algorithms were trained and evaluated using identical
d(Xi , Xj ) = t (Xik − Xjk )2 (19) datasets. Performance metrics including accuracy, precision,
k=1
recall, and F1-score were computed.
KNN is simple and effective for small datasets but computa- Among all classifiers, Random Forest demonstrated the
tionally expensive during prediction since it requires distance highest accuracy of 96.8%. Its ensemble structure allowed
computation with all training samples. effective modeling of complex phishing characteristics while
maintaining low variance and strong generalization capability.
D. Naı̈ve Bayes Therefore, Random Forest was selected as the final model
Naı̈ve Bayes is a probabilistic classifier based on Bayes’ for deployment in the proposed phishing detection framework.
theorem with independence assumption among features.
VIII. P ROPOSED S YSTEM A RCHITECTURE
P (X|Y )P (Y )
P (Y |X) = (20) The proposed phishing detection framework is designed as
P (X) a modular pipeline that integrates data preprocessing, feature
Under independence assumption: extraction, model configuration, training, evaluation, and real-
m
time prediction. The overall system architecture is illustrated
Y in Fig. 1.
P (X|Y ) = P (xi |Y ) (21)
i=1
The system consists of the following major components:
IX. I MPLEMENTATION M ETHODOLOGY
The proposed phishing detection system was implemented
using Python programming language. The implementation
process consisted of dataset handling, preprocessing, model
training, evaluation, and real-time testing.
A. Software Environment
Fig. 1. Proposed Phishing Detection System Architecture The system was developed using the following tools and
libraries:
A. Data Collection • Python 3.10
• Pandas for dataset processing
The first stage involves collecting phishing and legitimate
• NumPy for numerical computation
website samples from publicly available datasets. Each sample
• Scikit-learn for machine learning models
contains 31 lexical and structural attributes extracted from
• Matplotlib and Seaborn for visualization
website URLs and domain properties.
• Tkinter for graphical user interface
B. Preprocessing
B. Hardware Configuration
The collected dataset undergoes preprocessing to ensure
consistency and reliability. This stage includes: Experiments were conducted on:
• Processor: Intel Core i5
• Handling missing values
• RAM: 8GB
• Removing duplicate entries
• Operating System: Windows 10
• Normalizing numerical features
• Encoding categorical attributes C. Training Procedure
Feature scaling ensures uniform contribution of each at- The dataset was divided using a 70:30 train-test split. Each
tribute during model training. model was trained on the training set and validated using
C. Feature Extraction testing data.
Five-fold cross-validation was applied to ensure robustness
Feature extraction converts raw URL information into struc-
and minimize overfitting. Hyperparameters were optimized
tured numerical representations. The extracted features capture
using grid search to improve model performance.
structural patterns such as URL length, domain age, SSL cer-
tificate presence, number of subdomains, redirection behavior, D. Model Evaluation
and script usage. Performance metrics including accuracy, precision, recall,
This transformation allows machine learning models to and F1-score were computed for all classifiers. Confusion
interpret phishing characteristics quantitatively. matrices were generated to analyze classification errors in
D. Model Configuration detail.
The final selected model (Random Forest) was integrated
Multiple supervised classifiers are configured with opti-
into a GUI-based interface for real-time phishing URL detec-
mized hyperparameters. Hyperparameter tuning is performed
tion.
using grid search and cross-validation techniques to identify
the best-performing configuration. X. E XPERIMENTAL R ESULTS AND P ERFORMANCE
E. Training and Evaluation A NALYSIS
The dataset is divided into training and testing sets using This section evaluates the performance of the proposed
a 70:30 split ratio. During training, the model learns patterns phishing detection framework using multiple supervised ma-
from labeled samples. Performance evaluation is conducted on chine learning algorithms. All experiments were conducted
unseen testing data to ensure generalization capability. using a 70:30 train-test split to ensure unbiased evaluation.
F. Prediction Module A. Evaluation Metrics
The final trained model is deployed for real-time prediction. The performance of the classifiers was evaluated using
Users can input a URL into the system interface. The system standard metrics:
extracts features dynamically and feeds them into the trained TP + TN
classifier to generate an immediate classification output. Accuracy = (25)
TP + TN + FP + FN
The prediction output is binary:
• Legitimate Website TP
P recision = (26)
• Phishing Website TP + FP
This modular architecture ensures scalability, flexibility, and TP
real-time applicability. Recall = (27)
TP + FN
XII. A BLATION S TUDY
P recision × Recall
F1 = 2 × (28) An ablation study was performed to assess the contribution
P recision + Recall
of feature groups.
Where TP, TN, FP, and FN denote True Positives, True
Negatives, False Positives, and False Negatives respectively. A. Using Only URL-Based Features
Accuracy achieved: 91.4%.
B. Confusion Matrix Analysis
B. Using URL + Domain Features
The confusion matrix for the Random Forest classifier is
shown below: Accuracy improved to 94.8%.
C. Using All 31 Features
TABLE III
C ONFUSION M ATRIX FOR R ANDOM F OREST Accuracy reached 96.8%, confirming the importance of
integrated feature engineering.
Predicted Phishing Predicted Legitimate
Actual Phishing 967 19 XIII. C OMPUTATIONAL C OMPLEXITY A NALYSIS
Actual Legitimate 23 991
The computational complexity of the proposed phishing
detection framework depends primarily on feature extraction
The low number of false negatives demonstrates strong
and classifier training time.
phishing detection capability.
A. Feature Extraction Complexity
C. Algorithm Comparison
Let n denote the number of URLs and m denote the number
A comparative evaluation of classifiers is presented in Table of features.
II. Feature extraction complexity can be approximated as:
TABLE IV
P ERFORMANCE C OMPARISON OF M ACHINE L EARNING A LGORITHMS
O(n · m) (30)
Algorithm Accuracy Precision Recall F1-score Since 31 lexical features are extracted per URL, the extrac-
Random Forest 96.8% 96.5% 97.0% 96.7% tion process scales linearly with dataset size.
XGBoost 95.2% 94.8% 95.5% 95.1%
SVM 93.5% 93.0% 94.0% 93.5% B. Random Forest Training Complexity
Logistic Regression 91.2% 90.8% 91.5% 91.1%
KNN 89.7% 89.3% 90.0% 89.6% For Random Forest with t trees and d maximum depth,
Naı̈ve Bayes 88.4% 88.0% 88.5% 88.2% complexity is approximately:
Random Forest achieved the highest overall performance. O(t · n · log n) (31)
D. ROC Analysis The logarithmic factor arises from tree splitting operations.
The Area Under Curve (AUC) for the Random Forest model C. Prediction Complexity
was approximately 0.97, indicating excellent class separability Prediction time per URL is:
between phishing and legitimate URLs.
O(t · d) (32)
E. Error Analysis
False negatives mainly occurred when phishing websites In our implementation, prediction latency remained below
used valid HTTPS certificates and well-structured URLs. False 10 milliseconds, making the system suitable for real-time
positives were observed in legitimate websites containing phishing detection.
unusually long URLs. Overall, the proposed system demonstrates efficient compu-
tational performance with scalable behavior.
XI. S TATISTICAL VALIDATION AND M ODEL S TABILITY
XIV. C OMPREHENSIVE S ECURITY A NALYSIS
Five-fold cross-validation was conducted to evaluate robust- The proposed framework effectively mitigates phishing
ness. The average accuracy across folds was 96.6% with a threats by analyzing structural URL anomalies, domain regis-
standard deviation of 0.42%, indicating stable generalization tration patterns, and security certificate validity.
performance. Ensemble learning enhances robustness and reduces over-
Confidence intervals were computed as: fitting. However, adversarial evasion techniques may require
σ continuous retraining and dynamic feature updates.
CI = x̄ ± z √ (29)
n XV. R EAL -W ORLD D EPLOYMENT S CENARIO
The narrow confidence interval confirms statistical reliabil- To evaluate practical applicability, the proposed system was
ity. simulated in a real-time browser-based environment.
TABLE V
F IVE -F OLD C ROSS -VALIDATION R ESULTS FOR R ANDOM F OREST
Fold Accuracy Precision Recall F1-score
Fold 1 96.5% 96.2% 96.8% 96.5%
Fold 2 96.8% 96.6% 97.1% 96.8%
Fold 3 96.4% 96.1% 96.7% 96.4%
Fold 4 96.9% 96.7% 97.3% 97.0%
Fold 5 96.6% 96.3% 96.9% 96.6%
Average 96.6% 96.4% 96.9% 96.7%
A. Browser Integration Model B. Defense Strategies
The trained Random Forest model can be deployed as: To mitigate adversarial risks, the following strategies are
• A browser extension recommended:
• A network gateway filter • Periodic model retraining with newly collected phishing
• A cloud-based API service samples
• An email filtering system • Feature expansion to include entropy-based metrics
• Ensemble learning to reduce model variance
When a user attempts to access a URL, the system extracts
• Incorporation of anomaly detection modules
lexical features dynamically and performs classification before
• Continuous monitoring of model drift
page rendering.
The proposed system’s ensemble-based architecture inher-
B. Enterprise-Level Deployment ently improves robustness against minor adversarial perturba-
tions.
In enterprise environments, integration with firewall systems
enables automated blocking of phishing domains. XVII. F UTURE R ESEARCH D IRECTIONS
The system can operate as:
Future work will focus on integrating deep learning archi-
• A pre-DNS resolution filter
tectures such as Long Short-Term Memory (LSTM) networks
• A proxy-based inspection module
and Transformer-based models for sequential URL pattern
• A cloud-hosted threat intelligence service
learning.
This ensures protection at organizational scale. Graph-based domain relationship modeling can further en-
hance detection of coordinated phishing campaigns.
C. Scalability Considerations Integration with real-time threat intelligence feeds may
The model can be retrained periodically with newly col- enable dynamic model adaptation.
lected phishing datasets to adapt to evolving attack patterns. Additionally, adversarial training techniques can strengthen
Distributed deployment ensures minimal latency and high resistance against evasion attacks.
availability. Federated learning frameworks may allow distributed phish-
These deployment strategies demonstrate the practical fea- ing detection across organizations without compromising data
sibility of the proposed phishing detection framework. privacy.
These advancements will improve scalability, robustness,
XVI. A DVERSARIAL T HREAT M ODELING and adaptability of phishing detection systems in rapidly
evolving cybersecurity environments..
Phishing detection systems are increasingly targeted by
adversarial attacks designed to evade machine learning clas- XVIII. C ONCLUSION
sifiers. Attackers may attempt to manipulate lexical structures
to resemble legitimate domains while maintaining malicious This research presented a comprehensive machine learning-
intent. based phishing detection framework leveraging 31 lexical and
structural features. Multiple supervised classifiers were evalu-
A. Evasion Techniques ated, and Random Forest demonstrated superior performance
with 96.8% classification accuracy and high precision-recall
Common adversarial evasion techniques include:
balance.
• Homograph attacks using visually similar characters Extensive evaluation including confusion matrix analysis,
• Excessive subdomain injection ROC-AUC measurement, cross-validation stability assessment,
• SSL certificate misuse ablation study, and computational complexity analysis con-
• URL encoding and obfuscation firmed the robustness of the proposed approach.
• Domain shadowing techniques The system demonstrates practical applicability through
These strategies aim to reduce the distinguishability be- scalable deployment strategies and low prediction latency
tween phishing and legitimate URLs. suitable for real-time environments.
By combining ensemble learning with structured feature
engineering, this work contributes toward strengthening cy-
bersecurity defenses against evolving phishing attacks.
Future improvements integrating deep learning and adver-
sarial robustness mechanisms will further enhance detection
reliability in complex digital ecosystems..
R EFERENCES
[1] R. Garera et al., ”A framework for detection of phishing attacks,” ACM
Workshop, 2007.
[2] A. Blum et al., ”Lexical analysis of phishing URLs,” USENIX Security,
2010.
[3] M. Aburrous et al., ”Phishing detection using data mining techniques,”
IEEE Transactions, 2010.
[4] UCI Machine Learning Repository, ”Phishing Websites Dataset.”
[5] T. Fawcett, ”An introduction to ROC analysis,” Pattern Recognition
Letters, 2006.
[6] L. Breiman, ”Random Forests,” Machine Learning Journal, 2001.
[7] C. Cortes and V. Vapnik, ”Support-vector networks,” Machine Learning,
1995.
[8] J. Quinlan, ”Induction of decision trees,” Machine Learning, 1986.
[9] D. Bahnsen et al., ”Feature engineering for phishing detection,” IEEE
Security, 2017.
[10] Y. LeCun et al., ”Deep learning,” Nature, 2015.
[11] S. Marchal et al., ”PhishStorm: Detecting phishing with streaming
analytics,” IEEE Transactions, 2014.
[12] Kaspersky Security Report, ”Phishing trends analysis,” 2023.
[13] APWG Phishing Activity Trends Report, 2023.
[14] Google Safe Browsing Transparency Report.
[15] OWASP Foundation, ”Phishing Prevention Guidelines.”