{"id":25925463,"url":"https://github.com/thecoderadi/torunmask","last_synced_at":"2025-03-03T18:48:34.170Z","repository":{"id":279099559,"uuid":"937272384","full_name":"TheCoderAdi/TORUnmask","owner":"TheCoderAdi","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-23T18:41:06.000Z","size":13893,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-23T19:29:12.792Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheCoderAdi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-22T18:35:45.000Z","updated_at":"2025-02-23T18:41:09.000Z","dependencies_parsed_at":"2025-02-23T19:29:22.826Z","dependency_job_id":null,"html_url":"https://github.com/TheCoderAdi/TORUnmask","commit_stats":null,"previous_names":["thecoderadi/torunmask"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderAdi%2FTORUnmask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderAdi%2FTORUnmask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderAdi%2FTORUnmask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCoderAdi%2FTORUnmask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheCoderAdi","download_url":"https://codeload.github.com/TheCoderAdi/TORUnmask/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241723390,"owners_count":20009412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-03T18:48:31.012Z","updated_at":"2025-03-03T18:48:34.164Z","avatar_url":"https://github.com/TheCoderAdi.png","language":"JavaScript","readme":"# **TOR Unmask 🚀**  \n### **De-anonymizing TOR Traffic Using Machine Learning**  \n\n## **📌 Overview**  \nTOR (The Onion Router) enables anonymous communication, but it can also be exploited for cybercrime. **TOR Unmask** is a **machine learning-based system** that detects and classifies TOR and non-TOR network traffic using network flow analysis.  \n\n## **💡 Features**  \n✅ Detects whether a network flow is from **TOR or Non-TOR**  \n✅ **98.8% accuracy** using **RandomForestClassifier**  \n✅ Real-time classification with a **Flask API**  \n✅ Feature selection for optimized **prediction speed**  \n✅ **React.js frontend** for user-friendly testing  \n\n---\n\n## **🚀 Tech Stack**  \n- **Machine Learning:** Scikit-Learn, Pandas, NumPy  \n- **Backend:** Flask, Joblib, SMOTE  \n- **Frontend:** React.js  \n- **Deployment:** Flask API  \n\n---\n\n## **📂 Dataset \u0026 Features**  \nThe model is trained on a dataset with **15 selected network flow features**, after removing redundant ones.  \n\n📌 **Selected Features:**  \n```\nFlow Duration, Flow Bytes/s, Flow Packets/s, Flow IAT Mean, Flow IAT Std, \nFlow IAT Max, Flow IAT Min, Fwd IAT Mean, Fwd IAT Std, Fwd IAT Max, \nFwd IAT Min, Bwd IAT Mean, Bwd IAT Std, Bwd IAT Max, Bwd IAT Min\n```  \n\n---\n\n## **🔧 Installation \u0026 Setup**  \n\n### **1️⃣ Clone the Repository**  \n```bash\ngit clone https://github.com/TheCoderAdi/TORUnmask\ncd TOR-Unmask\n```\n\n### **2️⃣ Install Dependencies**  \n```bash\npip install -r src/requirements.txt\n```\n\n### **3️⃣ Train the Model**  \n```bash\npython src/train.py\n```\nThis will save the trained model as `best_model.pkl`.\n\n### **4️⃣ Run the Flask API**  \n```bash\npython app.py\n```\nFlask API will start at:  \n🔗 **http://127.0.0.1:5000/predict**  \n\n### **5️⃣ Test with cURL**  \n#### **Test Non-TOR Sample:**  \n```bash\ncurl -X POST \"http://127.0.0.1:5000/predict\" -H \"Content-Type: application/json\" \\\n-d '{\"features\": [0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0]}'\n```\n\n#### **Test TOR Sample:**  \n```bash\ncurl -X POST \"http://127.0.0.1:5000/predict\" -H \"Content-Type: application/json\" \\\n-d '{\"features\": [4940714, 299553.87, 363.51, 2752.49, 12223.80, 108627, -128, 4127.58, 15000.11, 108830, 3, 8105.28, 20493.49, 108808, 28]}'\n```\n\n---\n\n## **🎯 Results \u0026 Performance**  \n🔥 **Train Accuracy:** 99.95%  \n🎯 **Test Accuracy:** 98.79%  \n🔥 **F1-Score:** 96.47%  \n⚡ **Precision:** 96.78%  \n🔥 **Recall:** 96.18%  \n\n---\n\n## **📜 License**  \nThis project is **open-source** under the MIT License.  \n\n---\n\n## **📩 Contact**  \n💬 **Developer:** Aditya Swayamsiddha  \n🔗 **LinkedIn:** https://www.linkedin.com/in/aditya-swayamsiddha-576ab426a/\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecoderadi%2Ftorunmask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecoderadi%2Ftorunmask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecoderadi%2Ftorunmask/lists"}