Jump to content

MK3: Update Version 1.0.2


Recommended Posts

Changelog

1.0.2: Fixed error in Config page which was introducing “^M” to the ends of configuration file lines and causing Karma to not function. Fixed error in Advanced page which caused Factory Reset button not to require confirmation. Disabled default ngrep behavior.

Update 1.02

Copy and paste update code into the text area at the bottom of the Advanced page then click Execute Commands to update.

sed -i '18s/.*/if ($newdata != "") { $newdata = ereg_replace(13,  "", $newdata);/' /www/pineapple/config.php
sed -i 's/onClick=\\"return/onClick="return/' /www/pineapple/advanced.php
sed -i 's/ngrep/#ngrep/' /www/pineapple/ngrep.sh
echo 1.0.2 > /www/pineapple/version

Verify that update is complete by checking version information on the About page.

Link to comment
Share on other sites

Darren,

I copied and pasted the update code into my MK3 and hit submit.

I then get the 4 commands listed at the top of the page in red.

Next I go and check the about tab and it shows 1.0.2 as the version. Sweet!

Here is the problem, I still get the ^M at the end of every line in any config file I modify via the web interface.

So I go and look at the actual config files and they have not been updated. So I'm trying to figure out why it may not have worked.....I don't have to provide any credentials to log into the pineapple web interface so I figure maybe I should try the commands via SSH. So then I log in with root and pineapplesareyummy, I then run each command separately and they return without error. Ok so it looks good, I open the config files and I see that the changes have been made! I decide to go try a simple change via the web interface, so I click on configuration and I get the following error:

Parse error: syntax error, unexpected ') in /www/pineapple/config.php on line 18

Obviously line 18 is the line was modified with the first command "sed -i '18s/.*/if ($newdata != '') { $newdata = ereg_replace(13, "", $newdata);/' /www/pineapple/config.php"

So I have 2 issues:

1) It seems that the commands do not execute for me via the web interface

2) Commands can be executed via the command line and SSH, they will run without error but I am no longer able to use the configuration page via web interface with error mentioned above

Additional question:

Is it by design that the http://172.16.42.1/pineapple/ does not require credentials to log into? Also I can log into http://172.16.42.1/pineapple/ from a connected victim connected via karma.

EDIT: If I cleanup / edit the files manually karma still fires up and works so this is all just an interface issue.

Edited by itsm0ld
Link to comment
Share on other sites

OK so I was able to fix the error by looking closely at the actual config.php file vs what the command was asking it to do.

After copying and pasting the command directly from Darren's post into SSH it doesn't return an error however it modifies the file in this way:

if ($newdata != ) { $newdata = ereg_replace(13, "", $newdata);

The code should be:

if ($newdata != '') { $newdata = ereg_replace(13, "", $newdata);

I just added the two

''

and everything works.

Anyone else with a MK3 have issues with just copying and pasting the update code? I just wanted to make sure I wasn't crazy and tried it again from the web interface and it does not modify the files other than the version echo command.

Link to comment
Share on other sites

If you can use "" instead of '' then the following should work.

OLD
sed -i '18s/.*/if ($newdata != '') { $newdata = ereg_replace(13,  "", $newdata);/' /www/pineapple/config.php

NEW Try
sed -i '18s/.*/if ($newdata != "") { $newdata = ereg_replace(13,  "", $newdata);/' /www/pineapple/config.php

Link to comment
Share on other sites

Gah! I'm such a noob! Why didn't I escape 'em as \'\'.... Ugh. Well, thanks for catching that. I tested on my dev unit but I guess I missed that part. Yikes. Well, the double quotes work just as well and don't require escaping so I've updated the post and wifipineapple.com. Thanks :)

Link to comment
Share on other sites

Gah! I'm such a noob! Why didn't I escape 'em as \'\'.... Ugh. Well, thanks for catching that. I tested on my dev unit but I guess I missed that part. Yikes. Well, the double quotes work just as well and don't require escaping so I've updated the post and wifipineapple.com. Thanks :)

darren, your doing a great job bro. all the work you put in for us is very much appreciated

Link to comment
Share on other sites

even with all the variations of the sed code i couldn't get it to update automatically. Modified the php in vi, saved, updated via the advanced tab, still wouldn't connect.

started backtracking into the .sh, then the .conf file and my conf file had all the ^M's. Once i manually modified it everything worked.

Link to comment
Share on other sites

more to add.

any lines i add (i put in a comment to see how it saved) work fine, but even if i grab all the text in the karma config screen, paste it in notepad to hopefully strip anything special and put it back it saves with the ^m

not hard to fix via ssh just frustrating

Link to comment
Share on other sites

  • 4 weeks later...

HI Guys & Girls,

I’m Struggling with a MKIII from the Hakshop on which Karma has stopped working. I’ve run the 1.02 Update but that has not solved the problem.

Having read the FAQ I’ve run the trouble shooting command and got the following (Which is longer but this is a same sample:

Configuration file: /etc/hostapd/karma.conf

Line 3: invalid line '

'

Line 5: invalid/unknown driver 'nl80211

'

Etc…

Basically I believe this is still having the ^M issue.

I checked out DigiNinga’s Karma website and pasted in the Sample Karma config file but still have issues. Is there an original copy of the MKIII config file I can use?

I’ve tried resetting to Factor settings but that doesn’t seem to change back the config file.

How can I Check the Firmware version?

I’m using Win7 at the moment.

Thanks in advance, I’m a complete Noob at this all help and correction gratefully received.

BitBot

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.

 Share

  • Recently Browsing   0 members

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