Howie254 commited on
Commit
dbe2dc2
·
verified ·
1 Parent(s): 328366d

create a fully functioning packet sniffer that probes networks and traffic

Browse files
Files changed (2) hide show
  1. README.md +8 -5
  2. index.html +374 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Packet Peeper Pro Spyware
3
- emoji: 🐢
4
- colorFrom: purple
5
- colorTo: red
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: Packet Peeper Pro Spyware 🕵️‍♂️
3
+ colorFrom: green
4
+ colorTo: purple
5
+ emoji: 🐳
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite-v3
10
  ---
11
 
12
+ # Welcome to your new DeepSite project!
13
+ This project was created with [DeepSite](https://deepsite.hf.co).
index.html CHANGED
@@ -1,19 +1,375 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  </html>
 
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>Packet Peeper Pro</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://unpkg.com/feather-icons"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
10
+ <script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
11
+ <style>
12
+ .terminal {
13
+ font-family: 'Courier New', monospace;
14
+ background-color: #1a1a1a;
15
+ color: #00ff00;
16
+ border-radius: 8px;
17
+ height: 300px;
18
+ overflow-y: auto;
19
+ padding: 1rem;
20
+ }
21
+ .packet-row:hover {
22
+ background-color: rgba(0, 255, 0, 0.1);
23
+ }
24
+ @keyframes pulse {
25
+ 0% { opacity: 0.6; }
26
+ 50% { opacity: 1; }
27
+ 100% { opacity: 0.6; }
28
+ }
29
+ .scanning {
30
+ animation: pulse 2s infinite;
31
+ }
32
+ </style>
33
+ </head>
34
+ <body class="bg-gray-900 text-white">
35
+ <div id="vanta-bg" class="fixed inset-0 z-0"></div>
36
+ <div class="relative z-10 container mx-auto px-4 py-8">
37
+ <header class="flex justify-between items-center mb-8">
38
+ <div class="flex items-center">
39
+ <i data-feather="eye" class="text-green-500 mr-2"></i>
40
+ <h1 class="text-3xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-green-400 to-blue-500">
41
+ Packet Peeper Pro
42
+ </h1>
43
+ </div>
44
+ <div class="flex space-x-4">
45
+ <button id="startBtn" class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded-lg flex items-center">
46
+ <i data-feather="play" class="mr-2"></i> Start Sniffing
47
+ </button>
48
+ <button id="stopBtn" class="bg-red-600 hover:bg-red-700 px-4 py-2 rounded-lg flex items-center" disabled>
49
+ <i data-feather="stop-circle" class="mr-2"></i> Stop
50
+ </button>
51
+ </div>
52
+ </header>
53
+
54
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
55
+ <div class="lg:col-span-2 space-y-6">
56
+ <div class="bg-gray-800 bg-opacity-70 rounded-xl p-6 backdrop-blur-sm">
57
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
58
+ <i data-feather="activity" class="mr-2 text-blue-400"></i> Network Traffic
59
+ </h2>
60
+ <div class="h-64">
61
+ <canvas id="trafficChart"></canvas>
62
+ </div>
63
+ </div>
64
+
65
+ <div class="bg-gray-800 bg-opacity-70 rounded-xl p-6 backdrop-blur-sm">
66
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
67
+ <i data-feather="list" class="mr-2 text-purple-400"></i> Packet Log
68
+ </h2>
69
+ <div class="terminal">
70
+ <div id="packetLog" class="space-y-1"></div>
71
+ </div>
72
+ </div>
73
+ </div>
74
+
75
+ <div class="space-y-6">
76
+ <div class="bg-gray-800 bg-opacity-70 rounded-xl p-6 backdrop-blur-sm">
77
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
78
+ <i data-feather="target" class="mr-2 text-red-400"></i> Scan Target
79
+ </h2>
80
+ <div class="space-y-4">
81
+ <div>
82
+ <label class="block text-sm font-medium mb-1">IP Range</label>
83
+ <input type="text" id="ipRange"
84
+ class="w-full bg-gray-700 border border-gray-600 rounded-lg px-3 py-2"
85
+ placeholder="192.168.1.1-255">
86
+ </div>
87
+ <div>
88
+ <label class="block text-sm font-medium mb-1">Ports</label>
89
+ <input type="text" id="ports"
90
+ class="w-full bg-gray-700 border border-gray-600 rounded-lg px-3 py-2"
91
+ placeholder="80,443,22,3389">
92
+ </div>
93
+ <div>
94
+ <label class="block text-sm font-medium mb-1">Protocol</label>
95
+ <select id="protocol" class="w-full bg-gray-700 border border-gray-600 rounded-lg px-3 py-2">
96
+ <option value="all">All</option>
97
+ <option value="tcp">TCP</option>
98
+ <option value="udp">UDP</option>
99
+ </select>
100
+ </div>
101
+ <button id="scanBtn" class="w-full bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-lg flex items-center justify-center">
102
+ <i data-feather="search" class="mr-2"></i> Scan Network
103
+ </button>
104
+ </div>
105
+ </div>
106
+
107
+ <div class="bg-gray-800 bg-opacity-70 rounded-xl p-6 backdrop-blur-sm">
108
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
109
+ <i data-feather="bar-chart-2" class="mr-2 text-yellow-400"></i> Statistics
110
+ </h2>
111
+ <div class="space-y-3">
112
+ <div>
113
+ <div class="flex justify-between text-sm mb-1">
114
+ <span>Packets Captured</span>
115
+ <span id="packetCount">0</span>
116
+ </div>
117
+ <div class="w-full bg-gray-700 rounded-full h-2">
118
+ <div id="packetBar" class="bg-green-500 h-2 rounded-full" style="width: 0%"></div>
119
+ </div>
120
+ </div>
121
+ <div>
122
+ <div class="flex justify-between text-sm mb-1">
123
+ <span>TCP Packets</span>
124
+ <span id="tcpCount">0</span>
125
+ </div>
126
+ <div class="w-full bg-gray-700 rounded-full h-2">
127
+ <div id="tcpBar" class="bg-blue-500 h-2 rounded-full" style="width: 0%"></div>
128
+ </div>
129
+ </div>
130
+ <div>
131
+ <div class="flex justify-between text-sm mb-1">
132
+ <span>UDP Packets</span>
133
+ <span id="udpCount">0</span>
134
+ </div>
135
+ <div class="w-full bg-gray-700 rounded-full h-2">
136
+ <div id="udpBar" class="bg-purple-500 h-2 rounded-full" style="width: 0%"></div>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ </div>
141
+ </div>
142
+ </div>
143
+ </div>
144
+
145
+ <script>
146
+ // Initialize Vanta.js background
147
+ VANTA.NET({
148
+ el: "#vanta-bg",
149
+ mouseControls: true,
150
+ touchControls: true,
151
+ gyroControls: false,
152
+ minHeight: 200.00,
153
+ minWidth: 200.00,
154
+ scale: 1.00,
155
+ scaleMobile: 1.00,
156
+ color: 0x3fff00,
157
+ backgroundColor: 0x111111,
158
+ points: 10.00,
159
+ maxDistance: 22.00,
160
+ spacing: 17.00
161
+ });
162
+
163
+ // Initialize charts
164
+ const ctx = document.getElementById('trafficChart').getContext('2d');
165
+ const trafficChart = new Chart(ctx, {
166
+ type: 'line',
167
+ data: {
168
+ labels: Array.from({length: 30}, (_, i) => i + 1),
169
+ datasets: [
170
+ {
171
+ label: 'Incoming (KB)',
172
+ data: Array(30).fill(0),
173
+ borderColor: '#00ff00',
174
+ backgroundColor: 'rgba(0, 255, 0, 0.1)',
175
+ tension: 0.4,
176
+ fill: true
177
+ },
178
+ {
179
+ label: 'Outgoing (KB)',
180
+ data: Array(30).fill(0),
181
+ borderColor: '#ff0000',
182
+ backgroundColor: 'rgba(255, 0, 0, 0.1)',
183
+ tension: 0.4,
184
+ fill: true
185
+ }
186
+ ]
187
+ },
188
+ options: {
189
+ responsive: true,
190
+ maintainAspectRatio: false,
191
+ plugins: {
192
+ legend: {
193
+ position: 'top',
194
+ labels: {
195
+ color: '#ffffff'
196
+ }
197
+ }
198
+ },
199
+ scales: {
200
+ x: {
201
+ grid: {
202
+ color: 'rgba(255, 255, 255, 0.1)'
203
+ },
204
+ ticks: {
205
+ color: '#ffffff'
206
+ }
207
+ },
208
+ y: {
209
+ grid: {
210
+ color: 'rgba(255, 255, 255, 0.1)'
211
+ },
212
+ ticks: {
213
+ color: '#ffffff'
214
+ }
215
+ }
216
+ }
217
+ }
218
+ });
219
+
220
+ // Simulate packet data
221
+ let isSniffing = false;
222
+ let packetInterval;
223
+ let packetCounter = 0;
224
+ let tcpCounter = 0;
225
+ let udpCounter = 0;
226
+ const protocols = ['TCP', 'UDP', 'ICMP', 'HTTP', 'HTTPS', 'DNS', 'FTP'];
227
+ const ips = ['192.168.1.', '10.0.0.', '172.16.0.'];
228
+ const ports = [80, 443, 22, 53, 3389, 8080, 21];
229
+
230
+ function generateRandomIP() {
231
+ const prefix = ips[Math.floor(Math.random() * ips.length)];
232
+ return prefix + Math.floor(Math.random() * 254 + 1);
233
+ }
234
+
235
+ function addPacketToLog(packet) {
236
+ const packetLog = document.getElementById('packetLog');
237
+ const packetElement = document.createElement('div');
238
+ packetElement.className = 'packet-row text-sm flex justify-between';
239
+ packetElement.innerHTML = `
240
+ <span class="text-green-400">${new Date().toLocaleTimeString()}</span>
241
+ <span class="text-yellow-300">${packet.source} → ${packet.destination}</span>
242
+ <span class="text-blue-300">${packet.protocol}</span>
243
+ <span class="text-purple-300">${packet.size} bytes</span>
244
+ `;
245
+ packetLog.prepend(packetElement);
246
+
247
+ // Limit log to 100 entries
248
+ if (packetLog.children.length > 100) {
249
+ packetLog.removeChild(packetLog.lastChild);
250
+ }
251
+ }
252
+
253
+ function generateRandomPacket() {
254
+ const protocol = protocols[Math.floor(Math.random() * protocols.length)];
255
+ const size = Math.floor(Math.random() * 1500 + 1);
256
+
257
+ if (protocol === 'TCP') tcpCounter++;
258
+ if (protocol === 'UDP') udpCounter++;
259
+
260
+ packetCounter++;
261
+
262
+ return {
263
+ source: generateRandomIP() + ':' + ports[Math.floor(Math.random() * ports.length)],
264
+ destination: generateRandomIP() + ':' + ports[Math.floor(Math.random() * ports.length)],
265
+ protocol: protocol,
266
+ size: size
267
+ };
268
+ }
269
+
270
+ function updateChart() {
271
+ const data = trafficChart.data.datasets[0].data;
272
+ data.shift();
273
+ data.push(Math.floor(Math.random() * 1000 + 500));
274
+
275
+ const data2 = trafficChart.data.datasets[1].data;
276
+ data2.shift();
277
+ data2.push(Math.floor(Math.random() * 800 + 300));
278
+
279
+ trafficChart.update();
280
+ }
281
+
282
+ function updateStats() {
283
+ document.getElementById('packetCount').textContent = packetCounter;
284
+ document.getElementById('tcpCount').textContent = tcpCounter;
285
+ document.getElementById('udpCount').textContent = udpCounter;
286
+
287
+ const maxPackets = 1000;
288
+ const packetPercentage = Math.min(100, (packetCounter / maxPackets) * 100);
289
+ document.getElementById('packetBar').style.width = packetPercentage + '%';
290
+
291
+ const tcpPercentage = packetCounter > 0 ? (tcpCounter / packetCounter) * 100 : 0;
292
+ document.getElementById('tcpBar').style.width = tcpPercentage + '%';
293
+
294
+ const udpPercentage = packetCounter > 0 ? (udpCounter / packetCounter) * 100 : 0;
295
+ document.getElementById('udpBar').style.width = udpPercentage + '%';
296
+ }
297
+
298
+ // Button event listeners
299
+ document.getElementById('startBtn').addEventListener('click', function() {
300
+ if (!isSniffing) {
301
+ isSniffing = true;
302
+ this.disabled = true;
303
+ document.getElementById('stopBtn').disabled = false;
304
+ document.getElementById('scanBtn').disabled = true;
305
+
306
+ packetInterval = setInterval(function() {
307
+ const packet = generateRandomPacket();
308
+ addPacketToLog(packet);
309
+ updateChart();
310
+ updateStats();
311
+ }, 300);
312
+ }
313
+ });
314
+
315
+ document.getElementById('stopBtn').addEventListener('click', function() {
316
+ if (isSniffing) {
317
+ isSniffing = false;
318
+ document.getElementById('startBtn').disabled = false;
319
+ this.disabled = true;
320
+ document.getElementById('scanBtn').disabled = false;
321
+ clearInterval(packetInterval);
322
+ }
323
+ });
324
+
325
+ document.getElementById('scanBtn').addEventListener('click', function() {
326
+ const ipRange = document.getElementById('ipRange').value || '192.168.1.1-255';
327
+ const ports = document.getElementById('ports').value || '80,443,22';
328
+ const protocol = document.getElementById('protocol').value;
329
+
330
+ const packetLog = document.getElementById('packetLog');
331
+ packetLog.innerHTML = `<div class="text-center py-4 scanning text-yellow-400">Scanning network ${ipRange} for ports ${ports} (${protocol.toUpperCase()})...</div>`;
332
+
333
+ // Simulate scan results after delay
334
+ setTimeout(function() {
335
+ packetLog.innerHTML = '';
336
+
337
+ // Add fake scan results
338
+ const fakeHosts = Math.floor(Math.random() * 10) + 3;
339
+ for (let i = 1; i <= fakeHosts; i++) {
340
+ const ip = ipRange.split('-')[0].slice(0, -1) + i;
341
+ const openPorts = [];
342
+ const portList = ports.split(',');
343
+
344
+ // Randomly select some ports to show as open
345
+ portList.forEach(port => {
346
+ if (Math.random() > 0.7) {
347
+ openPorts.push(port);
348
+ }
349
+ });
350
+
351
+ if (openPorts.length > 0) {
352
+ const scanResult = document.createElement('div');
353
+ scanResult.className = 'packet-row text-sm py-2 border-b border-gray-700';
354
+ scanResult.innerHTML = `
355
+ <div class="flex justify-between">
356
+ <span class="text-green-400">${ip}</span>
357
+ <span class="text-yellow-300">${openPorts.length} open ports</span>
358
+ </div>
359
+ <div class="mt-1 text-xs text-gray-400">Ports: ${openPorts.join(', ')}</div>
360
+ `;
361
+ packetLog.appendChild(scanResult);
362
+ }
363
+ }
364
+
365
+ if (packetLog.children.length === 0) {
366
+ packetLog.innerHTML = `<div class="text-center py-4 text-red-400">No open ports found!</div>`;
367
+ }
368
+ }, 3000);
369
+ });
370
+
371
+ // Initialize feather icons
372
+ feather.replace();
373
+ </script>
374
+ </body>
375
  </html>