Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 10-14-2003, 01:57 AM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need to find the security leak! Hack request concept inside.

Would it be possible to lock an account to an IP? For example, each user has an "IP Pool" that is allowed to access their account. For example, if I tried to login from a friend's house using my l/p, it would deny the access. However, from a legit IP, I could add my friend's IP to the IP Pool, thus allowing me access from his home.

Unfortunately, I've had to resort to such drastic ideas/measures to try to find the leak in my moderating team. Plus, I think it could help deter future issues.

Is this possible? Is anyone willing to undertake this task? There has to be a few security nuts out there who would get use out of this as well.
Reply With Quote
  #2  
Old 10-14-2003, 03:24 AM
JulianD's Avatar
JulianD JulianD is offline
 
Join Date: Jan 2002
Posts: 455
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That would require some sort of hack. Though it's a very neat idea for boards with a very high concept of security.
Reply With Quote
  #3  
Old 10-14-2003, 07:21 AM
Zzed's Avatar
Zzed Zzed is offline
 
Join Date: Feb 2002
Location: Glendale, CA, USA
Posts: 463
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A few of my moderators had gotten their passwords compromised and the person who did it broadcasted the contents of our moderator forum on other boards.

I incorporated a few additional security levels on top of the existing ones, and one of them was this particular "trusted host" hack for accessing the private forums.

Unfortunately for personal reasons I have not published this hack.
Reply With Quote
  #4  
Old 10-14-2003, 08:38 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here you go:

1- First create a new user profile field in your admincp, make it admin viewable/editable only, note its ID.

2- Create a new template (in all template sets) with this name: "error_unallowedip". Its content is:
"Your IP is not in the allowed IP pool for this user!"

edit functions.php, find:

PHP Code:
global $enablebanning,$banip,$webmasteremail,$session
Replace it as:
PHP Code:
global $enablebanning,$banip,$webmasteremail,$session,$bbuserinfo
find:
PHP Code:
    $addresses=explode(" "preg_replace("/[[:space:]]+/"" "$banip) );
    while (list(
$key,$val)=each($addresses)) {
      if (
strstr(" ".$ipaddress," ".trim($val))!="") {
        eval(
"standarderror(\"".gettemplate("error_banip")."\");");
      }
    }
  } 
AFTER THAT add:
PHP Code:
$banip2 trim($bbuserinfo['fieldX']);
    if (
$banip2 and $bbuserinfo['userid']>0)
    {
        
$ipaddress=getenv("REMOTE_ADDR");
        
$addresses2=explode(" "preg_replace("/[[:space:]]+/"" "$banip2) );
            while (list(
$key,$val)=each($addresses2)) 
            {
            if (
trim($val) AND substr($ipaddress,0,strlen(trim($val)))==trim($val)) {$IPallowed=1;}
            }
        if (
$IPallowed==0) {eval("standarderror(\"".gettemplate("error_unallowedip")."\");");}
    } 
(Replace X with your userprofilefield ID!)

Now you can enter allowed IPs for any member to the userprofile field in their edit user page in your admin cp. Seperate IPs with space and you can use partial IP's too. If you enter IPs to this field for a user, user will be disallowed access if his IP does not match to any IPs in that pool. If you leave that field blank or if user is guest, he won't be affected by this hack.

Enjoy.
Reply With Quote
  #5  
Old 10-14-2003, 11:23 AM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician, thank you! I appreciate your work, I'll get to adding this right away.
Reply With Quote
  #6  
Old 10-14-2003, 12:15 PM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quick question, are IP's separated by a comma or space? Do I use * for a wildcard, or just leave it empty? (ie. "205.245.74.*" or "205.245.74." )

I've implemented it, and it works great. Before I start adding IP's permanently, I just want to be sure.
Reply With Quote
  #7  
Old 10-14-2003, 12:22 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works just like default IP ban section in vb settings. So seperate by space and use blank for wildcard.

Eg.
128.0.0.1
128.0.0.
128.0.
128.

etc.
Reply With Quote
  #8  
Old 10-14-2003, 12:39 PM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent, thank you again. It works flawlessly.
Reply With Quote
  #9  
Old 10-14-2003, 06:23 PM
magnus's Avatar
magnus magnus is offline
 
Join Date: Apr 2002
Location: Miami, FL
Posts: 1,107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician, a good point was raised today. Would this be easily implemented to a single forumid (or even forum category) rather than the whole board?

Personally, I think denying access completely is the best bet. But some of my more trusted mods have expressed a desire to lock only the Admin section as opposed to everything for convenience sake.
Reply With Quote
  #10  
Old 10-14-2003, 08:16 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah that can be done but I'd say stick with this version. If you remove the hack from the entire board and apply to certain sections that you either need to hack many sections (thread view, print view, forum display, mod cp, admin cp, mod commands ie postings.php etc) or miss a few sections that are not covered by the hack which would defy the purpose of the hack.
Reply With Quote
Reply

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:44 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06908 seconds
  • Memory Usage 2,264KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete