Jump to content

Urlsnarf Logging Viewer Script – Pineapple Mark Iv


Tru-Tek

Recommended Posts

This is a work in progress. Seems to work very well. Trying to figure out how to make the url's in the display a link. This adds another menu item in the navigation and it refreshes every 30 seconds. The link below will tell you how to get yours set up.

http://blog.tru-tek.com/index.php/2012/04/08/urlsnarf-logging-viewer-pineapple-mark-iv/

post-36345-0-53690700-1333848554_thumb.p

Link to comment
Share on other sites

Looks great TruTek! You're really fulfilling a need here

Thanks for contributing!

telot

Link to comment
Share on other sites

Thanks for this information. I thought I would try it just to see if I could get it to work, which I did.

There are two typos in in your instructions.

<?php require(‘navbar.php’); ?> should be <?php require(‘includes/navbar.php’); ?>

tail /www/pineapple/urlsnarf.log should be tail /www/pineapple/logs/urlsnarf.log

It took me a while to figure out so I thought I would post it to help the noobs like myself.

Link to comment
Share on other sites

Thanks for this information. I thought I would try it just to see if I could get it to work, which I did.

There are two typos in in your instructions.

<?php require(‘navbar.php’); ?> should be <?php require(‘includes/navbar.php’); ?>

tail /www/pineapple/urlsnarf.log should be tail /www/pineapple/logs/urlsnarf.log

It took me a while to figure out so I thought I would post it to help the noobs like myself.

I assume that the OP is on an older FW version.

I advise anyone to upgrade ;)

Best,

Sebkinne

Link to comment
Share on other sites

This is a work in progress. Seems to work very well. Trying to figure out how to make the url's in the display a link. This adds another menu item in the navigation and it refreshes every 30 seconds. The link below will tell you how to get yours set up.

http://blog.tru-tek.com/index.php/2012/04/08/urlsnarf-logging-viewer-pineapple-mark-iv/

You can just change the code in the "displaysnarflogs.php" file to this to hyperlink the urls..it's pretty convenient.

foreach($output as $outputline) {
                 $snarfed = explode(" ", $outputline);
                 echo ("$snarfed[0]");
                 echo ("&lt;a href=\"$snarfed[1]\"&gt; $snarfed[1]&lt;/a&gt;");
                 echo ("&lt;br&gt;&lt;br&gt;");
                          }

I know it's a small thing but it's the first thing I have been able to contribute so I'm glad I have been able to do something. Hak5 is great!

Link to comment
Share on other sites

You can just change the code in the "displaysnarflogs.php" file to this to hyperlink the urls..it's pretty convenient.

foreach($output as $outputline) {
                 $snarfed = explode(" ", $outputline);
                 echo ("$snarfed[0]");
                 echo ("&lt;a href=\"$snarfed[1]\"&gt; $snarfed[1]&lt;/a&gt;");
                 echo ("&lt;br&gt;&lt;br&gt;");
                          }

I know it's a small thing but it's the first thing I have been able to contribute so I'm glad I have been able to do something. Hak5 is great!

tru-tek, is there any good way to reduce the amount of clutter? (Ads and that sort of thing)

This is cool though, I noticed if someone is on facebook and is viewing pictures...you can see them with out side-jacking or anything. Kinda creeperish huh?

Link to comment
Share on other sites

Posted · Hidden by thestudent, April 18, 2012 - Duplicate
Hidden by thestudent, April 18, 2012 - Duplicate

You can just change the code in the "displaysnarflogs.php" file to this to hyperlink the urls..it's pretty convenient.

foreach($output as $outputline) {
                 $snarfed = explode(" ", $outputline);
                 echo ("$snarfed[0]");
                 echo ("&lt;a href=\"$snarfed[1]\"&gt; $snarfed[1]&lt;/a&gt;");
                 echo ("&lt;br&gt;&lt;br&gt;");
                          }

I know it's a small thing but it's the first thing I have been able to contribute so I'm glad I have been able to do something. Hak5 is great!

tru-tek, is there any good way to reduce the amount of clutter? (Ads and that sort of thing)

This is cool though, I noticed if someone is on facebook and is viewing pictures...you can see them with out side-jacking or anything. Kinda creeperish huh?

Link to comment

anyone know why I'm getting unexpected T variable error on line 15?

<html>

<head>

<title>snarf logs</title>

<META HTTP-EQUIV="REFRESH" CONTENT="30>

</head>

<body bgcolor="black" text="white" alink="green" vlink="green" link="

<?php require('includes/navbar.php'); ?>

<br>

<br>

<?php

$cmd = "/pineapple/geturlsnarf.sh";

exec("$cmd 2>&1', $output);

foreach($output as $outputline) {

echo ("$outputline\n");

echo ("<br><br>");

}

?>

</body>

</html>

Link to comment
Share on other sites

anyone know why I'm getting unexpected T variable error on line 15?

<html>

<head>

<title>snarf logs</title>

<META HTTP-EQUIV="REFRESH" CONTENT="30>

</head>

<body bgcolor="black" text="white" alink="green" vlink="green" link="

<?php require('includes/navbar.php'); ?>

<br>

<br>

<?php

$cmd = "/pineapple/geturlsnarf.sh";

exec("$cmd 2>&1', $output);

foreach($output as $outputline) {

echo ("$outputline\n");

echo ("<br><br>");

}

?>

</body>

</html>

maybe move the \n to the next echo?

Link to comment
Share on other sites

Thanks I will give that a shot today.

Sad pandas, still no go.

Parse error: syntax error, unexpected T_VARIABLE in /www/pineapple/displaysnarflogs.php on line 15

Thanks for the suggestions so far, I'm a PHP n00b so I appreciate the help.

Edited by genghis_tron
Link to comment
Share on other sites

Thanks I will give that a shot today.

Sad pandas, still no go.

Parse error: syntax error, unexpected T_VARIABLE in /www/pineapple/displaysnarflogs.php on line 15

Thanks for the suggestions so far, I'm a PHP n00b so I appreciate the help.

shouldn't that path be "/www/pineapple/urlsnarf.log" ?

Anyhow is there a way to append the displayed list as opposed to over-writing it?

Link to comment
Share on other sites

  • 3 weeks later...

Got the displaylogs thing in the menu - check

url snarfing does work - check

when i click the link in the pineapples ui, firefox goes to a page and just remains blank- Why?

my code is listed below

both files are in /www/pineapple/includes dir

displaysnarflogs

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;snarf logs&lt;/title&gt;
&lt;META HTTP-EQUIV=”REFRESH” CONTENT=”30?&gt;
&lt;/head&gt;
&lt;body bgcolor=”black” text=”white” alink=”green” vlink=”green” link=”green”&gt;
&lt;?php require(‘includes/navbar.php’); ?&gt;
&lt;br&gt;
&lt;br&gt;
&lt;?php

$cmd = “/www/pineapple/includes/geturlsnarf.sh”;
exec(“$cmd 2&gt;&amp;1?, $output);
foreach($output as $outputline) {
                 $snarfed = explode(" ", $outputline);
                 echo ("$snarfed[0]");
                 echo ("&lt;a href=\"$snarfed[1]\"&gt; $snarfed[1]&lt;/a&gt;");
                 echo ("&lt;br&gt;&lt;br&gt;");

?&gt;
&lt;/body&gt;
&lt;/html&gt;

geturlsnarf.sh

#!/bin/sh
tail /www/pineapple/logs/urlsnarf.log | awk {‘print $1 $0?} | sed ‘s,http://, http://,’

thanks again guys

Link to comment
Share on other sites

  • 2 weeks later...

Thanks to trutek for this and the thestudent who added the hyperlinks.

Here are my versions to copy - had lots of probs with copying from the web page.

Also added hyperlinks and opening new tab on links.... much more convenient!

Have fun

Spants

getsnarflogs.php

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;snarf logs&lt;/title&gt;
&lt;META HTTP-EQUIV="REFRESH" CONTENT="10"&gt;
&lt;/head&gt;
&lt;body bgcolor="black" text="white" alink="green" vlink="green" link="green"&gt;
&lt;?php require('includes/navbar.php'); ?&gt;
&lt;br&gt;
&lt;br&gt;
&lt;?php
$cmd = "/www/pineapple/geturlsnarf.sh";
exec("$cmd 2&gt;&amp;1",$output);

foreach($output as $outputline) {
                 $snarfed = explode(" ", $outputline);
                 echo ("$snarfed[0]");
                 echo ("&lt;a href=\"$snarfed[1]\" target=\"_blank\"&gt; $snarfed[1]&lt;/a&gt;");
                 echo ("&lt;br&gt;");
                          }

?&gt;
&lt;/body&gt;
&lt;/html&gt;

geturlsnarf.sh

#!/bin/sh
tail /www/pineapple/logs/urlsnarf.log | awk {'print $1 $7'} | sed 's,http://, http://,'

navbar.php

&lt;table border="0" width="100%" bgcolor="green"&gt;&lt;tr width="100%"&gt;
&lt;td&gt;
&lt;pre&gt;&lt;a href="/pineapple/index.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Status&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/config.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Configuration&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/advanced.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Advanced&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/usb.php"&gt;&lt;font color="black"&gt;&lt;b&gt;USB&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/jobs.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Jobs&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/3g.php"&gt;&lt;font color="black"&gt;&lt;b&gt;3G&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/ssh.php"&gt;&lt;font color="black"&gt;&lt;b&gt;SSH&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/scripts.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Scripts&lt;/b&gt;&lt;/font&gt;&lt;/a&gt; | &lt;a href="/pineapple/logs.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Logs&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/upgrade.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Upgrade&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/resources.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Resources&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/modules.php"&gt;&lt;font color="black"&gt;&lt;b&gt;Modules&lt;/b&gt;&lt;/a&gt; | &lt;a href="displaysnarflogs.php"&gt;&lt;font color="black"&gt;&lt;b&gt;URLSnarf Logs&lt;/b&gt;&lt;/a&gt; | &lt;a href="/pineapple/about.php"&gt;&lt;font color="black"&gt;&lt;b&gt;About&lt;/b&gt;&lt;/a&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

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