Surajkumaar commited on
Commit
1e4df75
Β·
verified Β·
1 Parent(s): 348f64a

Upload 5 files

Browse files
.gitattributes CHANGED
@@ -1 +1,3 @@
1
  cve.csv filter=lfs diff=lfs merge=lfs -text
 
 
 
1
  cve.csv filter=lfs diff=lfs merge=lfs -text
2
+ static/images/0a2bb152-857c-401e-bb73-5db2a519ce4d.png filter=lfs diff=lfs merge=lfs -text
3
+ static/images/ChatGPT[[:space:]]Image[[:space:]]Apr[[:space:]]11,[[:space:]]2025,[[:space:]]12_14_37[[:space:]]PM.png filter=lfs diff=lfs merge=lfs -text
static/background.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Create binary code columns in the background
2
+ document.addEventListener('DOMContentLoaded', function() {
3
+ createBinaryBackground();
4
+ });
5
+
6
+ function createBinaryBackground() {
7
+ const container = document.body;
8
+ const numColumns = 15; // Number of binary columns to create
9
+
10
+ for (let i = 0; i < numColumns; i++) {
11
+ const column = document.createElement('div');
12
+ column.className = 'binary-column';
13
+
14
+ // Random position
15
+ column.style.left = `${Math.random() * 100}%`;
16
+
17
+ // Random animation duration between 10-30s
18
+ const duration = 10 + Math.random() * 20;
19
+ column.style.animation = `binary-flow ${duration}s linear infinite`;
20
+
21
+ // Random delay so they don't all start at once
22
+ column.style.animationDelay = `${Math.random() * 10}s`;
23
+
24
+ // Generate binary content
25
+ column.innerHTML = generateBinaryString();
26
+
27
+ container.appendChild(column);
28
+ }
29
+ }
30
+
31
+ function generateBinaryString() {
32
+ let result = '';
33
+ const length = 50 + Math.floor(Math.random() * 100); // Random length between 50-150 characters
34
+
35
+ for (let i = 0; i < length; i++) {
36
+ // Mostly 0s and 1s, but occasionally add a CVE reference
37
+ if (Math.random() < 0.01) {
38
+ result += '<span style="color: rgba(0, 188, 212, 0.3);">CVE</span><br>';
39
+ } else {
40
+ result += Math.round(Math.random()) + '<br>';
41
+ }
42
+ }
43
+
44
+ return result;
45
+ }
static/images/0a2bb152-857c-401e-bb73-5db2a519ce4d.png ADDED

Git LFS Details

  • SHA256: a0fac79d483412f9eef1c8655bca0a780f51667f61daf471db17afc164ca27ab
  • Pointer size: 132 Bytes
  • Size of remote file: 1.14 MB
static/images/ChatGPT Image Apr 11, 2025, 12_14_37 PM.png ADDED

Git LFS Details

  • SHA256: d1dd073bee7b2fd8753bdf891295d5d896c338b7f97a1b8a0a9f7e5aeeb4958e
  • Pointer size: 132 Bytes
  • Size of remote file: 1.9 MB
static/style.css ADDED
@@ -0,0 +1,310 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ body {
2
+ margin: 0;
3
+ font-family: 'Segoe UI', sans-serif;
4
+ background-color: #0a0e14;
5
+ color: #ffffff;
6
+ background-image:
7
+ linear-gradient(rgba(10, 14, 20, 0.85), rgba(10, 14, 20, 0.85)),
8
+ url('../static/images/ChatGPT Image Apr 11, 2025, 12_14_37 PM.png');
9
+ background-size: cover;
10
+ background-position: center;
11
+ background-attachment: fixed;
12
+ position: relative;
13
+ height: 100vh;
14
+ overflow: hidden;
15
+ }
16
+
17
+ body::before {
18
+ content: '';
19
+ position: fixed;
20
+ top: 0;
21
+ left: 0;
22
+ width: 100%;
23
+ height: 100%;
24
+ background-image:
25
+ radial-gradient(circle at 70% 50%, rgba(0, 188, 212, 0.05) 0%, transparent 70%),
26
+ linear-gradient(0deg, transparent 90%, rgba(0, 188, 212, 0.05) 100%),
27
+ linear-gradient(90deg, transparent 90%, rgba(0, 188, 212, 0.05) 100%);
28
+ pointer-events: none;
29
+ z-index: -1;
30
+ }
31
+
32
+ body::after {
33
+ content: '';
34
+ position: fixed;
35
+ top: 0;
36
+ left: 0;
37
+ width: 100%;
38
+ height: 100%;
39
+ background-image:
40
+ repeating-linear-gradient(0deg, rgba(0, 188, 212, 0.03) 0, rgba(0, 188, 212, 0.03) 1px, transparent 1px, transparent 30px),
41
+ repeating-linear-gradient(90deg, rgba(0, 188, 212, 0.03) 0, rgba(0, 188, 212, 0.03) 1px, transparent 1px, transparent 30px);
42
+ pointer-events: none;
43
+ z-index: -1;
44
+ }
45
+
46
+ .chat-container {
47
+ max-width: 700px;
48
+ margin: 0 auto;
49
+ height: 100vh;
50
+ display: flex;
51
+ flex-direction: column;
52
+ backdrop-filter: blur(5px);
53
+ background-color: rgba(14, 22, 33, 0.7);
54
+ box-shadow: 0 0 20px rgba(0, 188, 212, 0.1);
55
+ border-left: 1px solid rgba(0, 188, 212, 0.1);
56
+ border-right: 1px solid rgba(0, 188, 212, 0.1);
57
+ }
58
+
59
+ header {
60
+ background-color: rgba(30, 42, 56, 0.8);
61
+ padding: 20px;
62
+ text-align: center;
63
+ font-size: 24px;
64
+ border-bottom: 1px solid #2a3b4d;
65
+ position: relative;
66
+ text-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
67
+ font-weight: bold;
68
+ letter-spacing: 2px;
69
+ flex-shrink: 0; /* Prevent header from shrinking */
70
+ }
71
+
72
+ header::before {
73
+ content: 'πŸ”’';
74
+ margin-right: 10px;
75
+ font-size: 20px;
76
+ }
77
+
78
+ .chat-box {
79
+ flex: 1;
80
+ padding: 20px;
81
+ overflow-y: auto;
82
+ display: flex;
83
+ flex-direction: column;
84
+ gap: 15px;
85
+ scrollbar-width: thin;
86
+ scrollbar-color: #00bcd4 #1e2a38;
87
+ scroll-behavior: smooth;
88
+ /* Ensure all messages are preserved */
89
+ min-height: 0;
90
+ }
91
+
92
+ /* Customize scrollbar for WebKit browsers */
93
+ .chat-box::-webkit-scrollbar {
94
+ width: 8px;
95
+ }
96
+
97
+ .chat-box::-webkit-scrollbar-track {
98
+ background: #1e2a38;
99
+ }
100
+
101
+ .chat-box::-webkit-scrollbar-thumb {
102
+ background-color: #00bcd4;
103
+ border-radius: 10px;
104
+ }
105
+
106
+ .bot-message, .user-message {
107
+ display: flex;
108
+ flex-direction: column;
109
+ max-width: 80%;
110
+ }
111
+
112
+ .bot-message .bubble {
113
+ background-color: rgba(42, 59, 77, 0.9);
114
+ align-self: flex-start;
115
+ border-left: 3px solid #00bcd4;
116
+ }
117
+
118
+ .user-message .bubble {
119
+ background-color: rgba(0, 188, 212, 0.8);
120
+ align-self: flex-end;
121
+ color: #000;
122
+ border-right: 3px solid #0097a7;
123
+ }
124
+
125
+ .bubble {
126
+ padding: 12px 16px;
127
+ border-radius: 10px;
128
+ font-size: 16px;
129
+ position: relative;
130
+ white-space: pre-wrap;
131
+ overflow-x: hidden; /* Prevent horizontal scroll */
132
+ word-wrap: break-word; /* Break long words */
133
+ max-width: 100%; /* Ensure it doesn't stretch */
134
+ box-sizing: border-box; /* Include padding in width */
135
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
136
+ }
137
+
138
+ .time {
139
+ font-size: 12px;
140
+ color: #aaa;
141
+ margin-top: 4px;
142
+ align-self: flex-end;
143
+ }
144
+
145
+ .input-area {
146
+ display: flex;
147
+ padding: 10px;
148
+ background-color: rgba(30, 42, 56, 0.9);
149
+ border-top: 1px solid #2a3b4d;
150
+ flex-shrink: 0; /* Prevent input area from shrinking */
151
+ }
152
+
153
+ .input-area input {
154
+ flex: 1;
155
+ padding: 12px;
156
+ font-size: 16px;
157
+ border: none;
158
+ border-radius: 5px 0 0 5px;
159
+ outline: none;
160
+ background-color: rgba(255, 255, 255, 0.1);
161
+ color: #fff;
162
+ }
163
+
164
+ .input-area input::placeholder {
165
+ color: rgba(255, 255, 255, 0.5);
166
+ }
167
+
168
+ .input-area button {
169
+ padding: 12px 20px;
170
+ font-size: 16px;
171
+ background-color: #00bcd4;
172
+ border: none;
173
+ border-radius: 0 5px 5px 0;
174
+ color: #fff;
175
+ cursor: pointer;
176
+ transition: background-color 0.3s;
177
+ }
178
+
179
+ .input-area button:hover {
180
+ background-color: #0097a7;
181
+ }
182
+
183
+ /* Markdown formatting */
184
+ .answer-content h1,
185
+ .answer-content h2,
186
+ .answer-content strong {
187
+ font-weight: bold;
188
+ color: #00bcd4;
189
+ }
190
+
191
+ .answer-content ul, .answer-content ol {
192
+ padding-left: 20px;
193
+ margin: 10px 0;
194
+ }
195
+
196
+ .answer-content li {
197
+ margin-bottom: 6px;
198
+ }
199
+
200
+ .answer-content {
201
+ overflow-x: auto;
202
+ max-width: 100%;
203
+ word-wrap: break-word;
204
+ }
205
+
206
+ /* Copy button */
207
+ .copy-btn {
208
+ position: absolute;
209
+ top: 8px;
210
+ right: 8px;
211
+ background: none;
212
+ border: none;
213
+ font-size: 18px;
214
+ cursor: pointer;
215
+ color: #bbb;
216
+ transition: color 0.2s ease;
217
+ }
218
+
219
+ .copy-btn:hover {
220
+ color: #fff;
221
+ }
222
+
223
+ /* Typing dots animation */
224
+ .typing-indicator {
225
+ display: flex;
226
+ flex-direction: column;
227
+ max-width: 80%;
228
+ align-self: flex-start;
229
+ margin-bottom: 10px;
230
+ }
231
+
232
+ .typing-indicator .bubble {
233
+ background-color: rgba(42, 59, 77, 0.9);
234
+ padding: 12px 16px;
235
+ border-radius: 10px;
236
+ font-size: 20px;
237
+ color: #ccc;
238
+ font-weight: bold;
239
+ border-left: 3px solid #00bcd4;
240
+ }
241
+
242
+ .dots {
243
+ display: flex;
244
+ gap: 4px;
245
+ }
246
+
247
+ .dots span {
248
+ animation: bounce 1.2s infinite;
249
+ font-size: 22px;
250
+ opacity: 0.5;
251
+ }
252
+
253
+ .dots span:nth-child(1) { animation-delay: 0s; }
254
+ .dots span:nth-child(2) { animation-delay: 0.2s; }
255
+ .dots span:nth-child(3) { animation-delay: 0.4s; }
256
+
257
+ @keyframes bounce {
258
+ 0%, 80%, 100% { transform: translateY(0); }
259
+ 40% { transform: translateY(-6px); }
260
+ }
261
+
262
+ /* Binary code animation in background */
263
+ @keyframes binary-flow {
264
+ 0% { opacity: 0; transform: translateY(-100%); }
265
+ 10% { opacity: 0.3; }
266
+ 90% { opacity: 0.3; }
267
+ 100% { opacity: 0; transform: translateY(100%); }
268
+ }
269
+
270
+ .binary-column {
271
+ position: fixed;
272
+ color: rgba(0, 188, 212, 0.15);
273
+ font-family: monospace;
274
+ font-size: 14px;
275
+ line-height: 1;
276
+ white-space: nowrap;
277
+ z-index: -2;
278
+ user-select: none;
279
+ pointer-events: none;
280
+ }
281
+
282
+ /* Clear button */
283
+ .clear-btn {
284
+ position: absolute;
285
+ right: 15px;
286
+ top: 50%;
287
+ transform: translateY(-50%);
288
+ background-color: rgba(0, 188, 212, 0.2);
289
+ color: #fff;
290
+ border: 1px solid rgba(0, 188, 212, 0.5);
291
+ border-radius: 4px;
292
+ padding: 6px 12px;
293
+ font-size: 13px;
294
+ cursor: pointer;
295
+ transition: all 0.3s ease;
296
+ text-decoration: none;
297
+ display: flex;
298
+ align-items: center;
299
+ gap: 5px;
300
+ }
301
+
302
+ .clear-btn::before {
303
+ content: '\1F5D1';
304
+ font-size: 14px;
305
+ }
306
+
307
+ .clear-btn:hover {
308
+ background-color: rgba(0, 188, 212, 0.4);
309
+ box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
310
+ }
templates/index.html ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>CVElytics - Cybersecurity Vulnerability Assistant</title>
6
+ <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
7
+ <script src="{{ url_for('static', filename='background.js') }}"></script>
8
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
9
+ </head>
10
+ <body>
11
+ <div class="chat-container">
12
+ <header>
13
+ CVElytics <span style="font-size: 14px; opacity: 0.7;">Vulnerability Intelligence</span>
14
+ <a href="/clear" class="clear-btn">Clear</a>
15
+ </header>
16
+
17
+ <div class="chat-box" id="chat-box">
18
+ {% for msg in chat_history %}
19
+ {% if msg.role == 'user' %}
20
+ <div class="user-message">
21
+ <div class="bubble user">{{ msg.text }}</div>
22
+ <span class="time">Now</span>
23
+ </div>
24
+ {% else %}
25
+ <div class="bot-message">
26
+ <div class="bubble bot">
27
+ <div class="answer-content">{{ msg.text|safe }}</div>
28
+ <button class="copy-btn" onclick="copyToClipboard(this)">πŸ“‹</button>
29
+ </div>
30
+ <span class="time">Now</span>
31
+ </div>
32
+ {% endif %}
33
+ {% endfor %}
34
+
35
+ <!-- Typing animation inside the chat flow -->
36
+ <div class="bot-message typing-indicator" id="typing" style="display: none;">
37
+ <div class="bubble bot">
38
+ <div class="dots">
39
+ <span>.</span><span>.</span><span>.</span>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+
45
+ <form method="POST" class="input-area" onsubmit="showTyping()">
46
+ <input type="text" name="question" placeholder="Ask about cybersecurity vulnerabilities..." required>
47
+ <button type="submit">Send</button>
48
+ </form>
49
+ </div>
50
+
51
+ <script>
52
+ // Scroll to bottom of chat on page load
53
+ document.addEventListener('DOMContentLoaded', function() {
54
+ scrollToBottom();
55
+ });
56
+
57
+ function copyToClipboard(btn) {
58
+ const content = btn.previousElementSibling.innerText;
59
+ navigator.clipboard.writeText(content).then(() => {
60
+ btn.innerText = 'βœ…';
61
+ setTimeout(() => { btn.innerText = 'πŸ“‹'; }, 2000);
62
+ });
63
+ }
64
+
65
+ function showTyping() {
66
+ const typingIndicator = document.getElementById("typing");
67
+ typingIndicator.style.display = "flex";
68
+ scrollToBottom();
69
+ }
70
+
71
+ function scrollToBottom() {
72
+ const chatBox = document.getElementById("chat-box");
73
+ chatBox.scrollTop = chatBox.scrollHeight;
74
+ }
75
+ </script>
76
+ </body>
77
+ </html>