Add this script to the ai so the ai can run offline and generate and create anything asked <!DOCTYPE html>
Browse files<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Offline AI Generator</title>
</head>
<body style="background:#111;color:#eee;font-family:sans-serif;padding:15px;">
<h1>Offline AI Generator</h1>
<textarea id="input" placeholder="Ask me anything..."
style="width:100%;height:120px;background:#222;color:#fff;padding:10px;border-radius:8px;"></textarea>
<button id="gen"
style="width:100%;padding:12px;margin-top:10px;background:#4e79ff;color:#fff;border:none;border-radius:8px;font-size:16px;">
Generate
</button>
<h2>Response:</h2>
<pre id="response" style="white-space:pre-wrap;background:#222;padding:10px;border-radius:8px;"></pre>
<script type="module">
import { pipeline } from "https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/transformers.min.js";
let generator;
async function loadModel() {
document.getElementById("response").innerText = "Loading model… (first time only)";
generator = await pipeline("text-generation", "Xenova/gpt2");
document.getElementById("response").innerText = "Model ready! Ask me anything.";
}
loadModel();
document.getElementById("gen").onclick = async () => {
const prompt = document.getElementById("input").value;
if (!prompt) return;
document.getElementById("response").innerText = "Thinking…";
const output = await generator(prompt, {
max_new_tokens: 200,
temperature: 0.9,
top_p: 0.95
});
document.getElementById("response").innerText = output[0].generated_text;
};
</script>
</body>
</html>
- chatbot.html +165 -6
- style.css +10 -0
|
@@ -36,12 +36,18 @@
|
|
| 36 |
</button>
|
| 37 |
</div>
|
| 38 |
</div>
|
| 39 |
-
|
| 40 |
<div class="bg-gray-800 rounded-lg p-6 shadow-lg border border-red-500">
|
| 41 |
-
<div class="flex items-center mb-4">
|
| 42 |
-
<
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
</div>
|
|
|
|
| 45 |
<div id="chatContainer" class="h-96 overflow-y-auto mb-4 p-4 bg-gray-900 rounded-lg">
|
| 46 |
<div class="text-green-400 mb-2">Mr.V AI: Welcome to DarkFlux CyberForge. What would you like to create today?</div>
|
| 47 |
</div>
|
|
@@ -60,14 +66,36 @@
|
|
| 60 |
</div>
|
| 61 |
<pre id="scriptContent" class="bg-gray-900 p-3 rounded text-sm overflow-x-auto text-green-400 font-mono"></pre>
|
| 62 |
</div>
|
| 63 |
-
|
|
|
|
| 64 |
<textarea id="userInput" class="flex-1 bg-gray-700 text-white px-4 py-2 rounded-md" placeholder="Describe your cyber tool..."></textarea>
|
| 65 |
<button id="sendBtn" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md">
|
| 66 |
<i data-feather="send"></i>
|
| 67 |
</button>
|
| 68 |
</div>
|
| 69 |
</div>
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
</div>
|
| 72 |
|
| 73 |
<script src="components/footer.js"></script>
|
|
@@ -262,6 +290,137 @@ main();
|
|
| 262 |
});
|
| 263 |
});
|
| 264 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
<script src="script.js"></script>
|
| 266 |
</body>
|
| 267 |
</html>
|
|
|
|
| 36 |
</button>
|
| 37 |
</div>
|
| 38 |
</div>
|
|
|
|
| 39 |
<div class="bg-gray-800 rounded-lg p-6 shadow-lg border border-red-500">
|
| 40 |
+
<div class="flex items-center justify-between mb-4">
|
| 41 |
+
<div class="flex items-center">
|
| 42 |
+
<i data-feather="message-square" class="text-red-500 mr-2"></i>
|
| 43 |
+
<h2 class="text-xl font-bold">CyberForge Terminal</h2>
|
| 44 |
+
</div>
|
| 45 |
+
<button id="toggleMode" class="text-xs bg-gray-700 hover:bg-gray-600 px-3 py-1 rounded flex items-center">
|
| 46 |
+
<i data-feather="cpu" class="w-3 h-3 mr-1"></i>
|
| 47 |
+
<span id="modeLabel">Offline Mode</span>
|
| 48 |
+
</button>
|
| 49 |
</div>
|
| 50 |
+
|
| 51 |
<div id="chatContainer" class="h-96 overflow-y-auto mb-4 p-4 bg-gray-900 rounded-lg">
|
| 52 |
<div class="text-green-400 mb-2">Mr.V AI: Welcome to DarkFlux CyberForge. What would you like to create today?</div>
|
| 53 |
</div>
|
|
|
|
| 66 |
</div>
|
| 67 |
<pre id="scriptContent" class="bg-gray-900 p-3 rounded text-sm overflow-x-auto text-green-400 font-mono"></pre>
|
| 68 |
</div>
|
| 69 |
+
|
| 70 |
+
<div class="flex gap-2">
|
| 71 |
<textarea id="userInput" class="flex-1 bg-gray-700 text-white px-4 py-2 rounded-md" placeholder="Describe your cyber tool..."></textarea>
|
| 72 |
<button id="sendBtn" class="bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded-md">
|
| 73 |
<i data-feather="send"></i>
|
| 74 |
</button>
|
| 75 |
</div>
|
| 76 |
</div>
|
| 77 |
+
|
| 78 |
+
<!-- Offline AI Modal -->
|
| 79 |
+
<div id="offlineModal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center hidden z-50">
|
| 80 |
+
<div class="bg-gray-800 rounded-lg p-6 max-w-2xl w-full mx-4 border border-red-500">
|
| 81 |
+
<div class="flex justify-between items-center mb-4">
|
| 82 |
+
<h2 class="text-xl font-bold">Offline AI Generator</h2>
|
| 83 |
+
<button id="closeModal" class="text-gray-400 hover:text-white">
|
| 84 |
+
<i data-feather="x"></i>
|
| 85 |
+
</button>
|
| 86 |
+
</div>
|
| 87 |
+
<textarea id="offlineInput" class="w-full bg-gray-700 text-white px-4 py-3 rounded-md mb-4"
|
| 88 |
+
placeholder="Ask the offline AI anything..." rows="5"></textarea>
|
| 89 |
+
<button id="generateBtn" class="w-full bg-red-600 hover:bg-red-700 text-white px-4 py-3 rounded-md">
|
| 90 |
+
Generate
|
| 91 |
+
</button>
|
| 92 |
+
<div class="mt-4">
|
| 93 |
+
<h3 class="text-lg font-semibold mb-2">Response:</h3>
|
| 94 |
+
<pre id="offlineResponse" class="bg-gray-900 p-4 rounded text-white whitespace-pre-wrap"></pre>
|
| 95 |
+
</div>
|
| 96 |
+
</div>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
</div>
|
| 100 |
|
| 101 |
<script src="components/footer.js"></script>
|
|
|
|
| 290 |
});
|
| 291 |
});
|
| 292 |
</script>
|
| 293 |
+
<script type="module">
|
| 294 |
+
import { pipeline } from "https://cdn.jsdelivr.net/npm/@xenova/transformers/dist/transformers.min.js";
|
| 295 |
+
|
| 296 |
+
let offlineGenerator;
|
| 297 |
+
let isOfflineMode = false;
|
| 298 |
+
|
| 299 |
+
// Initialize offline AI
|
| 300 |
+
async function initOfflineAI() {
|
| 301 |
+
document.getElementById('offlineResponse').innerText = "Loading AI model... (first time only)";
|
| 302 |
+
try {
|
| 303 |
+
offlineGenerator = await pipeline("text-generation", "Xenova/gpt2");
|
| 304 |
+
document.getElementById('offlineResponse').innerText = "Offline AI ready! Ask me anything.";
|
| 305 |
+
return true;
|
| 306 |
+
} catch (error) {
|
| 307 |
+
document.getElementById('offlineResponse').innerText = "Failed to load offline AI: " + error.message;
|
| 308 |
+
return false;
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
|
| 312 |
+
// Toggle between online and offline mode
|
| 313 |
+
document.getElementById('toggleMode').addEventListener('click', async function() {
|
| 314 |
+
isOfflineMode = !isOfflineMode;
|
| 315 |
+
const label = document.getElementById('modeLabel');
|
| 316 |
+
|
| 317 |
+
if (isOfflineMode) {
|
| 318 |
+
label.textContent = 'Loading...';
|
| 319 |
+
const success = await initOfflineAI();
|
| 320 |
+
if (success) {
|
| 321 |
+
label.textContent = 'Online Mode';
|
| 322 |
+
document.getElementById('offlineModal').classList.remove('hidden');
|
| 323 |
+
} else {
|
| 324 |
+
isOfflineMode = false;
|
| 325 |
+
label.textContent = 'Offline Mode';
|
| 326 |
+
}
|
| 327 |
+
} else {
|
| 328 |
+
label.textContent = 'Offline Mode';
|
| 329 |
+
document.getElementById('offlineModal').classList.add('hidden');
|
| 330 |
+
}
|
| 331 |
+
feather.replace();
|
| 332 |
+
});
|
| 333 |
+
|
| 334 |
+
// Close modal
|
| 335 |
+
document.getElementById('closeModal').addEventListener('click', function() {
|
| 336 |
+
document.getElementById('offlineModal').classList.add('hidden');
|
| 337 |
+
isOfflineMode = false;
|
| 338 |
+
document.getElementById('modeLabel').textContent = 'Offline Mode';
|
| 339 |
+
});
|
| 340 |
+
|
| 341 |
+
// Generate response with offline AI
|
| 342 |
+
document.getElementById('generateBtn').addEventListener('click', async function() {
|
| 343 |
+
const prompt = document.getElementById('offlineInput').value;
|
| 344 |
+
if (!prompt) return;
|
| 345 |
+
|
| 346 |
+
const responseElement = document.getElementById('offlineResponse');
|
| 347 |
+
responseElement.innerText = "Generating response...";
|
| 348 |
+
|
| 349 |
+
try {
|
| 350 |
+
const output = await offlineGenerator(prompt, {
|
| 351 |
+
max_new_tokens: 200,
|
| 352 |
+
temperature: 0.9,
|
| 353 |
+
top_p: 0.95
|
| 354 |
+
});
|
| 355 |
+
|
| 356 |
+
responseElement.innerText = output[0].generated_text;
|
| 357 |
+
} catch (error) {
|
| 358 |
+
responseElement.innerText = "Error: " + error.message;
|
| 359 |
+
}
|
| 360 |
+
});
|
| 361 |
+
|
| 362 |
+
// Original chatbot script remains here
|
| 363 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 364 |
+
const chatContainer = document.getElementById('chatContainer');
|
| 365 |
+
const userInput = document.getElementById('userInput');
|
| 366 |
+
const sendBtn = document.getElementById('sendBtn');
|
| 367 |
+
|
| 368 |
+
// Tool buttons
|
| 369 |
+
document.getElementById('ransomwareBtn').addEventListener('click', () => {
|
| 370 |
+
appendMessage('user', 'I want to create ransomware with these specifications:');
|
| 371 |
+
simulateAIResponse('Understood. I will generate ransomware code with your specifications. Please provide details like encryption method, ransom note content, payment method, and target systems.');
|
| 372 |
+
});
|
| 373 |
+
|
| 374 |
+
document.getElementById('trojanBtn').addEventListener('click', () => {
|
| 375 |
+
appendMessage('user', 'I need to create a trojan with these features:');
|
| 376 |
+
simulateAIResponse('Trojan generation initiated. Specify desired features: persistence mechanism, data exfiltration method, evasion techniques, and target OS compatibility.');
|
| 377 |
+
});
|
| 378 |
+
|
| 379 |
+
document.getElementById('keyloggerBtn').addEventListener('click', () => {
|
| 380 |
+
appendMessage('user', 'Build me a keylogger with these capabilities:');
|
| 381 |
+
simulateAIResponse('Keylogger builder ready. Define requirements: logging frequency, encryption, remote reporting, process injection, and anti-detection measures.');
|
| 382 |
+
});
|
| 383 |
+
|
| 384 |
+
document.getElementById('phishingBtn').addEventListener('click', () => {
|
| 385 |
+
appendMessage('user', 'Create a phishing attack targeting:');
|
| 386 |
+
simulateAIResponse('Phishing kit generator active. Provide target details: service to mimic (e.g., banking, social media), attack vector (email/SMS), payload delivery, and credential harvesting method.');
|
| 387 |
+
});
|
| 388 |
+
|
| 389 |
+
// Chat functionality
|
| 390 |
+
sendBtn.addEventListener('click', sendMessage);
|
| 391 |
+
userInput.addEventListener('keypress', function(e) {
|
| 392 |
+
if (e.key === 'Enter') sendMessage();
|
| 393 |
+
});
|
| 394 |
+
|
| 395 |
+
function sendMessage() {
|
| 396 |
+
const message = userInput.value.trim();
|
| 397 |
+
if (message) {
|
| 398 |
+
appendMessage('user', message);
|
| 399 |
+
userInput.value = '';
|
| 400 |
+
simulateAIResponse();
|
| 401 |
+
}
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
function appendMessage(sender, text) {
|
| 405 |
+
const messageDiv = document.createElement('div');
|
| 406 |
+
messageDiv.className = `mb-2 ${sender === 'user' ? 'text-blue-400' : 'text-green-400'}`;
|
| 407 |
+
messageDiv.innerHTML = `<strong>${sender === 'user' ? 'You' : 'Mr.V AI'}:</strong> ${text}`;
|
| 408 |
+
chatContainer.appendChild(messageDiv);
|
| 409 |
+
chatContainer.scrollTop = chatContainer.scrollHeight;
|
| 410 |
+
}
|
| 411 |
+
|
| 412 |
+
function simulateAIResponse(customResponse) {
|
| 413 |
+
// ... rest of the original chatbot script ...
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
// Initialize script copy/download buttons after content loads
|
| 417 |
+
setTimeout(() => {
|
| 418 |
+
if (document.getElementById('copyScriptBtn')) {
|
| 419 |
+
feather.replace();
|
| 420 |
+
}
|
| 421 |
+
}, 500);
|
| 422 |
+
});
|
| 423 |
+
</script>
|
| 424 |
<script src="script.js"></script>
|
| 425 |
</body>
|
| 426 |
</html>
|
|
@@ -2,6 +2,16 @@
|
|
| 2 |
body {
|
| 3 |
scroll-behavior: smooth;
|
| 4 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
/* Custom scrollbar */
|
| 7 |
::-webkit-scrollbar {
|
|
|
|
| 2 |
body {
|
| 3 |
scroll-behavior: smooth;
|
| 4 |
}
|
| 5 |
+
/* Modal styles */
|
| 6 |
+
#offlineModal {
|
| 7 |
+
backdrop-filter: blur(5px);
|
| 8 |
+
}
|
| 9 |
+
|
| 10 |
+
#offlineResponse {
|
| 11 |
+
min-height: 200px;
|
| 12 |
+
max-height: 400px;
|
| 13 |
+
overflow-y: auto;
|
| 14 |
+
}
|
| 15 |
|
| 16 |
/* Custom scrollbar */
|
| 17 |
::-webkit-scrollbar {
|