Overview
Pakistani mobile users receive a daily stream of WhatsApp forwards, SMS smishing, and email phishing that impersonate brands such as easypaisa, JazzCash, and even NADRA. Traditional regex‑based filters miss novel lure patterns. This lesson explains how to apply machine learning (ML) to build a lightweight phishing CTI classifier, train it on Pakistani‑language datasets, and embed its scores into a SOC’s Sigma pipeline.
Why AI for Pakistani Phishing?
- Urdu‑scripted lures (e.g., “آپ کا اکاؤنٹ روک دیا گیا ہے”) are not caught by Latin‑character heuristics.
- Shortened URLs used in OLX/Daraz scams require dynamic analysis to evaluate reputation.
- Real‑time scoring enables SOC analysts to prioritize high‑risk messages for user education.
Building the Phishing ML Pipeline
- Data Collection – Gather labeled examples from:
- NCCIA 1799 reports of reported phishing SMS/WhatsApp.
- Community feedback on pisa.maahir.io.
- Open‑source datasets (e.g., PhishTank) filtered for Pakistani phone numbers or Urdu text.
- Feature Engineering – Extract features such as:
- URL length and presence of
@symbols. - Domain age (via WHOIS query).
- Presence of Urdu keywords (“اکاؤنٹ”, “تصدیق”).
- Sender reputation score (e.g., number of reports in the last 30 days).
- URL length and presence of
- Model Training – Use scikit‑learn’s
RandomForestClassifier. Split data 70/20/10 for training/validation/test. Aim for > 95 % recall on the “phishing” class. - Integration – Deploy the trained model as a lightweight REST API using Flask. In ELK, route incoming logs of SMS/WhatsApp through Logstash, call the API, and write the phishing score to a new field
phishing_score. - Sigma Rule – Write a Sigma rule that alerts when
phishing_score > 0.85and the message contains a URL pointing to a domain not in the organization’s whitelist. - Feedback Loop – When an analyst confirms a false positive, retrain the model monthly with the new labeled data.
Do / Don’t
- Do keep a human‑in‑the‑loop for scores above 0.85; never auto‑block without review.
- Do preserve language diversity in training data—include both Urdu and Roman‑Urdu examples.
- Don’t rely solely on blacklists; AI catches novel lures that haven’t been catalogued.
- Don’t expose the model API publicly without rate limiting; attackers could probe it to evade detection.
Takeaway
Download the sample dataset from pisa.maahir.io (Phishing‑PK‑Dataset), run the provided Python notebook to train a RandomForest model, and score a week’s worth of real SMS logs. Even a simple 80 % accurate model will surface the most dangerous Urdu‑language phishing attempts for your SOC to act on.
