Jump to content



Photo
- - - - -

IP trap Version 3 released


  • Please log in to reply
310 replies to this topic

#41   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 28 July 2009 - 05:46

Hi Travis,
The IP trap will have no impact upon any other aspect of your site, certainly not the log in or checkout systems.
The only thing that might cause this is if you used the XSS add ons, which have been known to block real customers from checking out, i did get a fair amount of messages about this, and it always turned out to be an XSS script which gave a similar message.
The logic of the trap is that a user has to call teh personal folder in their browser to activiate the trap, the chances of trapping an actual customer is remote.

Nic
Sometimes you're the dog and sometimes the lamp post

My Contributions

#42   mariemeh

mariemeh
  • Members
  • 136 posts
  • Real Name:Marie
  • Gender:Male

Posted 30 July 2009 - 16:26

Hi Travis,
The IP trap will have no impact upon any other aspect of your site, certainly not the log in or checkout systems.
The only thing that might cause this is if you used the XSS add ons, which have been known to block real customers from checking out, i did get a fair amount of messages about this, and it always turned out to be an XSS script which gave a similar message.
The logic of the trap is that a user has to call teh personal folder in their browser to activiate the trap, the chances of trapping an actual customer is remote.

Nic



Hi Nic,

First, I'd like to say thanks for all the help you provide, not just for this mod. I come across your name almost everytime I'm stuck and search this forum. So thanks again...

As for your statement above, and what I've been reading on this thread so far... I thought I might share my own experience with this mod so far and see if it can help you or it can help me.

For our own IP number not getting banned, I've found that somehow as long as the Whitelist file is uploaded to the server, the trap knows it's us and won't ban even if our own IP number isn't listed in the Whitelist.txt file. I don't know why that is as I'm not good at coding and don't know enough to offer an opinion but my observation so far is sound. I've tried it many different ways and the trap works but not on our own IP. If I remove the Whitelist.txt file it will work on my IP too but not if I leave it.

As for the trap having no impact upon any other aspect of the site, log in or checkout systems... in my case, that is exactly what is happening, it has an impact.

I use Paypal IPN... and the customer is able to checkout, go to the Paypal site for the payment... gets redirected to my site when payment is completed but somehow, the trap prevents the message to get through that the payment was received. If you are familiar with teh workings of Paypal IPN, eventough the checkout_success.php page loads and the message that the order was completed successfully appears, the status on the order remains Preparing Paypal_IPN

As soon as I remove the code from application_top.php calling to the secret.php page, everything goes back to normal.

I've been trying to figure this out for quite a while but can't seem to figure out what it could be. I noticed that when I get redirected from Paypal back to my site to the checkout_success.php page, there is some kind of delay and the page flashes a bit as if trying to load something and redirecting to something else... pretty much like a fake index page would do... you'd see an hesitation in the loading of the page. That's what I get.

My apologies if this doesn't sound really knowledgeable... but I'm hoping it might give you some ideas and maybe help find a solution to my problem.

Thanks

#43   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 30 July 2009 - 16:39

Hello Maria,
I appreciate you taking the time to put in this effort and post your findings, i find them informative and interesting. i have to admit i did not do as much debugging as i now apparently should have.
Still unsure of the PayPal module though.
I will look into reworking this as soon as i have the time.
Thanks once again i really appreciate you input
Regards
Nic
Sometimes you're the dog and sometimes the lamp post

My Contributions

#44   webwork

webwork
  • Members
  • 31 posts
  • Real Name:Di Yan

Posted 14 August 2009 - 05:05

Hi,

Thank you for your great contribution.

I looked at the code. I think there is a problem. Correct me if there are some other potential issues with the change.

line#12
foreach( $IPlist as $Whiteip ) {
$test = strcmp($Whiteip,$ipw);
}
if ($test > 0){

replace with:
$test = 1;
foreach( $IPlist as $Whiteip ) {
$test = strcmp($Whiteip,$ipw);
if ($test === 0)
break;
}
if ($test === 0){


Thank,

#45   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 16 August 2009 - 21:11

Guys,
I have recoded the IP trap, before i release it can you please give it a try out to make sure that it does actually work now!
Click me to test it, you should be banned.
Regards
Nic
Sometimes you're the dog and sometimes the lamp post

My Contributions

#46 ONLINE   altoid

altoid
  • Community Sponsor
  • 1,041 posts
  • Real Name:Steve
  • Gender:Male
  • Location:Hollidaysburg, Pennsylvania

Posted 17 August 2009 - 00:18

Guys,
I have recoded the IP trap, before i release it can you please give it a try out to make sure that it does actually work now!
Click me to test it, you should be banned.
Regards
Nic


Nic...not banned. Went to here: http://www.development-server.net/j/

Looks like the index page.

For what it's worth I am aware my provider has a dynamic IP. Just tossing that out here.

Thanks

SK
I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.
I remember what it was like when I first started with osC. It can be overwhelming.
However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.
There are several good pros here on osCommerce. Look around, you'll figure out who they are.

#47   alba

alba
  • Members
  • 107 posts
  • Real Name:alba

Posted 17 August 2009 - 05:16

Ive tested it Nic and i wasnt banned either, and im on a static IP

#48   Coopco

Coopco
  • Members
  • 9,557 posts
  • Real Name:Leslie Cooper
  • Gender:Male
  • Location:Sea Lake, Victoria, Australia

Posted 17 August 2009 - 08:08

Sorry Nic, still not banned.


The Coopco Underwear Shop



If you live to be 100 years of age, that means you have lived for 36,525 days. Don't waste another, there aren't many left.

#49   newtest

newtest
  • Members
  • 224 posts
  • Real Name:no its not

Posted 18 August 2009 - 12:05

Not banned here.

#50   drm1963

drm1963
  • Members
  • 6 posts
  • Real Name:Dewey

Posted 18 August 2009 - 16:15

not banned here either and I tried every browser I have plus I tried the different PC's I have to see if it could be something with the versions of the browsers or the Operating system.

Every time I was not banned and was always able to return back to the web page

Edited by drm1963, 18 August 2009 - 16:16.


#51   dreammachine

dreammachine
  • Members
  • 7 posts
  • Real Name:Peter
  • Gender:Male
  • Location:europe

Posted 07 September 2009 - 21:40

Hi i installed version 3.1. everything works fine, besides one thing:

When i ad my IP adress on top of the IP_Trapped.txt list, my site visit is blocking my IP ( thats ok )

When i ad my IP adress on the second place of the IP_Trapped.txt, my site is not blocking my ip

Am i doing something wrong.

Thanks

#52   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 07 September 2009 - 21:46

Hi IT appears the version is more BETA than i had expected, I am rewriting it when time allows.
The next release will i hope be free of problems!
It will also address the PayPal issue some are having with it, for now please use last version 2.
I will release the V3 when i am confident it works for all.
Regards
Nic
Sometimes you're the dog and sometimes the lamp post

My Contributions

#53   dreammachine

dreammachine
  • Members
  • 7 posts
  • Real Name:Peter
  • Gender:Male
  • Location:europe

Posted 07 September 2009 - 21:50

Hi IT appears the version is more BETA than i had expected, I am rewriting it when time allows.
The next release will i hope be free of problems!
It will also address the PayPal issue some are having with it, for now please use last version 2.
I will release the V3 when i am confident it works for all.
Regards
Nic


Hi Nic,

Thanks for so far and keep up the good innitiative.

I did install also version 2, has the same issue as mentioned in my previous question.

Fist IP line is blocked, second and other places below none blocking

#54   SteveDallas

SteveDallas
  • Members
  • 725 posts
  • Real Name:Glen
  • Gender:Male
  • Location:Alabama, US

Posted 13 September 2009 - 18:19

Nic,
I have been looking at installing this contribution and found some instances where the installation instructions in v3.1 don't match the code. I just found this thread and see that you are now advising people to go back to v2.x until you release an update, so I won't worry about it and install the previous version.

I can shed a little light on the PayPal IPN issue, if you haven't already resolved it, as I have used it for years and know quite a bit about how it works. Problems with updating status are caused by the inability of PayPal to reach the IPN handler, which is usually installed at /catalog/ext/modules/payment/paypal_ipn.php.

I would be happy to assist in testing if you need another tester before you release the next version. Just drop me a PM.

--Glen

#55   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 13 September 2009 - 18:57

Hi Steve (Glen)
Thats very kind of you, i did think it was fine as when i wrote and tested it worked fine for me on my PC but obviously not for everyone which makes it useless.
I know the PayPal problem and i have rectified this in the new release (i hope) however i will be glad to have your help and assistance.
I will PM you when i feel i am ready to test again (im upto my eyes with customers presently)
Regards
Nic

Edited by FIMBLE, 13 September 2009 - 18:57.

Sometimes you're the dog and sometimes the lamp post

My Contributions

#56   Evolved

Evolved
  • Members
  • 5 posts
  • Real Name:Do I have to

Posted 09 October 2009 - 10:00

Hello Fimble,

in personal/index.php:

foreach( $IPlist as $Whiteip ) 
{
$test = strcmp($Whiteip,$ipw);
}
if ($test > 0){

Should be something like:

$found=false;
foreach( $IPlist as $Whiteip ) 
{
  if (strcmp($Whiteip,$ipw)==0)
  {
    $found=true;
  }
}

if ($found)
{		

Very nice contrib, thank you.
Regards
Evolved

#57   Evolved

Evolved
  • Members
  • 5 posts
  • Real Name:Do I have to

Posted 15 October 2009 - 10:07

I've been asked to elaborate...

The contrib is a good starting point to implement a "honey pot".

As for the original code:
foreach( $IPlist as $Whiteip ) 
{
 $test = strcmp($Whiteip,$ipw);
}
if ($test > 0){

The original code above tries to compare all entries in the "white list" with the ip of the current user.
If a user is found he/she gets redirected to the default page, if not the trap gets triggered.
Problem is that the "strcmp" function isn't used correctly.

php strcmp function

Also the loop has no effect.
With the code as is $test only returns the result of strcmp with the last entry in the list.

Personally I would also remove or comment out the entry in application_top which otherwise runs through the list of ips everytime a page is loaded, making the site slower. If you remove the entry users don't get banned but you should get an email that someone ran into the trap. If this happens (a lot) you can uncomment and use the blocking feature again.

Hints: try out all changes, make sure you get an email if trap is triggered, reset your router if you need another ip to test with, make sure the robots.txt is at the right location.

$found=false;
foreach( $IPlist as $Whiteip ) 
{  
  if (strcmp($Whiteip,$ipw)==0)  
  {    
   $found=true;
   break;  
  }
}

if ($found){   

you can also use the keyword "break" to make the loop a bit faster but this is only cosmetics.

Hope that helps

Regards
Evolved

#58   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 15 October 2009 - 10:51

I've been asked to elaborate...

The contrib is a good starting point to implement a "honey pot".

As for the original code:

foreach( $IPlist as $Whiteip ) 
{
$test = strcmp($Whiteip,$ipw);
}
if ($test > 0){

The original code above tries to compare all entries in the "white list" with the ip of the current user.
If a user is found he/she gets redirected to the default page, if not the trap gets triggered.
Problem is that the "strcmp" function isn't used correctly.

php strcmp function

Also the loop has no effect.
With the code as is $test only returns the result of strcmp with the last entry in the list.

Personally I would also remove or comment out the entry in application_top which otherwise runs through the list of ips everytime a page is loaded, making the site slower. If you remove the entry users don't get banned but you should get an email that someone ran into the trap. If this happens (a lot) you can uncomment and use the blocking feature again.

Hints: try out all changes, make sure you get an email if trap is triggered, reset your router if you need another ip to test with, make sure the robots.txt is at the right location.

$found=false;
foreach( $IPlist as $Whiteip ) 
{  
  if (strcmp($Whiteip,$ipw)==0)  
  {    
   $found=true;
   break;  
  }
}

if ($found){   

you can also use the keyword "break" to make the loop a bit faster but this is only cosmetics.

Hope that helps

Regards
Evolved


Hi Evolved,
Thanks for the heads up, i am still developing a better solution at present with a few members testing for me, results are good at present. As always paid work comed first
I will post a message when it is ready
Regards
Nic
Sometimes you're the dog and sometimes the lamp post

My Contributions

#59   graeme john

graeme john
  • Members
  • 44 posts
  • Real Name:graeme belle

Posted 18 October 2009 - 19:51

As neat as this add-on seems, it will not work for me. I have tried all versions. I see that Australian sites are high on the "doesn't work list".

I noticed that personal/index.php uses fopen(), this could be the reason it refuses to work for me as my hosting company, along with many others, have globally disabled fopen() citing "Security issues affecting some websites".

graeme

#60   FIMBLE

FIMBLE
  • Members
  • 6,604 posts
  • Real Name:Nic
  • Gender:Male

Posted 19 October 2009 - 10:35

As neat as this add-on seems, it will not work for me. I have tried all versions. I see that Australian sites are high on the "doesn't work list".

I noticed that personal/index.php uses fopen(), this could be the reason it refuses to work for me as my hosting company, along with many others, have globally disabled fopen() citing "Security issues affecting some websites".

graeme


Yes i have had issues with fopen being disabled, you can use a php ini to get it working,
Create a text file add this line to it
allow_url_fopen = On;
save it as php.ini you will need to add it to all folders where you want it to work.
I was testing it with coopco, but have been busy with other work, i will give it some attention very soon
Nic
Sometimes you're the dog and sometimes the lamp post

My Contributions