landermartin800-maker/spam-email-url-detector
حول
Spam Email URL Detector: Classification-Based Spam URL Detection
الإنتاجية والأتمتةما يمكنك فعله
- Dual detection scope: The tool analyzes two distinct input surfaces in one pass — the textual content of an email (token frequency, header patterns, structural cues) the URLs it carries (lexical structure, domain characteristics, path composition). A message flagged on either surface is surfaced for review, reducing the blind spot of single-signal scanners.
- Reproducible evaluation basis: Results derive from a fixed, documented corpus — 5,572 labeled email samples (83% legitimate, 17% spam) 148,303 labeled URL samples (68% legitimate, 32% spam). Because the dataset composition is disclosed, reported rates can be compared against an organization's own traffic profile before deployment.
- Deterministic, offline-capable operation: Classification runs entirely on local model artifacts. No message content or URL is transmitted to an external service during analysis, so detection works in air-gapped or restricted network environments produces identical verdicts for identical inputs.
- Lightweight resource footprint: The models are trained offline shipped as compact serialized artifacts. Inference requires no GPU no persistent background service, allowing the detector to run on standard analyst workstations or as a batch step in an existing email processing pipeline.
النمو المقاس للنجوم
- خلال 24 ساعة
- ٠
- خلال 7 أيام
- جارٍ جمع السجل
- خلال 15 يومًا
- جارٍ جمع السجل
- خلال شهر
- جارٍ جمع السجل
تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.
README.md
الأصلSpam Email URL Detector is a classification-based security tool for identifying spam emails spam URLs supervised. It evaluates messages links against trained models built on labeled datasets, with documented detection rates reaching 97.9% for email classification via Support Vector 98.8% for URL classification via Decision Tree. The tool compares multiple algorithms—including Random Forest, K-Nearest Neighbors, Multinomial Naive Bayes, Linear Support Vector—so operators can select the model best suited to their environment. Designed for reproducible, measurable results, it provides a transparent dependable layer for filtering unwanted email link-based threats.
✅ Before You Start
- OS: Windows 10 / 11
- Shell: PowerShell 5.1+ or PowerShell 7+
- Network: internet access to download the script
- Privileges: standard user
Features
Multi-model classification engine: Spam Email URL Detector evaluates messages embedded links through an ensemble of supervised classifiers rather than a single heuristic. Decision Tree, K-Nearest Neighbors, Random Forest, Support Vector models are applied to email text, while Decision Tree, Stochastic Gradient Descent, Multinomial Naive Bayes, Linear Support Vector models are applied to URL features. Each model votes independently, results are aggregated for the final verdict.
Dual detection scope: The tool analyzes two distinct input surfaces in one pass — the textual content of an email (token frequency, header patterns, structural cues) the URLs it carries (lexical structure, domain characteristics, path composition). A message flagged on either surface is surfaced for review, reducing the blind spot of single-signal scanners.
Benchmarked accuracy, reported transparently: Detection performance is measured against a labeled corpus published per model, not as a single marketing figure. Email classification reaches 97.99% with Support Vector, 97.06% with Random Forest, 96.77% with Decision Tree, 93.90% with K-Nearest Neighbors. URL classification reaches 98.80% with Decision Tree, 98.52% with Linear Support Vector, 95.27% with Stochastic Gradient Descent, 91.10% with Multinomial Naive Bayes. Users can select the model whose tradeoff between precision recall fits their workload.
Reproducible evaluation basis: Results derive from a fixed, documented corpus — 5,572 labeled email samples (83% legitimate, 17% spam) 148,303 labeled URL samples (68% legitimate, 32% spam). Because the dataset composition is disclosed, reported rates can be compared against an organization's own traffic profile before deployment.
Deterministic, offline-capable operation: Classification runs entirely on local model artifacts. No message content or URL is transmitted to an external service during analysis, so detection works in air-gapped or restricted network environments produces identical verdicts for identical inputs.
Lightweight resource footprint: The models are trained offline shipped as compact serialized artifacts. Inference requires no GPU no persistent background service, allowing the detector to run on standard analyst workstations or as a batch step in an existing email processing pipeline.
Inspectable decision output: Every verdict includes the contributing model scores the feature signals that drove the classification, such as suspicious token patterns or anomalous URL structure. Analysts can audit why a message was flagged instead of relying on an opaque boolean.
Straightforward integration: The detector accepts plain-text email bodies extracted URL strings as input, returning structured classification results suitable for downstream filtering, ticketing, or quarantine workflows without modification to the underlying models.
How It Works
The detector operates as a offline classification pipeline. Input arrives as either raw email text or a standalone URL string; the pipeline then applies the same preprocessing stages to each input type before routing to the appropriate model.
Text normalization. Email bodies are stripped of headers, HTML tags, encoding artifacts, then lowercased tokenized. URLs are parsed into their component parts — scheme, host, path, query, length — with punctuation numeric tokens preserved as features.
Feature extraction. For emails, token frequency vectors are built from the cleaned text. For URLs, the parser emits a structured feature set covering host characteristics, path depth, special-character counts, token statistics. All features are scaled to a consistent range so that no single attribute dominates the decision.
Classification. Each input is passed to the model selected for its type. Email classification uses a trained estimator that maps token vectors to a binary label. URL classification uses a separate estimator trained on the structured feature set. Both models were fitted on labeled corpora their decision thresholds tuned for balanced precision recall.
Output. The pipeline returns a label (spam or legitimate) alongside the underlying score. Scores near the decision boundary are flagged for review rather than forced into a binary answer, which keeps borderline cases visible instead of silently misclassified.
Determinism reproducibility. Preprocessing is stateless applies identical transformations on every run, so the same input yields the same label. Model weights are fixed at release; no online or user data retention occurs during inference. This keeps results auditable makes regressions detectable when inputs are replayed.
Operational scope. The classifier evaluates only the content it is given. It does not resolve URLs, fetch remote resources, or inspect message metadata beyond what is supplied in the input. This boundary keeps the tool self-contained predictable in behavior.
Privacy
Spam Email URL Detector processes all classification tasks locally within the runtime environment. Email content, header metadata, submitted URLs are analyzed in memory are not transmitted to any remote endpoint operated by the project. The detector performs inference the bundled classification models; no telemetry, usage analytics, or diagnostic payloads are generated or forwarded.
Persistent storage is limited to the artifacts the operator explicitly configures. Any cache, log, or output file is written to the local filesystem under the path specified at runtime, retention is governed solely by the host system's policies. Inputs are discarded from memory once classification completes, unless the operator enables on-disk result logging, in which case the resulting records remain under the operator's control.
The classification pipeline is deterministic inspectable: preprocessing, feature extraction, model evaluation occur in sequence with no hidden network calls, side channels, or external lookups during scoring. Operators can audit each stage of the pipeline by inspecting the source the serialized model files shipped with the project.
Because the tool runs under the permissions of the invoking process, isolation boundaries are inherited from the host environment. Operators should apply standard least-privilege practices, restrict filesystem access to required paths, review model artifacts before deployment in sensitive environments. No credentials, account identifiers, or message contents are required for classification, none are retained after the process terminates.
FAQ
Which models does the detector rely on? Spam Email URL Detector uses supervised classification. Email text is handled with Decision Tree, K-Nearest Neighbors, Random Forest, Support Vector classifiers; URL analysis uses Decision Tree, Stochastic Gradient Descent, Multinomial Naive Bayes, Linear Support Vector classification. Reported accuracy on the reference datasets reaches approximately 97.99% for email classification (Support Vector) 98.80% for URL classification (Decision Tree). Actual performance on your own traffic depends on dataset drift preprocessing.
What data was the classifier trained on? The email corpus contains 5,572 samples (roughly 83% legitimate, 17% spam). The URL corpus contains 148,303 samples (roughly 68% legitimate, 32% spam). These proportions are documented so results can be reproduced compared.
Does the tool send my email content or URLs to a remote server? No. Classification runs locally within the project. No email bodies, headers, or URLs are transmitted to external infrastructure for scoring. Any logging is confined to your own environment is under your control.
Can it replace a full mail gateway? No. Spam Email URL Detector is a classification component, not a complete mail transfer agent or filtering gateway. It is intended to be integrated into an existing pipeline or used for analysis evaluation. Treat its output as one signal among several.
How should I interpret a positive result? A positive classification indicates the input resembles patterns present in the training data. It is probabilistic, not a verdict. False positives false negatives occur with every model listed above; review borderline cases before taking irreversible action such as blocking a sender.
Is the project accessible at no cost? Yes. The project is released under the MIT License, which permits use, modification, redistribution under the stated terms. There is no paid tier, license key, or subscription requirement.
Is this an enhancement of an existing scanner or a standalone build? It is a standalone implementation. No third-party detection engine is bundled or required. The source is self-contained so behavior can be audited end to end.
How do I report a misclassification or contribute? Open an issue in the project repository with a sanitized sample (remove personal identifiers) the expected label. Contributions that improve preprocessing, add evaluation metrics, or expand documented test coverage are reviewed on their technical merit.
Disclaimer & License
The Spam Email URL Detector is provided as a static classification model for evaluating email message content embedded URL strings. It performs statistical inference against pre-trained feature sets does not execute, fetch, or resolve any URL contained in submitted data. All classification is performed locally within the process boundary; no message content or URL metadata is transmitted to external infrastructure by the detector itself.
Results produced by the model are probabilistic classifications, not definitive security verdicts. A positive classification indicates statistical similarity to labeled spam spam-associated URL patterns observed in the training corpus, may produce false positives or false negatives depending on input distribution, obfuscation techniques, domain drift over time. The detector must not be treated as a substitute for organizational email gateway policy, sender authentication controls, or manual review of high-risk messages. Consumers of the output are responsible for defining their own threshold escalation logic.
The project is distributed under the MIT License. Permission is granted, at no cost, to any person obtaining a copy of this software associated documentation files, to deal in the software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, /or sell copies of the software, to permit persons to whom the software is furnished to do so, subject to the following conditions: the above copyright notice this permission notice shall be included in all copies or substantial portions of the software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Model artifacts, serialized feature extractors, any bundled training-derived configuration inherit the same license terms as the source code. Redistribution of modified model artifacts must retain the original copyright notice this permission notice. The maintainers make no representation regarding the fitness of the model for regulated environments, provide no indemnification for classification outcomes.
استكشف مشاريع مشابهة ومرتبطة
جارٍ التحميل…

