Lexical Phishing URL Detection: Random Forest versus SVM with SHAP Explanations
Phishing remains a persistent threat, and lexical analysis of the Uniform Resource Locator (URL) can block suspicious addresses before any page content is downloaded. This study compares Random Forest, linear Support Vector Machine (SVM), and radial basis function (RBF) SVM for phishing URL detection on the public PhiUSIIL dataset, using two main feature scenarios: all 50 numeric features and 18 purely lexical features computed from the URL string. After 808 duplicate feature vectors were removed, 234,987 URLs were split once into stratified training and test sets (80:20), the models were tuned by five-fold cross-validation, and their predictions were explained with SHapley Additive exPlanations (SHAP). With all features, Random Forest made no test errors, but one derived similarity feature supplied 57.1% of its explanation, so this scenario is not a realistic upper bound. With lexical features only, F1-scores reached 0.9970 for Random Forest, 0.9976 for linear SVM, and 0.9977 for RBF SVM. Random Forest made significantly more errors than both SVMs, which did not differ from each other. Linear SVM was the most practical model, with no false positives and a prediction time of 0.17 ms per 1,000 URLs. However, a one-line rule that labels bare HTTPS addresses as legitimate reached an F1-score of 0.9956, because every legitimate URL in the dataset shares that structure. Lexical detection therefore appears easier on this benchmark than it probably is in practice, and cross-dataset validation is needed before deployment.
Authors
- Tukiyat Tukiyat (ORCID: https://orcid.org/0000-0001-7586-6237)
- Febriyansyah (ORCID: https://orcid.org/0009-0003-7846-5668)
Institutions
- Universitas Pamulang (ID)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-29
- DOI
- https://doi.org/10.5281/zenodo.24642837
- Primary Topic
- Spam and Phishing Detection
- Type
- preprint