spymare Posted November 24, 2011 Share Posted November 24, 2011 (edited) I have quite a big problem. I can't turn on karma, it won't activate. update 1.0.2 : http://forums.hak5.org/index.php?showtopic=23103 SHOULD solve the problem But after updating to 1.0.2 I am not able to turn on karma. However the update also gave me those errors with red text: SO I AM NOT SURE IT IS UPDATED; IT SHOULD NOT GIVE ANY ERRORS :S Executing: sed -i \'18s/.*/if ($newdata != \"\") { $newdata = ereg_replace(13, \"\", $newdata);/\' /www/pineapple/config.phpExecuting: sed -i \'s/onClick=\\\\\"return/onClick=\"return/\' /www/pineapple/advanced.php Executing: sed -i \'s/ngrep/#ngrep/\' /www/pineapple/ngrep.sh Executing: echo 1.0.2 > /www/pineapple/version Edited November 24, 2011 by spymare Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted November 24, 2011 Share Posted November 24, 2011 I should have clarified on the forums as I did just recently on the wiki. The problem with Karma not starting is that if you've modified the Karma settings from the Config page on v1.0.1 it would introduce ^M to the end of each line and thus preventing Karma from starting. The ^M isn't visible from the Config page's text areas or even when using cat to view the file via ssh, however editing the file in vi reveals their existence. It is trivial to remove them manually in vi, though a pain in the ass. All of that said, what the v1.0.2 update does is fix the config.php page so that before writing to the file it removes the superfluous linebreaks, represented as ^M. That's what $newdata = ereg_replace(13, \"\", $newdata); does, it replaces character 13 -- the linebreak -- with "" -- nothing. Of course if your karma config has already been corrupted simply applying the patch will not solve the problem, only keep it from coming up again in the future. To clean your karma settings go to the config page and click Update Karma underneath its text field. No changes need to be made, clicking update sends that textarea's values back to the config.php where the text will be processed, the ^M will be removed, and the file will be saved. At this point you can go back to the status page and start the service as normal. As for the errors you're seeing in red after applying the update: those aren't errors -- simply the page giving you feedback of what's being run. Since there is no standard output for each of those commands you won't see any white text beneath them. To verify that the update has been applied go to the About page and look for v1.0.2. Last but not least if this doesn't solve your problem we can continue troubleshooting by getting an output of your karma log. Once all of the above has been done begin by rebooting your pineapple, then clearing the pineapple cache from the Advanced page. Next go to the Status page and click Start next to MK3 Karma. Now navigate to the Advanced page and in the text area at the bottom enter "grep -v -e random /tmp/karma.log" (without the quotes) and click Execute Commands. The page will refresh displaying the output of the karma log file, sans the "random" bits (a lot of data we don't need). Go ahead and post your output here and we'll take a look. Quote Link to comment Share on other sites More sharing options...
spymare Posted November 24, 2011 Author Share Posted November 24, 2011 Hi Darren :) thanks you you reply. I used WinSCP to replace the config file from http://www.wifipineapple.com/pineapple-mk3-v1.0.2.tar.gz with the config file on the router. And now karma can be enabled. Is that the right thing to do, or should I replace all the files inside pineapple-mk3-v1.0.2.tar.gz with all the files on the router? Quote Link to comment Share on other sites More sharing options...
Darren Kitchen Posted November 24, 2011 Share Posted November 24, 2011 Nope, that does the trick. No need to replace the other files. Glad you got it sorted. Quote Link to comment Share on other sites More sharing options...
TaNk5665 Posted December 1, 2011 Share Posted December 1, 2011 (edited) I should have clarified on the forums as I did just recently on the wiki. The problem with Karma not starting is that if you've modified the Karma settings from the Config page on v1.0.1 it would introduce ^M to the end of each line and thus preventing Karma from starting. The ^M isn't visible from the Config page's text areas or even when using cat to view the file via ssh, however editing the file in vi reveals their existence. It is trivial to remove them manually in vi, though a pain in the ass. All of that said, what the v1.0.2 update does is fix the config.php page so that before writing to the file it removes the superfluous linebreaks, represented as ^M. That's what $newdata = ereg_replace(13, \"\", $newdata); does, it replaces character 13 -- the linebreak -- with "" -- nothing. Of course if your karma config has already been corrupted simply applying the patch will not solve the problem, only keep it from coming up again in the future. To clean your karma settings go to the config page and click Update Karma underneath its text field. No changes need to be made, clicking update sends that textarea's values back to the config.php where the text will be processed, the ^M will be removed, and the file will be saved. At this point you can go back to the status page and start the service as normal. As for the errors you're seeing in red after applying the update: those aren't errors -- simply the page giving you feedback of what's being run. Since there is no standard output for each of those commands you won't see any white text beneath them. To verify that the update has been applied go to the About page and look for v1.0.2. Last but not least if this doesn't solve your problem we can continue troubleshooting by getting an output of your karma log. Once all of the above has been done begin by rebooting your pineapple, then clearing the pineapple cache from the Advanced page. Next go to the Status page and click Start next to MK3 Karma. Now navigate to the Advanced page and in the text area at the bottom enter "grep -v -e random /tmp/karma.log" (without the quotes) and click Execute Commands. The page will refresh displaying the output of the karma log file, sans the "random" bits (a lot of data we don't need). Go ahead and post your output here and we'll take a look. Darren, I need some help.. My pineapple is jacked up too after I installed the 1.02 update... I ran the grep -v -e random /tmp/karma.log command like you said and this is what I got as output... PLEASE HELP.. i do not know much if any linux, so I need help for windows.... Now karma will not turn on.... Thanks Configuration file: /etc/hostapd/karma.conf Line 3: invalid line ' ' Line 5: invalid/unknown driver 'nl80211 ' Line 8: invalid line ' ' Line 11: invalid line ' ' Line 14: invalid line ' ' Line 21: Invalid group '0 ' Line 22: invalid line ' ' Line 25: invalid line ' ' Line 29: invalid line ' ' KARMA: Enabled 9 errors found in configuration file '/etc/hostapd/karma.conf' Edited December 1, 2011 by TaNk5665 Quote Link to comment Share on other sites More sharing options...
Mr-Protocol Posted December 1, 2011 Share Posted December 1, 2011 SSH to your pineapple, cat /etc/hostapd/karma.conf Post results. Quote Link to comment Share on other sites More sharing options...
c0der3d Posted December 1, 2011 Share Posted December 1, 2011 Console to your pineapple. type vi /etc/hostapd/karma.conf now edit the file manually. You will see ^M, just delete those by using the VI commands. Once you do that you are good to go! Quote Link to comment Share on other sites More sharing options...
wcs Posted December 1, 2011 Share Posted December 1, 2011 Darren, I need some help.. My pineapple is jacked up too after I installed the 1.02 update... I ran the grep -v -e random /tmp/karma.log command like you said and this is what I got as output... PLEASE HELP.. i do not know much if any linux, so I need help for windows.... Now karma will not turn on.... Thanks Configuration file: /etc/hostapd/karma.conf Line 3: invalid line ' ' Line 5: invalid/unknown driver 'nl80211 ' Line 8: invalid line ' ' Line 11: invalid line ' ' Line 14: invalid line ' ' Line 21: Invalid group '0 ' Line 22: invalid line ' ' Line 25: invalid line ' ' Line 29: invalid line ' ' KARMA: Enabled 9 errors found in configuration file '/etc/hostapd/karma.conf' Just got my Pineapple. I was only looking at the Karma.conf file when I clicked the update file by accident (I'm old and shaky ok lol). That's when Karma stop working for me. I did the update. Excuted this on the Pineapple advanced page "grep -v -e random /tmp/karma.log" My log file looked exactly the same, exactly. Console to your pineapple. type vi /etc/hostapd/karma.conf now edit the file manually. You will see ^M, just delete those by using the VI commands. Once you do that you are good to go! So I did this ^^^^^ Using Putty All Good! Karma stared again, Thanks everyone. For the linux noobs (of which I put myself) using the VI editor can be a bit tricky. After running the above command and bringing up the karma.conf file in VI: - Hit "i" (for insert, allows you to edit the file contents). - To save you need to get out of edit mode by hitting ESC first. - Now to save (write) the file hit ":" then "w" - To exit VI now hit ":" then "q" GL and Thanx again Quote Link to comment Share on other sites More sharing options...
abbie100 Posted December 2, 2011 Share Posted December 2, 2011 hi darren I was wondering if you could help me yeah when I accidently deleted the karma code I was in a panicking and instead of refresh the factory settings I went to google and I pasted in what I thought was a karma code before hitting update. Now when I hit factory settings it seems to go back to the one I pasted. After days of fustrating I discovered the site called digninja and I pasted in a sample karma ============================================================================== # config file to use with the Karma’d version of hostapd # created by Robin Wood – robin@digininja.org – http://www.digininja.org interface=wlan0 driver=nl80211 ssid=FreeInternet channel=1 # Both open and shared auth auth_algs=3 # no SSID cloaking ignore_broadcast_ssid=0 # -1 = log all messages logger_syslog=-1 logger_stdout=-1 # 2 = informational messages logger_syslog_level=2 logger_stdout_level=2 # Dump file for state information (on SIGUSR1) # example: kill -USR1 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 # 0 = accept unless in deny list macaddr_acl=0 # only used if you want to do filter by MAC address accept_mac_file=/etc/hostapd/hostapd.accept deny_mac_file=/etc/hostapd/hostapd.deny # Finally, enable Karma enable_karma=1 =============================================================================== hoping that this would fix the problem I then hit update followed by grep -v -e random /tmp/karma.log to see what the problem might entail and to my suprise I found this error log ============================================================================ Executing: grep -v -e random /tmp/karma.log Configuration file: /etc/hostapd/karma.conf Line 1: invalid line ‘ config file to use with the Karma’d version of hostapd ‘ Line 3: invalid line ‘ ‘ Line 5: invalid/unknown driver ‘nl80211 ‘ Line 8: invalid line ‘ ‘ Line 9: invalid line ‘both open and shared auth ‘ Line 11: invalid line ‘ ‘ Line 12: invalid line ‘ no SSID cloaking ‘ Line 14: invalid line ‘ ‘ Line 15: unknown configuration item ‘ -1 ‘ Line 18: invalid line ‘ ‘ Line 19: unknown configuration item ’2 ‘ Line 22: invalid line ‘ ‘ Line 23: invalid line ‘ Dump file for state information (on SIGUSR1) ‘ Line 27: Invalid group ’0 Line 28: invalid line ‘ Line 29: unknown configuration item ‘ 0 ‘ Line 31: invalid line ‘ ‘ MAC list file ‘/etc/hostapd/hostapd.accept ‘ not found. Line 33: Failed to read accept_mac_file ‘/etc/hostapd/hostapd.accept ‘ MAC list file ‘/etc/hostapd/hostapd.deny ‘ not found. Line 34: Failed to read deny_mac_file ‘/etc/hostapd/hostapd.deny ‘ Line 35: invalid line ‘ ‘ KARMA: Enabled 20 errors found in configuration file ‘/etc/hostapd/karma.conf ————————————————————————— seeing these errors I know understand why my karma is disable. My only chance is to replace the files using the files from the site digninja but I don’t know how I also read in hak5.org/forums about a guy who had problems with Karma but was able to replace his entire files using something called WINSCP but unfortunetaly he did not leave details how he did it. sorry for going on a bit but I am still learning how linux works. is there a chance you can point where I am going wrong cheers abbie ps any help will do Quote Link to comment Share on other sites More sharing options...
hfam Posted December 3, 2011 Share Posted December 3, 2011 Just got my Pineapple. I was only looking at the Karma.conf file when I clicked the update file by accident (I'm old and shaky ok lol). That's when Karma stop working for me. I did the update. Excuted this on the Pineapple advanced page "grep -v -e random /tmp/karma.log" My log file looked exactly the same, exactly. So I did this ^^^^^ Using Putty All Good! Karma stared again, Thanks everyone. For the linux noobs (of which I put myself) using the VI editor can be a bit tricky. After running the above command and bringing up the karma.conf file in VI: - Hit "i" (for insert, allows you to edit the file contents). - To save you need to get out of edit mode by hitting ESC first. - Now to save (write) the file hit ":" then "w" - To exit VI now hit ":" then "q" GL and Thanx again Oh man, thanks everyone for the assist, and thank you wcs SO much for posting this follow up, AND for posting the "linux n00bz" vi piece in there!!! Just got my pineapple today, ran the 1.0.2 update before doing anything, and sure enough karma wouldn't start. God I love you guys, this is going to be a helluva lot of fun! Thanks again to all!! Quote Link to comment Share on other sites More sharing options...
wcs Posted December 3, 2011 Share Posted December 3, 2011 (edited) hi darren I was wondering if you could help me yeah when I accidently deleted the karma code I was in a panicking and instead of refresh the factory settings I went to google and I pasted in what I thought was a karma code before hitting update. Now when I hit factory settings it seems to go back to the one I pasted. After days of fustrating I discovered the site called digninja and I pasted in a sample karma seeing these errors I know understand why my karma is disable. My only chance is to replace the files using the files from the site digninja but I don’t know how I also read in hak5.org/forums about a guy who had problems with Karma but was able to replace his entire files using something called WINSCP but unfortunetaly he did not leave details how he did it. sorry for going on a bit but I am still learning how linux works. is there a chance you can point where I am going wrong cheers abbie ps any help will do If I understand what your issues are... I will post the Karma config settings from my Pineapple (MK3). That way you can be sure you have the right stuff. # config file to use with the Karma'd version of hostapd # created by Robin Wood - robin@digininja.org - www.digininja.org interface=wlan0 driver=nl80211 ssid=internet channel=1 # both open and shared auth auth_algs=3 # no SSID cloaking ignore_broadcast_ssid=0 logger_syslog=-1 logger_stdout=-1 logger_syslog_level=2 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 # 0 = accept unless in deny list macaddr_acl=0 # only used if you want to do filter by MAC address #accept_mac_file=/etc/hostapd/hostapd.accept #deny_mac_file=/etc/hostapd/hostapd.deny # enable karma enable_karma=1 Now what will happen once you paste this in your Karma.conf file using the Pineapple Interface (in Configuration menu) and click the update button the settings will be written to the karma.conf file. Problem is, that there is a bug that appends ^M to ever line in the conf file. You can't see this in the Pineapple User Interface (UI) you need to terminal in to the pineapple. Terminal to the pineapple using putty.exe or something else. Connect using ssh login root password pineapplesareyummy Then follow the directions as stated a few posts before this one. In the end you want to delete all the ^M and save Edited December 3, 2011 by wcs Quote Link to comment Share on other sites More sharing options...
wcs Posted December 3, 2011 Share Posted December 3, 2011 Oh man, thanks everyone for the assist, and thank you wcs SO much for posting this follow up, AND for posting the "linux n00bz" vi piece in there!!! Just got my pineapple today, ran the 1.0.2 update before doing anything, and sure enough karma wouldn't start. God I love you guys, this is going to be a helluva lot of fun! Thanks again to all!! THANKS! Glad you found it useful Quote Link to comment Share on other sites More sharing options...
abbie100 Posted December 4, 2011 Share Posted December 4, 2011 If I understand what your issues are... I will post the Karma config settings from my Pineapple (MK3). That way you can be sure you have the right stuff. # config file to use with the Karma'd version of hostapd # created by Robin Wood - robin@digininja.org - www.digininja.org interface=wlan0 driver=nl80211 ssid=internet channel=1 # both open and shared auth auth_algs=3 # no SSID cloaking ignore_broadcast_ssid=0 logger_syslog=-1 logger_stdout=-1 logger_syslog_level=2 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 # 0 = accept unless in deny list macaddr_acl=0 # only used if you want to do filter by MAC address #accept_mac_file=/etc/hostapd/hostapd.accept #deny_mac_file=/etc/hostapd/hostapd.deny # enable karma enable_karma=1 Now what will happen once you paste this in your Karma.conf file using the Pineapple Interface (in Configuration menu) and click the update button the settings will be written to the karma.conf file. Problem is, that there is a bug that appends ^M to ever line in the conf file. You can't see this in the Pineapple User Interface (UI) you need to terminal in to the pineapple. Terminal to the pineapple using putty.exe or something else. Connect using ssh login root password pineapplesareyummy Then follow the directions as stated a few posts before this one. In the end you want to delete all the ^M and save I just like to thank you for taking the time to reply to my post expecially (hfam and wcs) and as well for posting your Karma code and along with instructions of how to config the karma.comf files. You guys are awesome. Being a linux newbie I still learning how linux works and having a lot of trouble trying to reinstate the karma code. I will definetly use the methods stated above as well as the karma code above to get it working and then post the results. Quote Link to comment Share on other sites More sharing options...
abbie100 Posted December 4, 2011 Share Posted December 4, 2011 If I understand what your issues are... I will post the Karma config settings from my Pineapple (MK3). That way you can be sure you have the right stuff. # config file to use with the Karma'd version of hostapd # created by Robin Wood - robin@digininja.org - www.digininja.org interface=wlan0 driver=nl80211 ssid=internet channel=1 # both open and shared auth auth_algs=3 # no SSID cloaking ignore_broadcast_ssid=0 logger_syslog=-1 logger_stdout=-1 logger_syslog_level=2 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 # 0 = accept unless in deny list macaddr_acl=0 # only used if you want to do filter by MAC address #accept_mac_file=/etc/hostapd/hostapd.accept #deny_mac_file=/etc/hostapd/hostapd.deny # enable karma enable_karma=1 Now what will happen once you paste this in your Karma.conf file using the Pineapple Interface (in Configuration menu) and click the update button the settings will be written to the karma.conf file. Problem is, that there is a bug that appends ^M to ever line in the conf file. You can't see this in the Pineapple User Interface (UI) you need to terminal in to the pineapple. Terminal to the pineapple using putty.exe or something else. Connect using ssh login root password pineapplesareyummy Then follow the directions as stated a few posts before this one. In the end you want to delete all the ^M and save Executing: grep -v -e random /tmp/karma.log Configuration file: /etc/hostapd/karma.conf Line 1: invalid line ‘ config file to use with the Karma’d version of hostapd ‘ Line 3: invalid line ‘ ‘ Line 5: invalid/unknown driver ‘nl80211 ‘ Line 8: invalid line ‘ ‘ Line 9: invalid line ‘both open and shared auth ‘ Line 11: invalid line ‘ ‘ Line 12: invalid line ‘ no SSID cloaking ‘ Line 14: invalid line ‘ ‘ Line 15: unknown configuration item ‘ -1 ‘ Line 18: invalid line ‘ ‘ Line 19: unknown configuration item ’2 ‘ Line 22: invalid line ‘ ‘ Line 23: invalid line ‘ Dump file for state information (on SIGUSR1) ‘ Line 27: Invalid group ’0 Line 28: invalid line ‘ Line 29: unknown configuration item ‘ 0 ‘ Line 31: invalid line ‘ ‘ MAC list file ‘/etc/hostapd/hostapd.accept ‘ not found. Line 33: Failed to read accept_mac_file ‘/etc/hostapd/hostapd.accept ‘ MAC list file ‘/etc/hostapd/hostapd.deny ‘ not found. Line 34: Failed to read deny_mac_file ‘/etc/hostapd/hostapd.deny ‘ Line 35: invalid line ‘ ‘ KARMA: Enabled 20 errors found in configuration file ‘/etc/hostapd/karma.conf ————————————————————————— hi I just like to add that this was my problem before even after updating it in the web interface but using your method and the karma code plus your how to guide I will ssh into pineapple and config it there. Thank you I was really stomped and was thinking of giving up and then post the outcome. again thank you Quote Link to comment Share on other sites More sharing options...
abbie100 Posted December 4, 2011 Share Posted December 4, 2011 If I understand what your issues are... I will post the Karma config settings from my Pineapple (MK3). That way you can be sure you have the right stuff. # config file to use with the Karma'd version of hostapd # created by Robin Wood - robin@digininja.org - www.digininja.org interface=wlan0 driver=nl80211 ssid=internet channel=1 # both open and shared auth auth_algs=3 # no SSID cloaking ignore_broadcast_ssid=0 logger_syslog=-1 logger_stdout=-1 logger_syslog_level=2 logger_stdout_level=2 dump_file=/tmp/hostapd.dump ctrl_interface=/var/run/hostapd ctrl_interface_group=0 # 0 = accept unless in deny list macaddr_acl=0 # only used if you want to do filter by MAC address #accept_mac_file=/etc/hostapd/hostapd.accept #deny_mac_file=/etc/hostapd/hostapd.deny # enable karma enable_karma=1 Now what will happen once you paste this in your Karma.conf file using the Pineapple Interface (in Configuration menu) and click the update button the settings will be written to the karma.conf file. Problem is, that there is a bug that appends ^M to ever line in the conf file. You can't see this in the Pineapple User Interface (UI) you need to terminal in to the pineapple. Terminal to the pineapple using putty.exe or something else. Connect using ssh login root password pineapplesareyummy Then follow the directions as stated a few posts before this one. In the end you want to delete all the ^M and save yah I did I did after five days I finally got karma working thanks for all your help Quote Link to comment Share on other sites More sharing options...
abbie100 Posted December 4, 2011 Share Posted December 4, 2011 Oh man, thanks everyone for the assist, and thank you wcs SO much for posting this follow up, AND for posting the "linux n00bz" vi piece in there!!! Just got my pineapple today, ran the 1.0.2 update before doing anything, and sure enough karma wouldn't start. God I love you guys, this is going to be a helluva lot of fun! Thanks again to all!! thank you finally got it working like you said "this is going to be a helluva lot of fun" Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.