How does pfSense work



  • I'm trying to understanding how pfSense works
    To try an understand how pfSense works, I was going to see if I could figure out how the captive portal and radius plugin implemented.
    I have a demo VM setup. My VM setup is working as expected. I also have a cloned the repository. But now realize I don't know where to start trying to understand the implemented architecture. Are there any guides that would be a good starting point?
    Or start looking at start up services and trace the various calls from there? (This seems like a very intense way to start learning about the project)

    Many thanks.



  • Learning code from an app can be tricky which is why I tend to use debuggers to step through the code when source is available otherwise you have to rely on reverse compilers if they exist, plus in windows we also have something called debugview which is a bit like syslog server in that it captures messages sometimes with snapshots of variables emitted from the program at run time, but thats dependent on the programmers writing debugview messages into their code and having it switched on. Saying that some windows apps do ship with debugview messages possibly unintentially which can sometimes be useful for a variety of things.

    I dont know what exists on the freebsd platform with php, but maybe hunting down some debugging tools for php on freebsd might be a start?
    I'd also load up the captive portal web pages which the users see and the ones in pfsense and investigate the code from there.

    Anything in particular you are looking for? A backdoor perhaps?  ;)



  • @galto:

    I was going to see if I could figure out how the captive portal and radius plugin implemented.

    You can figure out a lot by looking at the captive portal PHP configuration page from the web user interface. The portal is implemented primarily using the ipfw firewall. If you want to see the rules it creates, you can create a captive portal called "Dummy" (or whatever) and then do an ipfw -x Dummy listor```
    ipfw -x Dummy show



  • @galto:

    To try an understand how pfSense works, I was going to see if I could figure out how the captive portal and radius plugin implemented.
    I have a demo VM setup. My VM setup is working as expected. I also have a cloned the repository. But now realize I don't know where to start trying to understand the implemented architecture. Are there any guides that would be a good starting point?

    Nothing great, but for what you're wanting to dig into it won't require much. Check out the development board here.
    https://forum.pfsense.org/index.php?board=32.0

    But mostly all you need to know for what you're looking at there, check /etc/inc/captiveportal.inc and you'll find all of how captive portal works. Find the specific part there that you're after, and you can trace functions further from there as needed (most of which will be from something in /etc/inc/).


Log in to reply