10 Replies - 2303 Views - Last Post: 18 July 2012 - 08:11 AM

#1 lyraa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-May 12

Honeypot

Posted 06 May 2012 - 10:18 PM

Can anyone help me in figuring out how to run the "http:bl" API in my code..I've done the coding for my website in HTML and ASP but I wanna interface this honeypot tool, the problem arises when I embed this code in my webpage and run. As I'm working on a Windows machine m using WampServer as my localhost but somehow when I run this code, a parse error comes. Can anyone tell me where does the problem lie ??
And is there some main function in the API ??


Is This A Good Question/Topic? 0
  • +

Replies To: Honeypot

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9286
  • View blog
  • Posts: 34,806
  • Joined: 12-June 08

Re: Honeypot

Posted 06 May 2012 - 10:23 PM

You are not clear on what the problem is, what parse error, what the message says, or where it shows up... additionally it just checked - http:bl has a pretty solid support forum for their product - have you tried pinging them on the setup? I mean they should be the subject matter experts and what not.
Was This Post Helpful? 0
  • +
  • -

#3 lyraa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-May 12

Re: Honeypot

Posted 06 May 2012 - 10:33 PM

View Postmodi123_1, on 06 May 2012 - 10:23 PM, said:

You are not clear on what the problem is, what parse error, what the message says, or where it shows up... additionally it just checked - http:bl has a pretty solid support forum for their product - have you tried pinging them on the setup? I mean they should be the subject matter experts and what not.


I run it from the localhost and it just states that parse error on line 61 or so on and also that '<' missing; but as far as I've read the entire code it doesn't have syntax errors.

And you're right about me not being clear where the real problem lies...but due to this m unable to move ahead.
And I just wanted to ask you one more thing, I've to integrate this API on my server website page only right..

I'm actually working on this project and this is my first time in both Network Security as well as honeypots and m personally very confused...
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9286
  • View blog
  • Posts: 34,806
  • Joined: 12-June 08

Re: Honeypot

Posted 06 May 2012 - 10:36 PM

You still are not clear... but let's take small steps..

Quote

I run it from the localhost and it just states that parse error on line 61 or so on and also that '<' missing; but as far as I've read the entire code it doesn't have syntax errors.

What file? What *IS* line 61 (heck what about just seeing lines 51-71?)?
Was This Post Helpful? 0
  • +
  • -

#5 lyraa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-May 12

Re: Honeypot

Posted 06 May 2012 - 10:46 PM

View Postmodi123_1, on 06 May 2012 - 10:36 PM, said:

You still are not clear... but let's take small steps..

Quote

I run it from the localhost and it just states that parse error on line 61 or so on and also that '<' missing; but as far as I've read the entire code it doesn't have syntax errors.

What file? What *IS* line 61 (heck what about just seeing lines 51-71?)?


Well line 61 is nothing but a blank line...and below it is the html code for the page...
Guess m bugging you... :-/
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9286
  • View blog
  • Posts: 34,806
  • Joined: 12-June 08

Re: Honeypot

Posted 06 May 2012 - 10:51 PM

Wait.. you start code at line 61? It's telling you that a < is missing.. it's usually good to find the lines around where it is telling you and find the missing character.
Was This Post Helpful? 0
  • +
  • -

#7 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5354
  • View blog
  • Posts: 27,313
  • Joined: 10-May 07

Re: Honeypot

Posted 06 May 2012 - 11:23 PM

View Postlyraa, on 07 May 2012 - 01:33 AM, said:

And you're right about me not being clear where the real problem lies...but due to this m unable to move ahead.
And I just wanted to ask you one more thing, I've to integrate this API on my server website page only right..

It would be a lot easier for us to help you if we could see the source code. Otherwise, all we can do is re-explain what the error message says.

My assumption would be that line 60 doesn't end correctly, a missing bracket, a missing quote, something isn't closed. Then html starts on line 61.
Was This Post Helpful? 0
  • +
  • -

#8 lyraa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-May 12

Re: Honeypot

Posted 07 May 2012 - 11:27 PM

<%@language="vbscript"%>
<html>
<script language = "javascript" type="text/javascript">
function Set_Cookie( 'notabot',value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = notabot+ "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}
</script>

<body>
<?php
// your http:BL key
$apikey = 'xjhocqgmjfnv';
 
// IP to test : your visitor's
$ip = $_SERVER['REMOTE_ADDR'];
 
// build the lookup DNS query
// Example : for '127.9.1.2' you should query 'abcdefghijkl.2.1.9.127.dnsbl.httpbl.org'
$lookup = $apikey . '.' . implode('.', array_reverse(explode ('.', $ip ))) . '.dnsbl.httpbl.org';
 
// check query response
$result = explode( '.', gethostbyname($lookup));
 
if ($result[0] == 127) {
    // query successful !
    $activity = $result[1];
    $threat = $result[2];
    $type = $result[3];
   
    if ($type & 0) $typemeaning .= 'Search Engine, ';
    if ($type & 1) $typemeaning .= 'Suspicious, ';
    if ($type & 2) $typemeaning .= 'Harvester, ';
    if ($type & 4) $typemeaning .= 'Comment Spammer, ';
    $typemeaning = trim($typemeaning,', ');
 
    echo "IP seems to belong to a $typemeaning ($type) with threat level $threat";
}

?>
<center>

<table height=800 width=600 background="images\pink8.png" align="center">
<tr><img src="images/logo4.jpg" width=950></tr>

<TR><td valign="top"><table><tr><td><A href="home1.asp"><img src=Images\home.jpg alt="Home Page" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
                               <td><A href="contact.html"><img src=Images\contac.jpg alt="Contact us" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
	          <td><A href="Feedback.html"><img src=Images\feedback.jpg alt="Feedback" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
	           <td><A href="Aboutus.html"><img src=Images\aboutus.gif alt="About us" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
	          <td><A href="Sitemap.html"><img src=Images\sitemap.jpg alt="Site Map" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
<td><A href="register.html"><img src=Images\register.jpg alt="Register" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
<td><A href="shop.asp"><img src=Images\shop1.jpg alt="Shop" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
<td><A href="login.html"><img src=Images\login.jpg alt="Login" height=50 width=50 border=0></A>&nbsp;&nbsp;</td>
<td><A href="logout.asp"><img src=Images\logout.bmp alt="Logout" height=50 width=50 border=0></A>
</td><td valign="right"><b><font color="CD1076" size=+1>Welcome <%=session("login_name")%></font></b></td></tr>
</table></td>
 </TR>

<tr>
<td valign="top">
 <TABLE border=0 width=600>
	<tr><td>
	<A href="skin.asp"><img src="buttons\skin.png" border=0></td><td>
	<A href="hair.asp"><img src="buttons\hair.png" border=0></A></td><td>
	<A href="lips.asp"><img src="buttons\lips.png" border=0></A></td><td>
	<A href="nails.asp"><img src="buttons\nails.png" border=0></A></td><td>
	<A href="eyes.asp"><img src="buttons\eyes.png" border=0></A></td><td>
	<A href="makeup.asp"><img src="buttons\makeup.png" border=0></A></td><TD>
	<A href="product.asp"><img src="buttons\products.png" border=0></A></td></tr>   </TABLE>
</td>
</tr>

<TR><TD><IMG src="images\1st.jpg" width=480 height=300 align=left><FONT color=B22222  size=+1><b>Body and beauty care</b></FONT>
               <FONT color=black face=comic sans MS size=+1>is of critical importance because it boosts self confidence, 
                 enhances presentability and promotes career prospects. For most of us the art of makeup is neccesary to hide blackheads and blemishes, 
                 while highlighting beauty spots and good features. Our site contains valuable tips for beauty conscious men and women to look and feel good. 
                 Our site also provides information on major categories of cosmetic and beauty products with emphasis on their proper use and an update 
                 on the latest products.TheBeautyAssets.com is designed to create awareness amoung people about common skin and hair problems and 
                 how to overcome them.</FONT>
	
               
	<FONT color=black face=comic sans MS size=+1>Look young! Feel young! Yes, if the face is the index of the mind then beauty too is more than skin deep. 
                A healthy individual who follows a proper diet, manages stress and is critical about skin cleansing habits is 
                bound to have a glowing complexion. And the net result is a luminous skin which defies age and the presures of a hectic lifestyle. 
                Our site gives you all the terrific tips to retain your charm and looks.Growing older is a natural process, but the rate at which ageing occurs, 
                 and the effect it has on our appearence and health, can be controlled. This site will help you to do that!</font><P></P>
                 <IMG alt="Diamond jewelry" hspace=5 src="images\3rd.jpg" align=right vspace=5 border=0 height=210>
                  <FONT color=black face=comic sans MS size=+1>
                  <P>On this site you will find valuable information on ageing and the methods for slowing down the ageing process.
                  It explains many procedures and options availaible, and what can be achieved. Each procedure is discussed in detail making it easier 
                  for you to choose the methods and products that will keep your skin looking fresh and young. </font></P>
                  <IMG alt="Silver jewelry" hspace=5 src="images\4th.jpg" align=left vspace=5 border=0 height=200>
                 <FONT color=black face=comic sans MS size=+1>
	The world of beauty is a mad, funny, seductive world. Mis guided in some ways, misleading in others, 
                  it's also a source of great pleasure to great many women. 
                   Good skin care-along with a healthy diet and exercise-is basic to beauty. 
                  so at least once, treat yourself to professional consolation and a facial, just to learn the ropes, 
                  along with some guidelines about best cosmetics and caring for your skin.
                   Our site also touches upon: different skin types, skin care, skin disorders and their solution, 
                 makeup and its step by step application, eye makeup, cause of hair loss, hair care and removing unwanted facial hair, 
                  nail and teeth problems and their care , homemade recipes and remedies for skin problems and much more...</font><P></P>
	</TD></TR>

</table>
</center>

<?php

if ($_COOKIE['notabot']) {
    ozh_httpbl_logme(false,    $_SERVER['REMOTE_ADDR']);
} else {
    ozh_httpbl_check();
}
function ozh_httpbl_check() {    
    // your http:BL key 
    $apikey = 'xjhocqgmjfnv';
    
    // IP to test
    $ip = $_SERVER['REMOTE_ADDR'];
    
    // build the lookup DNS query
    // Example : for '127.9.1.2' you should query 'abcdefghijkl.2.1.9.127.dnsbl.httpbl.org'
    $lookup = $apikey . '.' . implode('.', array_reverse(explode ('.', $ip ))) . '.dnsbl.httpbl.org';
    
    // check query response
    $result = explode( '.', gethostbyname($lookup));
    
    if ($result[0] == 127) {
        // query successful !
        $activity = $result[1];
        $threat = $result[2];
        $type = $result[3];
        
        if ($type & 0) $typemeaning .= 'Search Engine, ';
        if ($type & 1) $typemeaning .= 'Suspicious, ';
        if ($type & 2) $typemeaning .= 'Harvester, ';
        if ($type & 4) $typemeaning .= 'Comment Spammer, ';
        $typemeaning = trim($typemeaning,', ');
        
        // echo "$type : $typemeaning of level $threat ";
        
        // Now determine some blocking policy
        if (
        ($type >= 4 && $threat > 0) // Comment spammer with any threat level
            ||
        ($type < 4 && $threat > 20) // Other types, with threat level greater than 20
        ) {
            $block = true;
        }
        
        if ($block) {
            ozh_httpbl_logme($block,$ip,$type,$threat,$activity);
            ozh_httpbl_blockme();
            die();
        }
    
    }
}


function ozh_httpbl_logme($block = false, $ip='', $type='',$threat='',$activity='') {
    $log = fopen('./block.log','a');
    $stamp = date('Y-m-d :: H-i-s');
    
    // Some stuff you could log for further analysis
    $page = $_SERVER['REQUEST_URI'];
    $ua = $_SERVER["HTTP_USER_AGENT"];
        
    if ($block) {
        fputs($log,"$stamp :: BLOCKED $ip :: $type :: $threat :: $activity :: $page :: $ua\n");
    } else {
        fputs($log,"$stamp :: UNBLCKD $ip :: $page :: $ua\n");
    }
    fclose($log);
}


function ozh_httpbl_blockme() {
    header('HTTP/1.0 403 Forbidden');
    echo <<<HTML
    <script type="text/javascript">
    function setcookie( notabot, value, expires, path, domain, secure ) {
        // set time, it's in milliseconds
        var today = new Date();
        today.setTime( today.getTime() );
    
        if ( expires ) {
            expires = expires * 1000 * 60 * 60 * 24;
        }
        var expires_date = new Date( today.getTime() + (expires) );
    
        document.cookie = notabot + "=" +escape( value ) +
        ( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
        ( ( path ) ? ";path=" + path : "" ) + 
        ( ( domain ) ? ";domain=" + domain : "" ) +
        ( ( secure ) ? ";secure" : "" );
    }    
    function letmein() {
        setcookie('notabot','true',1,'/', '', '');
        location.reload(true);
    }
    </script>
    <h1>Forbidden</h1>
    <p>Sorry. You are using a suspicious IP.</p>
    <p>If you <strong>ARE NOT</strong> a bot of any kind, please <a href="javascript:letmein()">click here</a> to access the page. Sorry for this !</p>
    <p>Otherwise, please have fun with <a href="http://facebook.com">this page</a></p>
}
?>
</body>

</html>



This is the whole code for the home page which gives error...

This post has been edited by no2pencil: 07 May 2012 - 11:31 PM
Reason for edit:: Added code tags

Was This Post Helpful? 0
  • +
  • -

#9 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5354
  • View blog
  • Posts: 27,313
  • Joined: 10-May 07

Re: Honeypot

Posted 07 May 2012 - 11:33 PM

What is the file name?

The line number in question is the ending php line. After a quick look I don't see anything wrong with the code, so my assumption would be that the file is named .html, or your are running this on a site that doesn't support php.

I will continue to look into this.
Was This Post Helpful? 0
  • +
  • -

#10 lyraa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 06-May 12

Re: Honeypot

Posted 07 May 2012 - 11:41 PM

View Postno2pencil, on 07 May 2012 - 11:33 PM, said:

What is the file name?

The line number in question is the ending php line. After a quick look I don't see anything wrong with the code, so my assumption would be that the file is named .html, or your are running this on a site that doesn't support php.

I will continue to look into this.


The file name is home.php and m running it in wamp server...localhost
Was This Post Helpful? 0
  • +
  • -

#11 Bort  Icon User is offline

  • Ill-informed Mongoloid
  • member icon

Reputation: 409
  • View blog
  • Posts: 3,001
  • Joined: 18-September 06

Re: Honeypot

Posted 18 July 2012 - 08:11 AM

Check line 60...

?>. Surely this should be [il<?>[/il]?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1