Coder Social home page Coder Social logo

deajan / pfsense-cp-auth-onestep Goto Github PK

View Code? Open in Web Editor NEW
25.0 10.0 32.0 264 KB

pfSense Captive portal self registration in one single step

License: BSD 3-Clause "New" or "Revised" License

PHP 48.08% JavaScript 51.77% HTML 0.14%
captive portal pfsense gui marketing autologin

pfsense-cp-auth-onestep's Introduction

pfSense Captive portal one step authentication solution

This script allows to use the captive portal without having to create a user account first. The user account gets created / updated on first login.

Features

  • Integration with pfSense Captive Portal, MySQL and FreeRADIUS
  • Full responsive template
  • jQuery validation
  • Server-side validation
  • Language customization
  • Separate user database for marketing needs
  • Terms of use modal
  • Nice error handling
  • Debug mode

How-to

Full documentation is available here (see the HTML link for English doc) http://netpower.fr/pfcp-pfSense-auth-onestep

pfsense-cp-auth-onestep's People

Contributors

deajan avatar subcomarcos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pfsense-cp-auth-onestep's Issues

Radius Error on form submit

Hi, i think there is a problem with the database insert.
When i click to the connect button, the registration form is back
In the system log of pfsense i can see this error :
(6) Invalid user (sql1 : Failed to create the pair: Invalid vendor name in attribute name "Password"): [[email protected]] (from client tester port 2000 cli xx:xx:xx:xx:xx:xx)
where xx is the mac address
And in the user database nothin is recorded

I use pfsense 2.4.3 so maybe your script isn't compatible.

The Instrutions does not work

I follow the step by step, but it is full of errors to put to wokr all in same box in a pfSense 2.4.4.p3
I separate the MySQL box to other machine, and the authentication log from the FreeRADIUS to the data base works, but when create the portal and do login on the ozy-asads.php page, give a full fatal errors the php some ones like mysqli not found in /var/etc/captiveportal_zonawifi.html:157 and a lot more of error, other error is login NULL and blah blah blah.
Some one can put to works easy this MOD ?

Thanks

SQL Injection

Unfortunately, your code is vulnerable to SQL Injections as the function "cleanInput($input)" is not sufficient for sanitizing SQL statements. For example, you are taking the familyName directly from the post parameter

$familyName = cleanInput($_POST["familyName"]);

which is later used in an SQL statement without any further validation:

$query = "UPDATE reg_users SET familyName = '$familyName', surName = '$surName', roomNumber = '$roomNumber' , ipAddress = '$ipAddress', regDate = '$regDate', identificator = '$identificator', newsletter = '$newsletter' WHERE macAddress = '$macAddress' AND emailAddress = '$emailAddress';";

In fact, I could exploit it with sqlmap:

sqlmap identified the following injection point(s) with a total of 4058 HTTP(s) requests:
---
Parameter: familyName (POST)
Type: boolean-based blind
Title: MySQL RLIKE boolean-based blind - WHERE, HAVING, ORDER BY or GROUP BY clause
Payload: [email protected]&familyName=Eisentraut' RLIKE (SELECT (CASE WHEN (6863=6863) THEN 0x456973656e7472617574 ELSE 0x28 END))-- KtQR&surName=Klaus&termsOfUse=termsOfUSe&connecter=Connect&connect=true
---

This can at least be used by an attacker to exfiltrate the names and email addresses of previous WiFi users from the database, so can you please use Prepared Statements? Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.