S-Dreamer commited on
Commit
4817f27
·
verified ·
1 Parent(s): 6b24b4e

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +390 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Ai Code Classifier
3
- emoji: 📚
4
- colorFrom: indigo
5
- colorTo: yellow
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: ai-code-classifier
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,390 @@
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>AI Code Classifier | Cybersecurity & Software Engineering</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
9
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
10
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/github-dark.min.css">
11
+ <style>
12
+ body {
13
+ font-family: 'Inter', sans-serif;
14
+ background-color: #22272E;
15
+ color: #ADBAC7;
16
+ }
17
+ .code-font {
18
+ font-family: 'JetBrains Mono', monospace;
19
+ }
20
+ .primary-bg {
21
+ background-color: #2D333B;
22
+ }
23
+ .secondary-color {
24
+ color: #539BF5;
25
+ }
26
+ .secondary-bg {
27
+ background-color: #539BF5;
28
+ }
29
+ .accent-bg {
30
+ background-color: #347D39;
31
+ }
32
+ .syntax-highlight {
33
+ background-color: #2b313a;
34
+ border-radius: 6px;
35
+ }
36
+ .sidebar {
37
+ transition: all 0.3s ease;
38
+ }
39
+ .sidebar-collapsed {
40
+ transform: translateX(-100%);
41
+ }
42
+ .tab-active {
43
+ border-bottom: 2px solid #539BF5;
44
+ color: #539BF5;
45
+ }
46
+ .confidence-bar {
47
+ background: linear-gradient(90deg, #347D39 0%, #539BF5 100%);
48
+ }
49
+ </style>
50
+ </head>
51
+ <body class="min-h-screen flex flex-col">
52
+ <!-- Header -->
53
+ <header class="primary-bg border-b border-gray-700 py-4 px-6 flex items-center justify-between">
54
+ <div class="flex items-center space-x-4">
55
+ <button id="sidebarToggle" class="text-gray-400 hover:text-white">
56
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
57
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
58
+ </svg>
59
+ </button>
60
+ <h1 class="text-xl font-semibold secondary-color">AI Code Classifier</h1>
61
+ </div>
62
+ <div class="flex items-center space-x-4">
63
+ <button class="px-4 py-2 rounded-md bg-blue-900/30 text-blue-400 hover:bg-blue-900/50 flex items-center space-x-2">
64
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
65
+ <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
66
+ </svg>
67
+ <span>Documentation</span>
68
+ </button>
69
+ <div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center">
70
+ <span class="text-sm font-medium">AI</span>
71
+ </div>
72
+ </div>
73
+ </header>
74
+
75
+ <div class="flex flex-1 overflow-hidden">
76
+ <!-- Sidebar -->
77
+ <aside id="sidebar" class="primary-bg border-r border-gray-700 w-64 flex-shrink-0 flex flex-col sidebar">
78
+ <div class="p-4 border-b border-gray-700">
79
+ <h2 class="text-lg font-medium">Navigation</h2>
80
+ </div>
81
+ <nav class="flex-1 overflow-y-auto p-4 space-y-2">
82
+ <a href="#" class="flex items-center space-x-3 p-2 rounded-md bg-blue-900/30 text-blue-400">
83
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
84
+ <path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z" />
85
+ </svg>
86
+ <span>Dashboard</span>
87
+ </a>
88
+ <a href="#" class="flex items-center space-x-3 p-2 rounded-md hover:bg-gray-700/50 text-gray-400 hover:text-gray-200">
89
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
90
+ <path fill-rule="evenodd" d="M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z" clip-rule="evenodd" />
91
+ </svg>
92
+ <span>Code Analysis</span>
93
+ </a>
94
+ <a href="#" class="flex items-center space-x-3 p-2 rounded-md hover:bg-gray-700/50 text-gray-400 hover:text-gray-200">
95
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
96
+ <path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
97
+ </svg>
98
+ <span>Security Findings</span>
99
+ </a>
100
+ <a href="#" class="flex items-center space-x-3 p-2 rounded-md hover:bg-gray-700/50 text-gray-400 hover:text-gray-200">
101
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
102
+ <path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd" />
103
+ </svg>
104
+ <span>History</span>
105
+ </a>
106
+ <a href="#" class="flex items-center space-x-3 p-2 rounded-md hover:bg-gray-700/50 text-gray-400 hover:text-gray-200">
107
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
108
+ <path fill-rule="evenodd" d="M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01-.947-2.287c.379-1.561-.734-2.942-2.106-2.106a1.533 1.533 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z" clip-rule="evenodd" />
109
+ </svg>
110
+ <span>Settings</span>
111
+ </a>
112
+ </nav>
113
+ <div class="p-4 border-t border-gray-700">
114
+ <div class="flex items-center space-x-3">
115
+ <div class="w-10 h-10 rounded-full bg-gray-600 flex items-center justify-center">
116
+ <span class="text-sm font-medium">U</span>
117
+ </div>
118
+ <div>
119
+ <p class="text-sm font-medium">User Account</p>
120
+ <p class="text-xs text-gray-400">[email protected]</p>
121
+ </div>
122
+ </div>
123
+ </div>
124
+ </aside>
125
+
126
+ <!-- Main Content -->
127
+ <main class="flex-1 flex flex-col overflow-hidden">
128
+ <div class="border-b border-gray-700">
129
+ <div class="flex space-x-6 px-6">
130
+ <button class="py-3 px-1 font-medium tab-active">Code Analysis</button>
131
+ <button class="py-3 px-1 font-medium text-gray-400 hover:text-gray-200">Batch Processing</button>
132
+ <button class="py-3 px-1 font-medium text-gray-400 hover:text-gray-200">Model Settings</button>
133
+ </div>
134
+ </div>
135
+
136
+ <div class="flex-1 overflow-auto p-6">
137
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
138
+ <!-- Code Input Section -->
139
+ <div class="primary-bg rounded-lg overflow-hidden border border-gray-700">
140
+ <div class="p-4 border-b border-gray-700 flex justify-between items-center">
141
+ <h3 class="font-medium">Input Code</h3>
142
+ <div class="flex space-x-2">
143
+ <select class="bg-gray-700 text-gray-300 text-sm rounded px-3 py-1">
144
+ <option>JavaScript</option>
145
+ <option>Python</option>
146
+ <option>PHP</option>
147
+ <option>Java</option>
148
+ <option>C++</option>
149
+ <option>Bash</option>
150
+ <option>SQL</option>
151
+ </select>
152
+ <button class="bg-gray-700 text-gray-300 text-sm rounded px-3 py-1 hover:bg-gray-600">
153
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor">
154
+ <path fill-rule="evenodd" d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z" clip-rule="evenodd" />
155
+ </svg>
156
+ </button>
157
+ </div>
158
+ </div>
159
+ <div class="p-4">
160
+ <div id="codeEditor" class="syntax-highlight code-font p-4 rounded min-h-[300px] max-h-[500px] overflow-auto" contenteditable="true">// Enter your code here for analysis
161
+ // Example JavaScript code:
162
+ function processData(input) {
163
+ // Potential XSS vulnerability
164
+ document.getElementById('output').innerHTML = input;
165
+
166
+ // SQL injection risk
167
+ const query = `SELECT * FROM users WHERE username = '${input}'`;
168
+
169
+ // Shell command injection
170
+ const result = execSync(`ls ${input}`);
171
+
172
+ return result;
173
+ }</div>
174
+ </div>
175
+ <div class="p-4 border-t border-gray-700 flex justify-between">
176
+ <div class="flex space-x-2">
177
+ <button class="px-3 py-1 text-sm rounded bg-gray-700 hover:bg-gray-600 text-gray-300">
178
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline mr-1" viewBox="0 0 20 20" fill="currentColor">
179
+ <path fill-rule="evenodd" d="M4 4a2 2 0 012-2h4.586A2 2 0 0112 2.586L15.414 6A2 2 0 0116 7.414V16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zm2 6a1 1 0 011-1h6a1 1 0 110 2H7a1 1 0 01-1-1zm1 3a1 1 0 100 2h6a1 1 0 100-2H7z" clip-rule="evenodd" />
180
+ </svg>
181
+ Load Sample
182
+ </button>
183
+ <button class="px-3 py-1 text-sm rounded bg-gray-700 hover:bg-gray-600 text-gray-300">
184
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline mr-1" viewBox="0 0 20 20" fill="currentColor">
185
+ <path fill-rule="evenodd" d="M3 17a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zm3.293-7.707a1 1 0 011.414 0L9 10.586V3a1 1 0 112 0v7.586l1.293-1.293a1 1 0 111.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z" clip-rule="evenodd" />
186
+ </svg>
187
+ Upload File
188
+ </button>
189
+ </div>
190
+ <button id="analyzeBtn" class="px-4 py-2 rounded-md secondary-bg text-white hover:bg-blue-600 flex items-center">
191
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" viewBox="0 0 20 20" fill="currentColor">
192
+ <path fill-rule="evenodd" d="M9.243 3.03a1 1 0 01.727 1.213L9.53 6h2.94l.56-2.243a1 1 0 111.94.486L14.53 6H17a1 1 0 110 2h-2.97l-1 4H15a1 1 0 110 2h-2.47l-.56 2.242a1 1 0 11-1.94-.485L10.47 14H7.53l-.56 2.242a1 1 0 11-1.94-.485L5.47 14H3a1 1 0 110-2h2.97l1-4H5a1 1 0 110-2h2.47l.56-2.243a1 1 0 011.213-.727zM9.03 8l-1 4h2.938l1-4H9.031z" clip-rule="evenodd" />
193
+ </svg>
194
+ Analyze Code
195
+ </button>
196
+ </div>
197
+ </div>
198
+
199
+ <!-- Results Section -->
200
+ <div class="primary-bg rounded-lg overflow-hidden border border-gray-700">
201
+ <div class="p-4 border-b border-gray-700">
202
+ <h3 class="font-medium">Analysis Results</h3>
203
+ </div>
204
+ <div class="p-4">
205
+ <div id="resultsContainer" class="min-h-[300px] max-h-[500px] overflow-auto">
206
+ <div class="text-center py-12 text-gray-500">
207
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto text-gray-600" fill="none" viewBox="0 0 24 24" stroke="currentColor">
208
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1" d="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" />
209
+ </svg>
210
+ <p class="mt-4">Submit code for analysis to see results</p>
211
+ </div>
212
+ </div>
213
+ </div>
214
+ </div>
215
+ </div>
216
+
217
+ <!-- Model Information -->
218
+ <div class="primary-bg rounded-lg overflow-hidden border border-gray-700 mt-6">
219
+ <div class="p-4 border-b border-gray-700">
220
+ <h3 class="font-medium">AI Model Information</h3>
221
+ </div>
222
+ <div class="p-4 grid grid-cols-1 md:grid-cols-3 gap-4">
223
+ <div class="border border-gray-700 rounded-lg p-4">
224
+ <div class="flex items-center space-x-3 mb-3">
225
+ <div class="w-10 h-10 rounded-full bg-blue-900/30 flex items-center justify-center">
226
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-blue-400" viewBox="0 0 20 20" fill="currentColor">
227
+ <path fill-rule="evenodd" d="M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z" clip-rule="evenodd" />
228
+ </svg>
229
+ </div>
230
+ <h4 class="font-medium">replit-code-v1_5-3b</h4>
231
+ </div>
232
+ <p class="text-sm text-gray-400">Specialized for code understanding and generation with 3 billion parameters.</p>
233
+ <div class="mt-3">
234
+ <span class="text-xs px-2 py-1 rounded bg-blue-900/30 text-blue-400">Code Analysis</span>
235
+ <span class="text-xs px-2 py-1 rounded bg-blue-900/30 text-blue-400">Syntax</span>
236
+ </div>
237
+ </div>
238
+ <div class="border border-gray-700 rounded-lg p-4">
239
+ <div class="flex items-center space-x-3 mb-3">
240
+ <div class="w-10 h-10 rounded-full bg-green-900/30 flex items-center justify-center">
241
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-400" viewBox="0 0 20 20" fill="currentColor">
242
+ <path fill-rule="evenodd" d="M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z" clip-rule="evenodd" />
243
+ </svg>
244
+ </div>
245
+ <h4 class="font-medium">Llama-3.1-WhiteRabbitNeo-2-8B</h4>
246
+ </div>
247
+ <p class="text-sm text-gray-400">8 billion parameter model fine-tuned for cybersecurity and vulnerability detection.</p>
248
+ <div class="mt-3">
249
+ <span class="text-xs px-2 py-1 rounded bg-green-900/30 text-green-400">Security</span>
250
+ <span class="text-xs px-2 py-1 rounded bg-green-900/30 text-green-400">Vulnerabilities</span>
251
+ </div>
252
+ </div>
253
+ <div class="border border-gray-700 rounded-lg p-4">
254
+ <div class="flex items-center space-x-3 mb-3">
255
+ <div class="w-10 h-10 rounded-full bg-purple-900/30 flex items-center justify-center">
256
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-purple-400" viewBox="0 0 20 20" fill="currentColor">
257
+ <path d="M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" />
258
+ </svg>
259
+ </div>
260
+ <h4 class="font-medium">Llama-3.1-WhiteRabbitNeo-2-70B</h4>
261
+ </div>
262
+ <p class="text-sm text-gray-400">70 billion parameter model for comprehensive code analysis and classification.</p>
263
+ <div class="mt-3">
264
+ <span class="text-xs px-2 py-1 rounded bg-purple-900/30 text-purple-400">Classification</span>
265
+ <span class="text-xs px-2 py-1 rounded bg-purple-900/30 text-purple-400">Deep Analysis</span>
266
+ </div>
267
+ </div>
268
+ </div>
269
+ <div class="p-4 border-t border-gray-700 text-sm text-gray-400">
270
+ <p>Models trained on specialized datasets including Canstralian/Wordlists, Canstralian/CyberExploitDB, Canstralian/pentesting_dataset, and Canstralian/ShellCommands (MIT License).</p>
271
+ </div>
272
+ </div>
273
+ </div>
274
+ </main>
275
+ </div>
276
+
277
+ <script>
278
+ // Initialize syntax highlighting
279
+ document.addEventListener('DOMContentLoaded', (event) => {
280
+ // Toggle sidebar
281
+ const sidebarToggle = document.getElementById('sidebarToggle');
282
+ const sidebar = document.getElementById('sidebar');
283
+
284
+ sidebarToggle.addEventListener('click', () => {
285
+ sidebar.classList.toggle('sidebar-collapsed');
286
+ });
287
+
288
+ // Code analysis button
289
+ const analyzeBtn = document.getElementById('analyzeBtn');
290
+ const resultsContainer = document.getElementById('resultsContainer');
291
+
292
+ analyzeBtn.addEventListener('click', () => {
293
+ // Simulate analysis
294
+ resultsContainer.innerHTML = `
295
+ <div class="space-y-4">
296
+ <div class="border-b border-gray-700 pb-4">
297
+ <h4 class="font-medium text-lg mb-3">Classification Results</h4>
298
+ <div class="space-y-3">
299
+ <div>
300
+ <div class="flex justify-between text-sm mb-1">
301
+ <span>Security Vulnerability</span>
302
+ <span>87%</span>
303
+ </div>
304
+ <div class="w-full bg-gray-700 rounded-full h-2">
305
+ <div class="confidence-bar h-2 rounded-full" style="width: 87%"></div>
306
+ </div>
307
+ </div>
308
+ <div>
309
+ <div class="flex justify-between text-sm mb-1">
310
+ <span>Code Quality Issue</span>
311
+ <span>65%</span>
312
+ </div>
313
+ <div class="w-full bg-gray-700 rounded-full h-2">
314
+ <div class="confidence-bar h-2 rounded-full" style="width: 65%"></div>
315
+ </div>
316
+ </div>
317
+ <div>
318
+ <div class="flex justify-between text-sm mb-1">
319
+ <span>Potential Bug</span>
320
+ <span>72%</span>
321
+ </div>
322
+ <div class="w-full bg-gray-700 rounded-full h-2">
323
+ <div class="confidence-bar h-2 rounded-full" style="width: 72%"></div>
324
+ </div>
325
+ </div>
326
+ </div>
327
+ </div>
328
+
329
+ <div class="border-b border-gray-700 pb-4">
330
+ <h4 class="font-medium text-lg mb-3">Detailed Findings</h4>
331
+ <div class="space-y-4">
332
+ <div class="p-3 rounded-md bg-red-900/20 border border-red-900/50">
333
+ <div class="flex justify-between items-start">
334
+ <div>
335
+ <span class="font-medium text-red-400">High Severity</span>
336
+ <p class="text-sm mt-1">Potential XSS vulnerability detected in line 4: Unsanitized input being written directly to DOM.</p>
337
+ </div>
338
+ <span class="text-xs px-2 py-1 rounded bg-red-900/30 text-red-400">CWE-79</span>
339
+ </div>
340
+ </div>
341
+ <div class="p-3 rounded-md bg-yellow-900/20 border border-yellow-900/50">
342
+ <div class="flex justify-between items-start">
343
+ <div>
344
+ <span class="font-medium text-yellow-400">Medium Severity</span>
345
+ <p class="text-sm mt-1">SQL injection risk detected in line 7: User input concatenated directly into SQL query.</p>
346
+ </div>
347
+ <span class="text-xs px-2 py-1 rounded bg-yellow-900/30 text-yellow-400">CWE-89</span>
348
+ </div>
349
+ </div>
350
+ <div class="p-3 rounded-md bg-orange-900/20 border border-orange-900/50">
351
+ <div class="flex justify-between items-start">
352
+ <div>
353
+ <span class="font-medium text-orange-400">Medium Severity</span>
354
+ <p class="text-sm mt-1">Shell command injection detected in line 10: Unsanitized user input used in command execution.</p>
355
+ </div>
356
+ <span class="text-xs px-2 py-1 rounded bg-orange-900/30 text-orange-400">CWE-78</span>
357
+ </div>
358
+ </div>
359
+ </div>
360
+ </div>
361
+
362
+ <div>
363
+ <h4 class="font-medium text-lg mb-3">Recommendations</h4>
364
+ <ul class="list-disc list-inside text-sm space-y-2 pl-2">
365
+ <li>Use DOM text methods (textContent) instead of innerHTML when displaying user input</li>
366
+ <li>Implement parameterized queries or use an ORM to prevent SQL injection</li>
367
+ <li>Sanitize all user input before using in shell commands</li>
368
+ <li>Consider implementing input validation for all external inputs</li>
369
+ </ul>
370
+ </div>
371
+ </div>
372
+ `;
373
+ });
374
+
375
+ // Apply syntax highlighting to code editor
376
+ const codeEditor = document.getElementById('codeEditor');
377
+
378
+ codeEditor.addEventListener('input', () => {
379
+ // In a real implementation, we would use highlight.js here
380
+ // For this demo, we'll just simulate it
381
+ setTimeout(() => {
382
+ const code = codeEditor.innerText;
383
+ // This is where we would actually apply syntax highlighting
384
+ // For now, we'll just keep it simple
385
+ }, 100);
386
+ });
387
+ });
388
+ </script>
389
+ <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=S-Dreamer/ai-code-classifier" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
390
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ A web-based code classification system leveraging AI models (specifically fine-tuned Transformer models based on replit/replit-code-v1_5-3b, WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-8B, and WhiteRabbitNeo/Llama-3.1-WhiteRabbitNeo-2-70B) to analyze and categorize code snippets for cybersecurity and software engineering purposes. The system is trained on specialized datasets including Canstralian/Wordlists, Canstralian/CyberExploitDB, Canstralian/pentesting_dataset, and Canstralian/ShellCommands, under MIT license. Core Features: - Code submission interface with syntax highlighting - AI-powered analysis and classification of submitted code - Results display showing classification categories and confidence scores - Historical record of analyzed code snippets Visual References: Inspired by GitHub Copilot and OpenAI Playground interfaces, combining professional code presentation with intuitive analysis tools. Style Guide: - Colors: Primary #2D333B (dark navy), Secondary #539BF5 (bright blue), Background #22272E (deep grey), Text #ADBAC7 (light grey), Accent #347D39 (success green) - Design: JetBrains Mono/Inter fonts, dark theme optimized for code display, syntax highlighting support, 16px padding, responsive layout with collapsible panels