Spaces:
Running
Running
import subprocess import re import requests import json # العنوان MAC المستهدف MAC_ADDRESS = "D6:A6:7E:E1:7F:42" # 1. تنظيف وتنسيق العنوان def format_mac(mac): return re.sub(r'[^a-fA-F0-9]', '', mac).upper() # 2. استخراج OUI (الأول 6 أحرف) def get_oui(mac): clean_mac = format_mac(mac) if len(clean_mac) < 6: return None return clean_mac[:6] # 3. البحث عن البائع باستخدام API عام (macvendors.com) def lookup_vendor(mac): oui = get_oui(mac) url = f"https://api.macvendors.com/v1/lookup/{oui}" headers = {"Accept": "application/json"} try: response = requests.get(url, headers=headers, timeout=5) if response.status_code == 200: data = response.json() return data.get("vendor_details", {}).get("company_name", "غير معروف") else: return f"خطأ في الاستجابة: {response.status_code}" except Exception as e: return f"فشل الاتصال: {e}" # 4. التحقق مما إذا كان الجهاز متصلًا بالشبكة الحالية (في نفس الـ subnet) def is_device_on_network(mac): try: # جلب جدول ARP المحلي result = subprocess.run(['arp', '-a'], capture_output=True, text=True) arp_output = result.stdout # تنسيق MAC للبحث clean_mac = format_mac(mac) pattern = clean_mac.replace('', '..')[2:-2] # تحويل D6A67E إلى D6:A6:7E أو D6-A6-7E if re.search(pattern[:8].replace('..', ':'), arp_output, re.IGNORECASE): return True return False except Exception as e: print(f"خطأ في فحص ARP: {e}") return False # 5. تحليل ما إذا كان "نظيفًا" (نظريًا) def is_mac_suspicious(mac): oui = get_oui(mac) known_suspicious = [ "000000", "CCCCCC", "111111", # عناوين شائعة في التزييف "DEADBEEF", "BAD00D" ] # تحقق من عناوين مشبوهة if any(susp in oui for susp in ["DEAD", "BEEF", "BAD", "CAFE"]): return True if oui[:4] == oui[2:6]: # مثل A6A6A6 return True return False # 6. الدالة الرئيسية def analyze_mac(mac): print(f"[+] تحليل عنوان MAC: {mac}") print("-" * 50) formatted = format_mac(mac) print(f"[✓] التنسيق الموحّد: {formatted}") oui = get_oui(mac) print(f"[✓] OUI (البائع): {oui}") vendor = lookup_vendor(mac) print(f"[✓] الشركة المصنعة: {vendor}") if "Foxconn" in vendor or "Hon Hai" in vendor: print(f"[✓] الجهاز من إنتاج Foxconn (طبيعي جدًا)") else: print(f"[!] الشركة غير متوقعة: {vendor}") on_network = is_device_on_network(mac) if on_network: print(f"[⚠] الجهاز مرتبط بالشبكة حاليًا") else: print(f"[✓] الجهاز غير مرتبط بالشبكة (ربما مزيف أو بعيد)") if is_mac_suspicious(mac): print(f"[❌] العنوان مشبوه (مزيف أو غير طبيعي)") clean = False else: print(f"[✓] العنوان ليس مشبوهًا من حيث التنسيق") clean = True # الحكم النهائي if "Foxconn" in vendor and on_network and not is_mac_suspicious(mac): print(f"\n[+] الحكم: ✅ الجهاز **نظيف وطبيعي** (محتمل أن يكون جهازك)") else: print(f"\n[!] الحكم: ⚠️ الجهاز **مشبوه أو يحتاج فحصًا إضافيًا**") return clean # --- تنفيذ التحليل --- if __name__ == "__main__": analyze_mac(MAC_ADDRESS) - Initial Deployment
Browse files- README.md +7 -5
- index.html +335 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: r3aaaa
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,335 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>MAC Address Analyzer</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.gradient-bg {
|
11 |
+
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
|
12 |
+
}
|
13 |
+
.result-card {
|
14 |
+
transition: all 0.3s ease;
|
15 |
+
}
|
16 |
+
.result-card:hover {
|
17 |
+
transform: translateY(-5px);
|
18 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
19 |
+
}
|
20 |
+
.suspicious {
|
21 |
+
animation: pulse 2s infinite;
|
22 |
+
}
|
23 |
+
@keyframes pulse {
|
24 |
+
0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
|
25 |
+
70% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
|
26 |
+
100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
|
27 |
+
}
|
28 |
+
.clean {
|
29 |
+
animation: pulse-clean 2s infinite;
|
30 |
+
}
|
31 |
+
@keyframes pulse-clean {
|
32 |
+
0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
|
33 |
+
70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
|
34 |
+
100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
|
35 |
+
}
|
36 |
+
</style>
|
37 |
+
</head>
|
38 |
+
<body class="min-h-screen bg-gray-100">
|
39 |
+
<div class="gradient-bg text-white py-12 px-4">
|
40 |
+
<div class="max-w-4xl mx-auto text-center">
|
41 |
+
<h1 class="text-4xl md:text-5xl font-bold mb-4">MAC Address Analyzer</h1>
|
42 |
+
<p class="text-xl mb-8 opacity-90">Check the legitimacy and details of any MAC address</p>
|
43 |
+
|
44 |
+
<div class="max-w-xl mx-auto bg-white bg-opacity-10 rounded-lg p-6 backdrop-blur-sm">
|
45 |
+
<div class="flex items-center">
|
46 |
+
<input type="text" id="macInput" placeholder="Enter MAC (e.g., D6:A6:7E:E1:7F:42)"
|
47 |
+
class="flex-grow px-4 py-3 rounded-l-lg bg-white bg-opacity-20 text-white placeholder-white placeholder-opacity-70 focus:outline-none focus:ring-2 focus:ring-blue-300">
|
48 |
+
<button id="analyzeBtn" class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-3 rounded-r-lg font-medium transition-colors">
|
49 |
+
<i class="fas fa-search mr-2"></i> Analyze
|
50 |
+
</button>
|
51 |
+
</div>
|
52 |
+
<p class="text-sm mt-2 text-white text-opacity-70">Supports formats: XX:XX:XX:XX:XX:XX, XX-XX-XX-XX-XX-XX, XXXXXXXXXXXX</p>
|
53 |
+
</div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
<div class="max-w-4xl mx-auto px-4 py-8" id="resultsSection" style="display: none;">
|
58 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden mb-8">
|
59 |
+
<div class="p-6">
|
60 |
+
<div class="flex items-center justify-between mb-4">
|
61 |
+
<h2 class="text-2xl font-bold text-gray-800">Analysis Results</h2>
|
62 |
+
<span id="finalVerdict" class="px-4 py-2 rounded-full text-sm font-semibold"></span>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
66 |
+
<div class="result-card bg-gray-50 p-6 rounded-lg border border-gray-200">
|
67 |
+
<h3 class="text-lg font-semibold text-gray-700 mb-3">Basic Information</h3>
|
68 |
+
<div class="space-y-4">
|
69 |
+
<div>
|
70 |
+
<p class="text-sm text-gray-500">Original MAC</p>
|
71 |
+
<p id="originalMac" class="font-mono text-gray-800"></p>
|
72 |
+
</div>
|
73 |
+
<div>
|
74 |
+
<p class="text-sm text-gray-500">Formatted MAC</p>
|
75 |
+
<p id="formattedMac" class="font-mono text-blue-600"></p>
|
76 |
+
</div>
|
77 |
+
<div>
|
78 |
+
<p class="text-sm text-gray-500">OUI (Vendor Prefix)</p>
|
79 |
+
<p id="oui" class="font-mono text-purple-600"></p>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
<div class="result-card bg-gray-50 p-6 rounded-lg border border-gray-200">
|
85 |
+
<h3 class="text-lg font-semibold text-gray-700 mb-3">Vendor Details</h3>
|
86 |
+
<div class="space-y-4">
|
87 |
+
<div>
|
88 |
+
<p class="text-sm text-gray-500">Manufacturer</p>
|
89 |
+
<p id="vendor" class="font-medium"></p>
|
90 |
+
</div>
|
91 |
+
<div>
|
92 |
+
<p class="text-sm text-gray-500">Vendor Reputation</p>
|
93 |
+
<p id="vendorReputation" class="flex items-center">
|
94 |
+
<span id="vendorIcon" class="mr-2"></span>
|
95 |
+
<span id="vendorText"></span>
|
96 |
+
</p>
|
97 |
+
</div>
|
98 |
+
<div>
|
99 |
+
<p class="text-sm text-gray-500">Network Presence</p>
|
100 |
+
<p id="networkPresence" class="flex items-center">
|
101 |
+
<span id="networkIcon" class="mr-2"></span>
|
102 |
+
<span id="networkText"></span>
|
103 |
+
</p>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
</div>
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<div class="bg-gray-50 px-6 py-4 border-t border-gray-200">
|
111 |
+
<h3 class="text-lg font-semibold text-gray-700 mb-3">Security Analysis</h3>
|
112 |
+
<div class="space-y-4">
|
113 |
+
<div id="macFormatCheck" class="flex items-start">
|
114 |
+
<span class="mr-3 mt-1" id="formatIcon"></span>
|
115 |
+
<div>
|
116 |
+
<p class="font-medium" id="formatText"></p>
|
117 |
+
<p class="text-sm text-gray-600" id="formatDetails"></p>
|
118 |
+
</div>
|
119 |
+
</div>
|
120 |
+
|
121 |
+
<div id="macSuspiciousCheck" class="flex items-start">
|
122 |
+
<span class="mr-3 mt-1" id="suspiciousIcon"></span>
|
123 |
+
<div>
|
124 |
+
<p class="font-medium" id="suspiciousText"></p>
|
125 |
+
<p class="text-sm text-gray-600" id="suspiciousDetails"></p>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
+
|
129 |
+
<div id="macPatternCheck" class="flex items-start">
|
130 |
+
<span class="mr-3 mt-1" id="patternIcon"></span>
|
131 |
+
<div>
|
132 |
+
<p class="font-medium" id="patternText"></p>
|
133 |
+
<p class="text-sm text-gray-600" id="patternDetails"></p>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
<div id="finalJudgement" class="p-6 border-t border-gray-200 text-center">
|
140 |
+
<p class="text-xl font-bold mb-2" id="judgementText"></p>
|
141 |
+
<p class="text-gray-600" id="judgementDetails"></p>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
|
145 |
+
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
|
146 |
+
<div class="p-6">
|
147 |
+
<h3 class="text-xl font-bold text-gray-800 mb-4">About MAC Addresses</h3>
|
148 |
+
<div class="prose max-w-none text-gray-700">
|
149 |
+
<p>A MAC (Media Access Control) address is a unique identifier assigned to network interfaces. The first 6 characters (OUI) identify the manufacturer, while the remaining 6 are device-specific.</p>
|
150 |
+
<p class="mt-2">Some devices may use randomized or spoofed MAC addresses for privacy reasons, which can appear suspicious in security checks. Common manufacturers like Foxconn produce many legitimate devices.</p>
|
151 |
+
</div>
|
152 |
+
</div>
|
153 |
+
</div>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
<footer class="bg-gray-800 text-white py-8 mt-12">
|
157 |
+
<div class="max-w-4xl mx-auto px-4 text-center">
|
158 |
+
<p class="mb-4">MAC Address Analyzer Tool - For educational purposes only</p>
|
159 |
+
<p class="text-gray-400 text-sm">Uses the macvendors.com API for vendor lookup. Network presence detection works only on local networks.</p>
|
160 |
+
</div>
|
161 |
+
</footer>
|
162 |
+
|
163 |
+
<script>
|
164 |
+
document.getElementById('analyzeBtn').addEventListener('click', function() {
|
165 |
+
const macInput = document.getElementById('macInput').value.trim();
|
166 |
+
if (!macInput) {
|
167 |
+
alert('Please enter a MAC address');
|
168 |
+
return;
|
169 |
+
}
|
170 |
+
|
171 |
+
// Show loading state
|
172 |
+
this.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Analyzing...';
|
173 |
+
this.disabled = true;
|
174 |
+
|
175 |
+
// Simulate analysis (in a real app, you'd make API calls)
|
176 |
+
setTimeout(() => {
|
177 |
+
analyzeMAC(macInput);
|
178 |
+
this.innerHTML = '<i class="fas fa-search mr-2"></i> Analyze';
|
179 |
+
this.disabled = false;
|
180 |
+
}, 1000);
|
181 |
+
});
|
182 |
+
|
183 |
+
function analyzeMAC(mac) {
|
184 |
+
// Show results section
|
185 |
+
document.getElementById('resultsSection').style.display = 'block';
|
186 |
+
|
187 |
+
// Format MAC address
|
188 |
+
const formattedMAC = formatMAC(mac);
|
189 |
+
document.getElementById('originalMac').textContent = mac;
|
190 |
+
document.getElementById('formattedMac').textContent = formattedMAC;
|
191 |
+
|
192 |
+
// Get OUI
|
193 |
+
const oui = getOUI(formattedMAC);
|
194 |
+
document.getElementById('oui').textContent = oui;
|
195 |
+
|
196 |
+
// Get vendor (simulated - in real app use API)
|
197 |
+
const vendor = lookupVendor(oui);
|
198 |
+
document.getElementById('vendor').textContent = vendor;
|
199 |
+
|
200 |
+
// Check vendor reputation
|
201 |
+
const isCommonVendor = vendor.includes('Foxconn') || vendor.includes('Hon Hai') ||
|
202 |
+
vendor.includes('Intel') || vendor.includes('Samsung');
|
203 |
+
const vendorReputation = isCommonVendor ?
|
204 |
+
{ icon: '<i class="fas fa-check-circle text-green-500"></i>',
|
205 |
+
text: 'Known manufacturer (common for legitimate devices)', status: 'good' } :
|
206 |
+
{ icon: '<i class="fas fa-exclamation-triangle text-yellow-500"></i>',
|
207 |
+
text: 'Less common manufacturer (check device authenticity)', status: 'warning' };
|
208 |
+
|
209 |
+
document.getElementById('vendorIcon').innerHTML = vendorReputation.icon;
|
210 |
+
document.getElementById('vendorText').textContent = vendorReputation.text;
|
211 |
+
|
212 |
+
// Check network presence (simulated)
|
213 |
+
const isOnNetwork = Math.random() > 0.7; // 30% chance for demo
|
214 |
+
const networkPresence = isOnNetwork ?
|
215 |
+
{ icon: '<i class="fas fa-wifi text-green-500"></i>',
|
216 |
+
text: 'Device detected on local network', status: 'info' } :
|
217 |
+
{ icon: '<i class="fas fa-wifi-slash text-gray-500"></i>',
|
218 |
+
text: 'Device not found on local network', status: 'neutral' };
|
219 |
+
|
220 |
+
document.getElementById('networkIcon').innerHTML = networkPresence.icon;
|
221 |
+
document.getElementById('networkText').textContent = networkPresence.text;
|
222 |
+
|
223 |
+
// Check MAC format
|
224 |
+
const formatCheck = formatMACCheck(formattedMAC);
|
225 |
+
document.getElementById('formatIcon').innerHTML = formatCheck.icon;
|
226 |
+
document.getElementById('formatText').textContent = formatCheck.text;
|
227 |
+
document.getElementById('formatDetails').textContent = formatCheck.details;
|
228 |
+
|
229 |
+
// Check for suspicious patterns
|
230 |
+
const suspiciousCheck = checkSuspicious(oui);
|
231 |
+
document.getElementById('suspiciousIcon').innerHTML = suspiciousCheck.icon;
|
232 |
+
document.getElementById('suspiciousText').textContent = suspiciousCheck.text;
|
233 |
+
document.getElementById('suspiciousDetails').textContent = suspiciousCheck.details;
|
234 |
+
|
235 |
+
// Check repeating patterns
|
236 |
+
const patternCheck = checkPatterns(oui);
|
237 |
+
document.getElementById('patternIcon').innerHTML = patternCheck.icon;
|
238 |
+
document.getElementById('patternText').textContent = patternCheck.text;
|
239 |
+
document.getElementById('patternDetails').textContent = patternCheck.details;
|
240 |
+
|
241 |
+
// Final verdict
|
242 |
+
const isClean = isCommonVendor && !suspiciousCheck.isSuspicious && !patternCheck.isSuspicious;
|
243 |
+
const verdict = isClean ?
|
244 |
+
{ text: '✅ Device appears legitimate',
|
245 |
+
details: 'MAC address matches known manufacturer with no suspicious patterns',
|
246 |
+
class: 'bg-green-100 text-green-800 clean' } :
|
247 |
+
{ text: '⚠️ Device needs further inspection',
|
248 |
+
details: 'Some aspects of this MAC address require additional verification',
|
249 |
+
class: 'bg-yellow-100 text-yellow-800 suspicious' };
|
250 |
+
|
251 |
+
if (suspiciousCheck.isSuspicious || patternCheck.isSuspicious) {
|
252 |
+
verdict.text = '❌ Potentially suspicious MAC';
|
253 |
+
verdict.details = 'This MAC address shows signs of possible spoofing or randomization';
|
254 |
+
verdict.class = 'bg-red-100 text-red-800 suspicious';
|
255 |
+
}
|
256 |
+
|
257 |
+
document.getElementById('finalVerdict').className = verdict.class;
|
258 |
+
document.getElementById('finalVerdict').textContent = verdict.text.split(' ')[0];
|
259 |
+
document.getElementById('judgementText').textContent = verdict.text;
|
260 |
+
document.getElementById('judgementDetails').textContent = verdict.details;
|
261 |
+
document.getElementById('finalJudgement').className = `p-6 border-t border-gray-200 text-center ${verdict.class.includes('suspicious') ? 'suspicious' : 'clean'}`;
|
262 |
+
|
263 |
+
// Scroll to results
|
264 |
+
document.getElementById('resultsSection').scrollIntoView({ behavior: 'smooth' });
|
265 |
+
}
|
266 |
+
|
267 |
+
function formatMAC(mac) {
|
268 |
+
// Remove all non-alphanumeric characters and uppercase
|
269 |
+
const cleanMAC = mac.replace(/[^a-fA-F0-9]/g, '').toUpperCase();
|
270 |
+
|
271 |
+
// Format as XX:XX:XX:XX:XX:XX
|
272 |
+
return cleanMAC.replace(/(.{2})(?=.)/g, '$1:');
|
273 |
+
}
|
274 |
+
|
275 |
+
function getOUI(mac) {
|
276 |
+
return mac.replace(/:/g, '').substring(0, 6);
|
277 |
+
}
|
278 |
+
|
279 |
+
function lookupVendor(oui) {
|
280 |
+
// Simulated vendor database for demo
|
281 |
+
const vendors = {
|
282 |
+
'D6A67E': 'Foxconn International, Inc.',
|
283 |
+
'001122': 'Test Vendor (Suspicious)',
|
284 |
+
'AABBCC': 'Randomized Address',
|
285 |
+
'DEADBE': 'Suspicious Pattern',
|
286 |
+
'BEEF01': 'Suspicious Pattern',
|
287 |
+
'C0FFEE': 'Suspicious Pattern',
|
288 |
+
'123456': 'Test Manufacturer',
|
289 |
+
'ABCDEF': 'Demo Vendor'
|
290 |
+
};
|
291 |
+
|
292 |
+
return vendors[oui] || 'Unknown Manufacturer';
|
293 |
+
}
|
294 |
+
|
295 |
+
function formatMACCheck(mac) {
|
296 |
+
const isValid = /^([0-9A-F]{2}:){5}[0-9A-F]{2}$/.test(mac);
|
297 |
+
return {
|
298 |
+
icon: isValid ? '<i class="fas fa-check-circle text-green-500"></i>' : '<i class="fas fa-times-circle text-red-500"></i>',
|
299 |
+
text: isValid ? 'Valid MAC format' : 'Invalid MAC format',
|
300 |
+
details: isValid ? 'Address follows standard MAC address formatting' : 'Address has formatting issues'
|
301 |
+
};
|
302 |
+
}
|
303 |
+
|
304 |
+
function checkSuspicious(oui) {
|
305 |
+
const suspiciousOuis = ['000000', 'FFFFFF', '123456', 'DEADBE', 'BEEF01', 'C0FFEE'];
|
306 |
+
const isSuspicious = suspiciousOuis.includes(oui);
|
307 |
+
|
308 |
+
return {
|
309 |
+
icon: isSuspicious ? '<i class="fas fa-exclamation-triangle text-red-500"></i>' : '<i class="fas fa-check-circle text-green-500"></i>',
|
310 |
+
text: isSuspicious ? 'Suspicious OUI detected' : 'No suspicious OUI patterns',
|
311 |
+
details: isSuspicious ? 'This OUI is commonly used in testing or spoofing' : 'OUI appears normal',
|
312 |
+
isSuspicious: isSuspicious
|
313 |
+
};
|
314 |
+
}
|
315 |
+
|
316 |
+
function checkPatterns(oui) {
|
317 |
+
// Check for repeating patterns (e.g., A1A1A1) or sequential (e.g., 123456)
|
318 |
+
const isRepeating = /^(.)\1{5}$/.test(oui);
|
319 |
+
const isSequential = oui === '123456' || oui === 'ABCDEF';
|
320 |
+
const isSuspicious = isRepeating || isSequential;
|
321 |
+
|
322 |
+
let details = 'No suspicious patterns detected';
|
323 |
+
if (isRepeating) details = 'Repeating character pattern (common in spoofed addresses)';
|
324 |
+
if (isSequential) details = 'Sequential pattern (common in testing or spoofed addresses)';
|
325 |
+
|
326 |
+
return {
|
327 |
+
icon: isSuspicious ? '<i class="fas fa-exclamation-triangle text-red-500"></i>' : '<i class="fas fa-check-circle text-green-500"></i>',
|
328 |
+
text: isSuspicious ? 'Suspicious pattern detected' : 'No suspicious patterns',
|
329 |
+
details: details,
|
330 |
+
isSuspicious: isSuspicious
|
331 |
+
};
|
332 |
+
}
|
333 |
+
</script>
|
334 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Rayan545454/r3aaaa" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
335 |
+
</html>
|