Whistle Master Posted March 9, 2012 Share Posted March 9, 2012 (edited) Hi everyone ! This module adds a new menu entry "Buttons" in the GUI to allow the configuration of the WPS button behavior. You can add the following actions to the WPS button: - Toggle Karma - Toggle DNS Spoof - Toggle URL Snarf - Connect SSH - Reboot - Run Custom Script (4 custom scripts available) 4 duration can be configured: - 0-2 Seconds - 4-6 Seconds - 8-10 Seconds - 12+ Seconds Module is available through module system. Edited August 7, 2012 by Whistle Master Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted March 9, 2012 Share Posted March 9, 2012 Whistle Master, Nice mod! I have actually added a similar setup for the next release, just that I have no pre-configuration. You can select what time you want and then modify the script depending on what is selected. What I should add is that this may break the reset button disable / enable. I can't try it out right now, but that is something quite important to keep intact. Thanks for posting it! Best, Sebkinne Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted March 9, 2012 Author Share Posted March 9, 2012 Thanks! I can't wait to see yours in the next release :) Regarding the reset button enable/disable, I did the following: each time the button actions are updated, I remove all the button from the system config (system.@button): while(exec("uci get system.@button[0]") == "button") { exec("uci delete system.@button[0]"); } exec("uci commit system"); and I then add again all the button, keeping the reset button for the last position: for($i=0;$i<4;$i++) { exec("uci add system button"); exec("uci set system.@button[".$i."].button=reset"); exec("uci set system.@button[".$i."].action=released"); if($_wpsx[$i] == 0) $handler = "logger No action"; else if($_wpsx[$i] == 1) $handler = "php /www/toggle_services.php -karma"; else if($_wpsx[$i] == 2) $handler = "php /www/toggle_services.php -dnsspoof"; else if($_wpsx[$i] == 3) $handler = "php /www/toggle_services.php -snarf"; else if($_wpsx[$i] == 4) $handler = "php /www/toggle_services.php -s"; else if($_wpsx[$i] == 5) $handler = "reboot"; else if($_wpsx[$i] == 6) $handler = "sh /www/pineapple/wpsScript.sh"; exec("uci set system.@button[".$i."].handler='".$handler."'"); exec("uci set system.@button[".$i."].min=".$_wpsx_min[$i].""); exec("uci set system.@button[".$i."].max=".$_wpsx_max[$i].""); exec("uci commit system"); } exec("uci add system button"); exec("uci set system.@button[4].button=wps"); exec("uci set system.@button[4].action=released"); exec("uci set system.@button[4].handler='cp /etc/config/backup/* /etc/config/ && reboot'"); exec("uci set system.@button[4].min=5"); exec("uci set system.@button[4].max=10"); exec("uci commit system"); I had also to modify the resetButton.sh to always remove/add button n°4 as reset button will always be at this position with my implementation. Quote Link to comment Share on other sites More sharing options...
mreidiv Posted March 19, 2012 Share Posted March 19, 2012 (edited) Thanks! I can't wait to see yours in the next release :) Regarding the reset button enable/disable, I did the following: each time the button actions are updated, I remove all the button from the system config (system.@button): while(exec("uci get system.@button[0]") == "button") { exec("uci delete system.@button[0]"); } exec("uci commit system"); and I then add again all the button, keeping the reset button for the last position: for($i=0;$i<4;$i++) { exec("uci add system button"); exec("uci set system.@button[".$i."].button=reset"); exec("uci set system.@button[".$i."].action=released"); if($_wpsx[$i] == 0) $handler = "logger No action"; else if($_wpsx[$i] == 1) $handler = "php /www/toggle_services.php -karma"; else if($_wpsx[$i] == 2) $handler = "php /www/toggle_services.php -dnsspoof"; else if($_wpsx[$i] == 3) $handler = "php /www/toggle_services.php -snarf"; else if($_wpsx[$i] == 4) $handler = "php /www/toggle_services.php -s"; else if($_wpsx[$i] == 5) $handler = "reboot"; else if($_wpsx[$i] == 6) $handler = "sh /www/pineapple/wpsScript.sh"; exec("uci set system.@button[".$i."].handler='".$handler."'"); exec("uci set system.@button[".$i."].min=".$_wpsx_min[$i].""); exec("uci set system.@button[".$i."].max=".$_wpsx_max[$i].""); exec("uci commit system"); } exec("uci add system button"); exec("uci set system.@button[4].button=wps"); exec("uci set system.@button[4].action=released"); exec("uci set system.@button[4].handler='cp /etc/config/backup/* /etc/config/ && reboot'"); exec("uci set system.@button[4].min=5"); exec("uci set system.@button[4].max=10"); exec("uci commit system"); I had also to modify the resetButton.sh to always remove/add button n°4 as reset button will always be at this position with my implementation. looks good but where can we find the files i cant find them on the wiki. Edited March 19, 2012 by mreidiv Quote Link to comment Share on other sites More sharing options...
PineDominator Posted March 19, 2012 Share Posted March 19, 2012 Hi everyone ! I added a mod on the wiki about the WPS button. This adds a new menu entry "Buttons" in the GUI to allow the configuration of the WPS button behavior. You can add the following actions to the WPS button: - Toggle Karma - Toggle DNS Spoof - Toggle URL Snarf - Connect SSH - Reboot - Run Custom Script 4 duration can be configured: - 0-2 Seconds - 4-6 Seconds - 8-10 Seconds - 12+ Seconds Great work Whistle Master! I really hope this is going to be added to the project? one thing that would help is using one of the leds to signal when to let go? or a secession of presses maybe within 1 second. when wps button pressed wpsCount++ reset/set wps timer if wps timer is 1 second old goto wps select case, reset wpsCount, disable wps timer Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted March 19, 2012 Author Share Posted March 19, 2012 While waiting to reorder all the stuff on the github wiki, I uploaded the wps buttons scripts files here. Quote Link to comment Share on other sites More sharing options...
mreidiv Posted March 19, 2012 Share Posted March 19, 2012 While waiting to reorder all the stuff on the github wiki, I uploaded the wps buttons scripts files here. Thanks Whistle Master gave u rep points. Quote Link to comment Share on other sites More sharing options...
RebelCork Posted March 19, 2012 Share Posted March 19, 2012 While waiting to reorder all the stuff on the github wiki, I uploaded the wps buttons scripts files here. Thanks ! Been looking for this (and annoying many, many other posters!). I have done a quick edit and added the link to the file on the wiki for any other noobs such as myself! Quote Link to comment Share on other sites More sharing options...
MrBurN Posted March 19, 2012 Share Posted March 19, 2012 Awesome , Thanks !! keep the good work ! Quote Link to comment Share on other sites More sharing options...
hfam Posted March 20, 2012 Share Posted March 20, 2012 Whistle Master's blowin' it UP out here with the sweet mods, thanks man, nice work! ;) Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted July 22, 2012 Author Share Posted July 22, 2012 New version is out ! 4 custom scripts available now :) Quote Link to comment Share on other sites More sharing options...
PineDominator Posted August 20, 2012 Share Posted August 20, 2012 Hi WM I am having an issue running a command in the custom script 1, the problem is I have mdk3 launch with a "&" on the end and it's not running? also in the jobs running I see this " 11121 root 1492 S sh /usb/modules/button//scripts/wpsScript1.sh " double slash? Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted August 22, 2012 Author Share Posted August 22, 2012 (edited) Thanks for the repport, I will have a look at it ;) Edited August 22, 2012 by Whistle Master Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted August 31, 2012 Share Posted August 31, 2012 IMPORTANT: This has now been fixed. This module has been pulled from the module database. When setting a WPS script, it overwrites the reset button handler. In doing that, the resetPineapple.sh script does not get used which can potentially cause a brick. I believe that this is responsible for all the people reporting that the reset button does not reset their password and that they now need to get a serial cable. To fix this issue you will need to uninstall the module and re-flash the pineapple. Best Regards, Sebkinne Note: I am well aware that the issue at hand was not introduced on purpose. It was simply overlooked. WhistleMaster of course did not mean to cause this. The pulling of the module is not permanent either, once the issue is resolved it will be back. Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted August 31, 2012 Author Share Posted August 31, 2012 This behavior is from the very first version of the module. I will update it as soon as possible ! Sorry for the issue ! Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted August 31, 2012 Share Posted August 31, 2012 This behavior is from the very first version of the module. I will update it as soon as possible ! Sorry for the issue ! I now placed the reset button at system.@button[0]. So simply do not remove that and remove anything > 0. A simply for loop should do the trick :) That way you do not need to re-program the reset button at all which in the case of file changes would be best ;) Best Regards, Sebkinne Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted August 31, 2012 Author Share Posted August 31, 2012 In a freshly flashed pineapple 2.6.1, the reset button is still in the second position, correct ? So the reset button will be at '0' in the next release, right ? In that case, I will wait for a new release to submit the new version. Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted September 2, 2012 Author Share Posted September 2, 2012 v2.2 is available which corrects the issue ! Sent to Seb ;) Quote Link to comment Share on other sites More sharing options...
Bountyhunter50 Posted November 11, 2012 Share Posted November 11, 2012 (Speaking again as a Pineapple No0b) What language is the Pineapple programmed with? I'm wanting to create a few custom scripts (Using the Button module :D ) but again, Novice status has already been achieved for me. Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted November 12, 2012 Share Posted November 12, 2012 (Speaking again as a Pineapple No0b) What language is the Pineapple programmed with? I'm wanting to create a few custom scripts (Using the Button module :D ) but again, Novice status has already been achieved for me. Scripts would be done in bash. Quote Link to comment Share on other sites More sharing options...
hardrive9000 Posted November 22, 2012 Share Posted November 22, 2012 WM thanks for this infusion..It's geat but....there's a problem. I'm running the latest firmware version (2.7 - MK4) and no option seems to work. Only "Reboot" option works. MK4 Karma, DNS Spoof, URL Snarf, SSH not change their statuses when WPS Button is pressed. Will be an update for this infusion? Thanks in advance. Best regards. Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted November 22, 2012 Author Share Posted November 22, 2012 (edited) I will have a look at it :) EDIT: You were right, the module was not working anymore due to changes in some paths between firmware versions. New version 2.5 sent to Seb. Edited November 23, 2012 by Whistle Master Quote Link to comment Share on other sites More sharing options...
Sebkinne Posted February 14, 2013 Share Posted February 14, 2013 Hey WhistleMaster, I think you may need to fix this module to work with the reset button again. See this thread. Quote Link to comment Share on other sites More sharing options...
Whistle Master Posted February 14, 2013 Author Share Posted February 14, 2013 I answered in the tread. I think the issue is not related to the module. Let's investigate ! :) Quote Link to comment Share on other sites More sharing options...
GeHeNoM Posted February 24, 2013 Share Posted February 24, 2013 Solved. look in this thread http://forums.hak5.org/index.php?/topic/28778-wps-button-not-working/ 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.