Jump to content

Php Extensions To Pineapple Mark Iv


Jaruba

Recommended Posts

Hello, I've just bought a Pineapple Mark IV and updated the firmware to version 2.4.0. Being a PHP Developer, I thought I'd have some fun with the DNS Spoofing option, but soon realized that php was missing a lot of it's commands. What I need is the php session commands and curl to work on the Pineapple, could anyone please guide me trough installing the required php extensions? Also, I was wondering if a USB Hub would work with the Mark IV. I imagine that the power supply would be to low to power to many usb devices, but what if the usb hub could also be powered by a secondary usb port on a battery pack, would that work? Or does the Mark IV not support usb hubs at all (missing drivers)?

Thank you in advance for any help on my issues.

Link to comment
Share on other sites

Hello, I've just bought a Pineapple Mark IV and updated the firmware to version 2.4.0. Being a PHP Developer, I thought I'd have some fun with the DNS Spoofing option, but soon realized that php was missing a lot of it's commands. What I need is the php session commands and curl to work on the Pineapple, could anyone please guide me trough installing the required php extensions? Also, I was wondering if a USB Hub would work with the Mark IV. I imagine that the power supply would be to low to power to many usb devices, but what if the usb hub could also be powered by a secondary usb port on a battery pack, would that work? Or does the Mark IV not support usb hubs at all (missing drivers)?

Thank you in advance for any help on my issues.

Here are 2 commands to get what I think you want


sed -i 's/;extension=session.so.*/extension=session.so/g' /etc/php.ini
opkg update
opkg install php4-mod-session
[/CODE]

usb hubs are supported but I have yet to find one that works properly, I should get one in the mail next week(one that others are saying works) and report on the forum of my success

Edited by petertfm
Link to comment
Share on other sites

Thanks for all the information, and peter, those commands wore exactly what I needed to find all the extensions for php I wanted. In total, I installed: php4-mod-session, php4-mod-curl, php4-mod-pcre (i probably installed libcurl and libpcre if they worn't already installed) after which modifying the php.ini accordingly to load the new extensions. Then restarted the pineapple, started dns spoof, and all my php pages finally worked without errors and as expected. But after around 10, probably 15 minutes, the dns spoof would stop working, and the spoofed dns would be reverted to it's real ip. When I try to go back to the web control panel, all pages would freeze, leaving me with the only option of restarting the pineapple.

Since then every time I restart the pineapple and enable some functions from the left side panel the pineapple freezes. When I start URL Snarf or DNS Spoof, the web panel freezes right after enabling them, and the "Karma / Connection Status" is empty (0 bytes of data), when attempting to press any other link, the pages never load. When starting Karma, it freezes on the screen where it sais "Entropy Bunny Activated". While SSH and Stealth (what is Stealth anyway?) work as expected.

I'm writing this issue here because I believe it may be directly linked to the installation of the php4-mods or libraries, although I cannot imagine how (would low memory create such an issue?), I'm ruling out it being a php script issue because the php files are not loading any external scripts and are not active at all (nor is anybody logged in on wireless) when these errors appear.

Any help would be truly appreciated at this point..

Fixed: It was actually a programming error, index.php went in an infinite loop if accessed from the real ip address, i think enabling those scripts accessed index.php somehow and froze the web server. Since I fixed the page everything works correctly.

Edited by Jaruba
Link to comment
Share on other sites

Thanks for all the information, and peter, those commands wore exactly what I needed to find all the extensions for php I wanted. In total, I installed: php4-mod-session, php4-mod-curl, php4-mod-pcre (i probably installed libcurl and libpcre if they worn't already installed) after which modifying the php.ini accordingly to load the new extensions. Then restarted the pineapple, started dns spoof, and all my php pages finally worked without errors and as expected. But after around 10, probably 15 minutes, the dns spoof would stop working, and the spoofed dns would be reverted to it's real ip. When I try to go back to the web control panel, all pages would freeze, leaving me with the only option of restarting the pineapple.

Since then every time I restart the pineapple and enable some functions from the left side panel the pineapple freezes. When I start URL Snarf or DNS Spoof, the web panel freezes right after enabling them, and the "Karma / Connection Status" is empty (0 bytes of data), when attempting to press any other link, the pages never load. When starting Karma, it freezes on the screen where it sais "Entropy Bunny Activated". While SSH and Stealth (what is Stealth anyway?) work as expected.

I'm writing this issue here because I believe it may be directly linked to the installation of the php4-mods or libraries, although I cannot imagine how (would low memory create such an issue?), I'm ruling out it being a php script issue because the php files are not loading any external scripts and are not active at all (nor is anybody logged in on wireless) when these errors appear.

Any help would be truly appreciated at this point..

Fixed: It was actually a programming error, index.php went in an infinite loop if accessed from the real ip address, i think enabling those scripts accessed index.php somehow and froze the web server. Since I fixed the page everything works correctly.

Jaruba you should put in a bug report to add your changes of index.php. I had an idea to make a module that would enable dnsspoof and redirect everything to it, then there would be a series of questions about say security and if that person got it right they would be blacklisted and kicked. I am not that great with php and couldn't find others code that would work well enough.

Link to comment
Share on other sites

A captive portal/transparent proxy module to replace or complement the current index.html & redirect.php would be extremely useful, it could go as far as providing a uniform way of silently redirecting users and loading additional modules like get or evil java. I had a go at hacking something like this together a few months ago but didn't get too far as I'm useless with PHP atm.

Link to comment
Share on other sites

Well.. you guys catch on fast. :P But after getting my modules up, getting some testing done and tinkering with code.. I came to the next conclusions:

@petertfm: Well yes, that would be cool, and there's one already created, it's called sslstrip, which in my opinion only needs a very good filter already made and embeded inside it to show only relevant captured data. This is kind of what I managed to do with my project also, make it a sslstrip that works on a few less sites on the internet (still working out bugs), works slower because it doesn't do pass thru traffic, but does essentially the same thing. (the biggest problem for my project and sslstrip seem to be web pages that redirect to self on https if accessed on http, pages just show blank in this case)

@TheScrub: Yeah, by getting all page data and printing it to the client instead of doing pass thru connections, although you add significant time to page loading, you do get the option of a sort of man-in-the-code attack.. and code can easily be inserted on pages.

I don't know if this project is even worth fighting for, the page loading time difference is quite high, to account for most internet webpage situations on a proxy so it works as expected in most places will take a very long time, and in the end it will just be a damn slow transparent proxy, that does what sslstrip already does for less memory usage, and gives the option to inject code on the go. The https to http redirect can't be beat, there's no workaround for this one.. And usually, when people are on a router that has a 'seemingly' slow internet connection and where some pages don't show as expected, but errored in any way, they will start searching for alternatives. So what would be the point in pulling people to the router, if they will eventually end up searching for how to get out of it? At the end of it all, I consider it to noisy for the pineapple, more so, I consider sslstrip to noisy too, yahoo mail goes blank after you log in (enough to get the credentials though), also paypal is blank before you even get the chance to log in, I haven't had time to test more websites, but I'm sure that many more might have this simple and effective security function.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...