Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

[PATCH] Blocking those pesky hackers

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 04-08-2008, 04:45 PM
 
mltriebe mltriebe is offline
 

Senior Member
  
Join Date: Mar 2006
Posts: 137
 

Default Re: [PATCH] Blocking those pesky hackers

Yeah, I finally got 1 blocked but that suprises me because there was almost always one of these attmpts going on when I would look at the users online.

Works great though i have yet to see one since adding the mod.

Thanks, Mike
__________________
X-Cart 4.3.1
Buy Together Module, AlteredCart
CDSEO Pro
One Page Checkout, AlteredCart
Smart Search, AlteredCart
On Sale, AlteredCart
Reply With Quote
  #12  
Old 04-08-2008, 06:30 PM
  DreamCatcher's Avatar 
DreamCatcher DreamCatcher is offline
 

Senior Member
  
Join Date: Mar 2004
Posts: 178
 

Default Re: [PATCH] Blocking those pesky hackers

It seems a bit of a waste of power to do all the blocking individually and not turn this into a shared blacklist. I am sure a lot of the people hitting one of us will end up hitting more of us from scanning. If shop owners opted into allowing their servers to report back to a central server the distributed list would be pretty awesome. Then again I know some people do not like the idea of someone else having control over who has access to their site...

Very cool mod though thanks for sharing.


-Todd
__________________
X-Cart 4.7.8 Pro
php 7.x
Reply With Quote
  #13  
Old 04-08-2008, 06:45 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: [PATCH] Blocking those pesky hackers

After XC SEO Pro is completed, I'm contemplating developing a security module, similar to NukeSentinel for PHP-Nuke (dunno if NukeSentinel is still in development, but it was popular years ago). Idea is to support central banlists, etc, and provide more protection against hackers
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #14  
Old 04-09-2008, 07:10 AM
  carlisleglass's Avatar 
carlisleglass carlisleglass is offline
 

eXpert
  
Join Date: Aug 2003
Location: Carlisle, UK
Posts: 316
 

Default Re: [PATCH] Blocking those pesky hackers

Jon does it again !!! Thank you for another great Mod !
__________________
Darren Kierman
Carlisle Glass (http://www.carlisleglass.co.uk/)
... running X-Cart Gold 4.4.5 [unix]
Reply With Quote
  #15  
Old 04-09-2008, 10:49 AM
 
Asiaplay Asiaplay is offline
 

X-Wizard
  
Join Date: Oct 2005
Posts: 1,242
 

Default Re: [PATCH] Blocking those pesky hackers

True - a great solution to hassles and security that is happening right now - thanks..
.
I also know your new SEO module will also go well... as it just makes sense, goes that extra step and answers SEO needs - cheers and all the best, Asiaplay
__________________
X-Cart Gold version 4.1.9
(plus built in X-Cart bugs!)
Reply With Quote
  #16  
Old 04-09-2008, 12:36 PM
 
Monarch1 Monarch1 is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 30
 

Default Re: [PATCH] Blocking those pesky hackers

Excellent mod!!! It works great. I'm so happy, I ban myself by entering hack attempts, just for the fun of it. Thank you helping me sleep better now knowing the site site is better protected.
__________________
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::
X-Cart Pro 4.1.8 (Linux) (4.1.10 upgrade pending)
Reply With Quote
  #17  
Old 04-12-2008, 08:14 PM
 
homeworldz homeworldz is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 68
 

Default Re: [PATCH] Blocking those pesky hackers

PATCH RESULTS
File admin/stop_list.php successfully patched
PATCH FAILED AT FILE: auth.php, see PATCH LOG for details.

PATCH LOG Patching file /homepages/28/d235556179/htdocs/xcart/admin/stop_list.php ...
Hunk #1 succeeded at 146.
done
Patching file /homepages/28/d235556179/htdocs/xcart/auth.php ...
Hunk #1 failed at 43.
1 out of 1 hunks ignored--saving rejects to /homepages/28/d235556179/htdocs/xcart/var/upgrade/auth.php.rej
done


Warning!
The following files could not be patched with automated upgrade system. This may be because these files were changed from their original state. Those files needs to be patched manually or restored from backup.
__________________
x-cart 4.1.9
Reply With Quote
  #18  
Old 04-12-2008, 11:31 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: [PATCH] Blocking those pesky hackers

your auth.php file has been modified to the point that the patch I provided can't alter it. you'd have to apply the patch manually
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
  #19  
Old 04-13-2008, 06:28 AM
 
homeworldz homeworldz is offline
 

Advanced Member
  
Join Date: Feb 2008
Posts: 68
 

Default Re: [PATCH] Blocking those pesky hackers

I thought it was something like that..

From looking at the patch file I wouldnt know how to break it down and where to put the bits of code in the page.

Quote:

Index: auth.php
================================================== =================
--- auth.php (revision 259)
+++ auth.php (working copy)
@@ -43,6 +43,30 @@

include_once $xcart_dir."/init.php";

+##
+## Added for security purposes!
+##
+$stop_user = false;
+$_qs = explode('&',$_SERVER['QUERY_STRING']);
+if($_qs) {
+ foreach($_qs AS $v) {
+ if(strpos($v, 'http://')!==false) {
+ if(!empty($active_modules["Stop_List"])) {
+ func_add_ip_to_slist($REMOTE_ADDR, 'H');
+ }
+ $stop_user = true;
+ }
+ }
+}
+if(!$stop_user && !empty($active_modules["Stop_List"])) {
+ if($stop_list = func_query("SELECT * FROM $sql_tbl[stop_list] WHERE ip LIKE '$REMOTE_ADDR' AND reason = 'H'")) {
+ $stop_user = true;
+ }
+}
+if($stop_user) {
+ die('<h2>You have been banned for illegal activity.</h2><br /><br />If you feel this is in error, please contact ' . $config['Company']['site_administrator']);
+}
+
$current_area="C";

x_load('files');
__________________
x-cart 4.1.9
Reply With Quote
  #20  
Old 04-13-2008, 10:42 AM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default Re: [PATCH] Blocking those pesky hackers

The way to manually apply a patch, is look for lines without the + or - in front, such as
Quote:
include_once $xcart_dir."/init.php";
and
Quote:
$current_area="C";

x_load('files');

That tells you where to start editing. Then notice that between those already existing lines, you need to add all lines with a + (and if there's ever a -, you remove that line).
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:32 PM.

   

 
X-Cart forums © 2001-2020