Jump to content

[Support] Randomroll


Foxtrot

Recommended Posts

  • Replies 87
  • Created
  • Last Reply

Top Posters In This Topic

Awesome work Foxtrot, can I make a few suggestions? Great thanks! :P

Change your functions.php to backup the current index.php, error.php and redirect.php during a start
and restore these back during a stop.
Also, you should change your dnsspoof command to use /tmp/dnsspoof.log incase anyone is watching that log.

And finally :)
Since your dnsspoof command uses its own spoofhost file. You don't need to echo 172.16.42.1 example.com back in during a stop.

PT

Check it my mods to your functions.php

Edit:placed the proper dnsspoof.log back in, so it shows in the infusion's log window.



 
// Start and Stop RandomRoll

if(isset($_POST['startRandomRollSubmit'])){
exec('killall dnsspoof');
exec('dnsspoof -i br-lan -f /pineapple/components/infusions/randomroll/assets/files/spoofhost > /dev/null 2> /pineapple/components/infusions/randomroll/assets/files/dnsspoof.log &');
exec('cp /www/error.php /pineapple/components/infusions/randomroll/assets/files/error.orig');
exec('cp /www.index.php /pineapple/components/infusions/randomroll/assets/files/index.orig');
exec('cp /www/redirect.php /pineapple/components/infusions/randomroll/assets/files/redirect.orig');
exec('rm -rf /www/error.php');
exec('rm -rf /www/index.php');
exec('rm -rf /www/redirect.php');
exec('ln -s /pineapple/components/infusions/randomroll/assets/files/index.php /www/index.php');
exec("ln -s /pineapple/components/infusions/randomroll/assets/rolls/ /www/");
}

if(isset($_POST['stopRandomRollSubmit'])){
exec('killall dnsspoof');
exec('rm -rf /pineapple/components/infusions/randomroll/assets/files/dnsspoof.log');
exec('rm -rf /www/index.php');
exec('rm -rf /www/rolls/');
exec('cp /pineapple/components/infusions/randomroll/assets/files/error.orig /www/error.php');
exec('cp /pineapple/components/infusions/randomroll/assets/files/index.orig /www/index.php');
exec('cp /pineapple/components/infusions/randomroll/assets/files/redirect.orig /www/redirect.php');
exec('rm -rf /www/rickroll.php');
exec('rm -rf /www/rcmroll.php');
exec('rm -rf /www/nyanroll.php');
exec('rm -rf /www/pbjtroll.php');
exec('rm -rf /www/trollroll.php');
exec('rm -rf /www/bsodroll.php');
exec('rm -rf /www/afroroll.php');
} 
Edited by phibertap
Link to comment
Share on other sites

Backing up the current index.php, error.php and redirect.php has been implemented, but using the /tmp/dnsspoof.log will not. This is done on purpose because the infusion is supposed to show ONLY what RandomRoll is doing. Using the above mods will break functionality within the infusion.

Link to comment
Share on other sites

Foxtrot, I did notice that your logging function within your infusion seems to display the log as a run-on instead of each line being displayed one after another.

 
 
dnsspoof: listening on br-lan [udp dst port 53 and not src 172.16.42.1] 172.16.42.175.65355 > 172.16.42.1.53: 34816+ A? www.itools.info 172.16.42.175.61906 > 172.16.42.1.53: 9800+ A? www.ibook.info 172.16.42.175.49431 > 172.16.42.1.53: 32618+ A? www.apple.com 172.16.42.175.52962 > 172.16.42.1.53: 61479+ A? p07-keyvalueservice.icloud.com 172.16.42.175.58969 > 172.16.42.1.53: 50823+ A? 44-courier.push.apple.com 172.16.42.175.50558 > 172.16.42.1.53: 23116+ A? apple.com 172.16.42.175.49431 > 172.16.42.1.53: 32618+ A? www.apple.com 172.16.42.175.52962 > 172.16.42.1.53: 61479+ A? p07-keyvalueservice.icloud.com 172.16.42.175.58969 > 172.16.42.1.53: 50823+ A? 44-courier.push.apple.com 172.16.42.175.54948 > 172.16.42.1.53: 51987+ A? 48-courier.push.apple.com 172.16.42.175.54948 > 172.16.42.1.53: 51987+ A? 48-courier.push.apple.com 172.16.42.175.58502 > 172.16.42.1.53: 50844+ A? www.uo-pixel.de




When i watch the

/pineapple/components/infusions/randomroll/assets/files/dnsspoof.log

within the logs infusions, the log is displayed like this:

 
Following '/pineapple/components/infusions/randomroll/assets/files/dnsspoof.log':
172.16.42.175.50558 > 172.16.42.1.53:  23116+ A? apple.com
172.16.42.175.49431 > 172.16.42.1.53:  32618+ A? www.apple.com
172.16.42.175.52962 > 172.16.42.1.53:  61479+ A? p07-keyvalueservice.icloud.com
172.16.42.175.58969 > 172.16.42.1.53:  50823+ A? 44-courier.push.apple.com
172.16.42.175.54948 > 172.16.42.1.53:  51987+ A? 48-courier.push.apple.com
172.16.42.175.54948 > 172.16.42.1.53:  51987+ A? 48-courier.push.apple.com
172.16.42.175.58502 > 172.16.42.1.53:  50844+ A? www.uo-pixel.de
172.16.42.175.51461 > 172.16.42.1.53:  34448+ A? 22-courier.push.apple.com
172.16.42.175.63483 > 172.16.42.1.53:  51061+ A? cl2.apple.com
172.16.42.175.63082 > 172.16.42.1.53:  30786+ A? 40-courier.push.apple.com

Not sure if this is a bug or intended.

PT

Link to comment
Share on other sites

  • 4 weeks later...
Hello, just wanted to say that I do not get to add a new "roll" on my pineapple, I edited functions.php to add the lines that point to the directory of my new "roll" without success.
this is the code:
<?php 

// Start and Stop RandomRoll

if(isset($_POST['startRandomRollSubmit'])){
  exec('killall dnsspoof');
  exec('dnsspoof -i br-lan -f /pineapple/components/infusions/randomroll/assets/files/spoofhost > /dev/null 2> /pineapple/components/infusions/randomroll/assets/files/dnsspoof.log &');
  exec('rm -rf /www/index.php');
  exec('rm -rf /www/redirect.php');
  exec('rm -rf /www/error.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/files/index.php /www/index.php');
  exec("ln -s /pineapple/components/infusions/randomroll/assets/rolls/ /www/");
  exec('echo "172.16.42.1 *" > /pineapple/components/infusions/randomroll/assets/files/spoofhost');
}

if(isset($_POST['stopRandomRollSubmit'])){
  exec('killall dnsspoof');
  exec('rm -rf /pineapple/components/infusions/randomroll/assets/files/dnsspoof.log');
  exec('rm -rf /www/index.php');
  exec('rm -rf /www/rolls/');
  exec('cp /pineapple/components/infusions/randomroll/assets/files/error.orig /www/error.php');
  exec('cp /pineapple/components/infusions/randomroll/assets/files/index.orig /www/index.php');
  exec('cp /pineapple/components/infusions/randomroll/assets/files/redirect.orig /www/redirect.php');
  exec('echo "172.16.42.1 example.com" > /pineapple/components/infusions/randomroll/assets/files/spoofhost');
  exec('rm -rf /www/rickroll.php');
  exec('rm -rf /www/rcmroll.php');
  exec('rm -rf /www/nyanroll.php');
  exec('rm -rf /www/pbjtroll.php');
  exec('rm -rf /www/trollroll.php');
  exec('rm -rf /www/bsodroll.php');
  exec('rm -rf /www/afroroll.php');
  exec('rm -rf /www/MYROLL.php');
}




//// Selection of Rolls.

// Remove rolls.
if(isset($_POST['rollsRemoveSubmit'])){
  exec('rm -rf /www/rickroll.php');
  exec('rm -rf /www/rcmroll.php');
  exec('rm -rf /www/nyanroll.php');
  exec('rm -rf /www/pbjtroll.php');
  exec('rm -rf /www/trollroll.php');
  exec('rm -rf /www/bsodroll.php');
  exec('rm -rf /www/afroroll.php');
  exec('rm -rf /www/MYROLL.php');

}

// Submit

if(isset($_POST['rollsCheckBoxSubmit'])){
  // cool guys dont look at explosions... 
  $rolls = explode(',', $_POST['checkbox']);
  foreach($rolls as $roll){
    switch ($roll) {
      case 'rickroll':
        exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/RickRoll/rickroll.php /www/rickroll.php');
      break;
      case 'rcmroll':
        exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/RCMRoll/rcmroll.php /www/rcmroll.php');
      break;
      case 'nyanroll':
        exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/NyanRoll/nyanroll.php /www/nyanroll.php');
      break;
      case 'pbjtroll':
        exec("ln -s /pineapple/components/infusions/randomroll/assets/rolls/PBJTRoll/pbjtroll.php /www/pbjtroll.php");
      break;
      case 'trollroll':
        exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/TrollRoll/trollroll.php /www/trollroll.php');
      break;
      case 'bsodroll':
        exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/BSODRoll/bsodroll.php /www/bsodroll.php');
      break;
      case 'afroroll':
        exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/AfroRoll/afroroll.php /www/afroroll.php');
      break;
	case 'MYROLL':
	exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/MYROLL/MYROLL.php /www/MYROLL.php');
      break;
	

    }
  }
echo 'You Selected :<br/>';
print_r($_POST['checkbox']);
}



//// Small Tile Code!


// Quick Start
if(isset($_POST['quickstartSmallTileSubmit'])){
  exec('killall dnsspoof');
  exec('dnsspoof -i br-lan -f /pineapple/components/infusions/randomroll/assets/files/spoofhost > /pineapple/components/infusions/randomroll/assets/files/dnsspoof.log &');
  exec('rm -rf /www/index.php');
  exec('rm -rf /www/redirect.php');
  exec('rm -rf /www/error.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/files/index.php /www/index.php');
  exec("ln -s /pineapple/components/infusions/randomroll/assets/rolls/ /www/");
  exec('echo "172.16.42.1 *" > /pineapple/components/infusions/randomroll/assets/files/spoofhost');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/RickRoll/rickroll.php /www/rickroll.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/RCMRoll/rcmroll.php /www/rcmroll.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/NyanRoll/nyanroll.php /www/nyanroll.php');
  exec("ln -s /pineapple/components/infusions/randomroll/assets/rolls/PBJTRoll/pbjtroll.php /www/pbjtroll.php");
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/TrollRoll/trollroll.php /www/trollroll.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/BSODRoll/bsodroll.php /www/bsodroll.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/AfroRoll/afroroll.php /www/afroroll.php');
  exec('ln -s /pineapple/components/infusions/randomroll/assets/rolls/MYROLL/MYROLL.php /www/MYROLL.php');
 
}

// Quick Stop
if(isset($_POST['quickstopSmallTileSubmit'])){
  exec('killall dnsspoof');
  exec('rm -rf /pineapple/components/infusions/randomroll/assets/files/dnsspoof.log');
  exec('rm -rf /www/index.php');
  exec('rm -rf /www/rolls/');
  exec('cp /pineapple/components/infusions/randomroll/assets/files/error.orig /www/error.php');
  exec('cp /pineapple/components/infusions/randomroll/assets/files/index.orig /www/index.php');
  exec('cp /pineapple/components/infusions/randomroll/assets/files/redirect.orig /www/redirect.php');
  exec('echo "172.16.42.1 example.com" > /pineapple/components/infusions/randomroll/assets/files/spoofhost');
  exec('rm -rf /www/rickroll.php');
  exec('rm -rf /www/rcmroll.php');
  exec('rm -rf /www/nyanroll.php');
  exec('rm -rf /www/pbjtroll.php');
  exec('rm -rf /www/trollroll.php');
  exec('rm -rf /www/bsodroll.php');
  exec('rm -rf /www/afroroll.php');
  exec('rm -rf /www/MYROLL.php');
	
}

?>
Maybe I'm doing something wrong, pineapple mark iv had no problems, but perhaps with the mark V is leaving me something along the way.
I do not think it much more complicated to add my own "Roll"
Thanks for the responses.
Link to comment
Share on other sites

Thanks, I did not realize to check that file for editing.
What I had were problems with having installed all infusions in micro-sd, the system slowed down and had to remove them.

You guys left a part ye to exchange (swap) on the sd?
Thanks for the help, and served me well in the future I will be more careful when reviewing the code.

Link to comment
Share on other sites

  • 2 weeks later...

Backing up the current index.php, error.php and redirect.php has been implemented, but using the /tmp/dnsspoof.log will not. This is done on purpose because the infusion is supposed to show ONLY what RandomRoll is doing. Using the above mods will break functionality within the infusion.

Starting RandomRoll seemed to overwrite my index.php, error.php and redirect.php and did not restore them when stopped.

I had to restore the files from /rom/www/

Link to comment
Share on other sites

  • 2 months later...

I'm after some guidance on getting Random Roll v1.2 working on my WiFi Pineapple (firmware v1.3).

I select the Roll I want, click on "Apply Selected Roll.", then click on "Start Random Roll". I see a brief message at the top informing me that Random Roll has started... and then a log entry below.

dnsspoof: listening on br-lan [udp dst port 53 and not src 172.16.42.1]

I confirm that DNSSpoof is running.

... and then nothing!

Clients connected to the WiFi Pineapples wlan0 access point seem to be unaffected. Their web browsing either seems to work fine... or it stops altogether after some time of the Random Roll infusing running.

What am I doing wrong? Any tips?

Lunokhod

Link to comment
Share on other sites

  • 4 weeks later...

Another "stupid" question on top of my previous post.

I'm still trying to get RandomRoll working reliably... I've got v1.2 installed.

When I start RandomRoll my existing existing /www index.php, error.php and redirect.php files are not copied into the /sd/infusions/randomroll/assets/files directory... with .orig suffix.

I see the new index.php, roll .php file/s and roll folder symbolic links in /www.

When I stop RandomRoll, the .orig files are copied back into the /www folder (with .php suffix) overwriting the files that are there.

Is this what others are experiencing with RandomRoll?

Link to comment
Share on other sites

That's what should be happening I believe. It copies the random roll index.php to where the web server can read them. When you stop it, the old one is copied back. Sometimes mobile devices ignore the pineapple's dns settings if they've been to a site lately. Reboot the device and try after that. Also try starting up random roll before they connect.

Link to comment
Share on other sites

RandomRoll does not copy the index.php file from /sd/infusions/randomroll/assets/files/ it creates a sym link to the original file... this is fine.

DNS caching is my main problem with RandomRoll not working. This is something that I can fix on my own machines... but not easy to circumvent if it happens on "someone else's" PC. :-)

I'm more concerned that my carefully crafted index.php, error.php and redirect.php files in /www/ are not backed up before being removed by the infusion. The .orig ones stored in /sd/infusions/randomroll/assets/files/ are most certainly copied back to www when the the infusion is stopped.

I can manually copy my files over (changing the suffix to .orig) and RandomRoll will replace them when it's stopped.

Now I understand what is happening I can work around it.

Lunokhod

Link to comment
Share on other sites

RandomRoll does not copy the index.php file from /sd/infusions/randomroll/assets/files/ it creates a sym link to the original file... this is fine.

DNS caching is my main problem with RandomRoll not working. This is something that I can fix on my own machines... but not easy to circumvent if it happens on "someone else's" PC. :-)

I'm more concerned that my carefully crafted index.php, error.php and redirect.php files in /www/ are not backed up before being removed by the infusion. The .orig ones stored in /sd/infusions/randomroll/assets/files/ are most certainly copied back to www when the the infusion is stopped.

I can manually copy my files over (changing the suffix to .orig) and RandomRoll will replace them when it's stopped.

Now I understand what is happening I can work around it.

Lunokhod

I see what you're saying now. Turn your index.php into a roll. That way you don't accidentally kill it. It's not too difficult to figure out how they are set up. I did it, so it can't be that hard! :lol:

Link to comment
Share on other sites

1.3 will be out soon fixing this problem hopefully.

It works by just renaming your current (ie, the files before you start randomroll) index, redirect and error.php to index, redirect and error.php.orig, and then RandomRoll will proceed to just softlink its own files there, as usual. Then when you disable RandomRoll it unlinks its files and renames your files before you started randomroll back to the defaults, and then happy days.

If their are any more problems, bugs or something i'm missing please reply here so i can fix them hopefully before the release. I am sad to say that there is no 'easy' way to add rolls yet, as im really busy as most of you are. I will try to do it as I know it would make life easier for some of you (especially barry with his nice custom rolls :grin:).

Edited by Foxtrot
Link to comment
Share on other sites

1.3 will be out soon fixing this problem hopefully.

It works by just renaming your current (ie, the files before you start randomroll) index, redirect and error.php to index, redirect and error.php.orig, and then RandomRoll will proceed to just softlink its own files there, as usual. Then when you disable RandomRoll it unlinks its files and renames your files before you started randomroll back to the defaults, and then happy days.

If their are any more problems, bugs or something i'm missing please reply here so i can fix them hopefully before the release. I am sad to say that there is no 'easy' way to add rolls yet, as im really busy as most of you are. I will try to do it as I know it would make life easier for some of you (especially barry with his nice custom rolls :grin:).

I ought to just send you mine to add. :grin:

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...