urlsnarf Logging Viewer – Pineapple Mark IV
The Mark IV does not have a way to view logs unless you are in the console. These scripts will resolve that and will tail the log and display it in the webui.
1. SSH into your pineapple and do the following
cd /www/pineapple
vi displaysnarflogs.php
paste the following code into the file and save it. You can change the refresh rate as high or as low as you want to. Default it is 30.
<html>
<head>
<title>snarf logs</title>
<META HTTP-EQUIV=”REFRESH” CONTENT=”30″>
</head>
<body bgcolor=”black” text=”white” alink=”green” vlink=”green” link=”green”>
<?php require(‘navbar.php’); ?>
<br>
<br>
<?php
$cmd = “/www/pineapple/geturlsnarf.sh”;
exec(“$cmd 2>&1″, $output);
foreach($output as $outputline) {
echo (“$outputline\n”);
echo (“<br><br>”);
}
?>
</body>
</html>
2. Once you save this create the following.
vi geturlsnarf.sh
Paste the following code in the file
#!/bin/sh
tail /www/pineapple/urlsnarf.log | awk {‘print $1 $8′} | sed ‘s,http://, http://,’
3. Open the code for the navbar.php.
vi navbar.php
add the code below for another menu item. I added mine before the about menu.
| <a href=”displaysnarflogs.php”><font color=”black”><b>Urlsnarflogs</b></a> |
4. make geturlsnarf.sh executable by issuing the following command.
chmod +x geturlsnarf.sh
Once done it should be available on your menu at the top of your webui.








