Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > Programming Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Block User Ip From Your (.htaccess)
Terminatoronly's Avatar
Terminatoronly
Join Date: Mar 2006
Posts: 313

 

Show Printable Version Email this Page Subscription
Terminatoronly Terminatoronly is offline 01-14-2007, 10:00 PM

Hi All,
well all of our forums have some bad members who want to do bad things in our forum so if you want to block him from cpanel he can access again so i thought of this thing blocking Member Ip From (htaccess) file.

What Does this do?
This Will Block The User IP Or Proxy If You Want From Viewing Your Site.


How It Works?
Make A New File Using Note Pad and put this code on it:
PHP Code:
<Limit GET HEAD POST>
order allow,deny
deny from 188.156.187
.***
deny from 188.155.187.***
allow from all
</LIMIT
This One Will Block The User Ip Who IS Using This IP:
PHP Code:
188.156.187.***
188.155.187.*** 
If You Want To Add More Ip's Just put it between:
PHP Code:
order allow,deny

allow from all 
After Adding This To Notepad Save it like this name:
Code:
htaccess.txt
then upload it using your ftp and name it to:
Code:
.htaccess
Also upload it in ASCII format.

Also You Can Add Domains To Block list .

Enjoy It
Reply With Quote
  #2  
Old 01-15-2007, 04:19 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks. First install!
Reply With Quote
  #3  
Old 01-15-2007, 04:35 PM
Terminatoronly's Avatar
Terminatoronly Terminatoronly is offline
 
Join Date: Mar 2006
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeah first install i hope you like the hack
Reply With Quote
  #4  
Old 01-15-2007, 08:41 PM
Forza Forza is offline
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this considered a hack nowadays? anyways i would also add the codes to protect the admincp folder and definitly the code to block the common shell extensions. very handy file
Reply With Quote
  #5  
Old 01-16-2007, 02:06 AM
StrifeX StrifeX is offline
 
Join Date: Dec 2006
Location: New York
Posts: 200
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First of all, I wouldn't consider this to do anything with vBulletin whatsoever, second of all, apparently this only works with cPanel or what?
Reply With Quote
  #6  
Old 01-16-2007, 04:29 AM
Terminatoronly's Avatar
Terminatoronly Terminatoronly is offline
 
Join Date: Mar 2006
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

first i would like to say thanks for your replies and i know its not a product or plugin to add to vbulletin but this one is much better than the hacks that i find for blocking ip and for StrifeX question well this one its not about cpanel its about ur .htaccess file with this file you can protect your forum like lets say you want to protect your forum (admincp) the index file you can protect it from this file and you can protect config file so you can be safe with this file and i would like to tell you all that i posted this one because most of us need this file so i thought its handy for you but if you dont i am happy for your replies
Reply With Quote
  #7  
Old 01-16-2007, 08:34 AM
The Finman's Avatar
The Finman The Finman is offline
 
Join Date: Jun 2006
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

.htaccess is for Apache.

While it is possible to install Apache on a Windows server...why?

Why wouldn't you just use Apache instead?

First, .htaccess files are very powerful tools, and they (along with .htpasswd) are also probably one of the most underrated server tools available to a web admin running Apache.

But I think using them falls outside of vBulletin modifications, simply because many vBulletin admins don't run Apache. And even though I personally dislike Windows ASP servers, there are plenty of admins that do like (or don't have a choice when it comes to) Windows servers. While it is possible to install Apache on top of Windows in order to make use of .htaccess...why?

I love using .htaccess files....as there are a bunch of other uses for .htaccess in addition to blocking IPs or password (.htpasswd) protecting folders.

For example, If you have a "troll" board that is directly linking to your site or board, and they are clicking through that link they and coming over and infesting your board with their nonsense...you can use an .htaccess file to send anyone clicking through that link to anywhere you want (it doesn't work if they copy and paste the link in their browser window instead of clicking through it, but most trolls are not that smart).

Many a time I have forwarded links posted to my board from trolls, to complety different web sites (and/or servers for that matter) that can contain malicious (or prank) scripts.

You really want to see the "troll fur fly"? Watch as other trolls click through that link and are sent to a real nasty web page, causing either harm or the appearance of harm to their computer.

Trust me,they are not too happy with the troll that posted that link which just screwed up their computer (remember they have been redirected to an entirely different web site and server).

Anyway, I've seen "troll' turn against "troll" as they start attacking and/or banning each other.

For example...

Quote:

Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_REFERER} ^http://www.troll_bulletin_board.com
RewriteRule /* http://www.malicious_website.org [R,L]
RewriteCond %{HTTP_REFERER} ^http://troll_bulletin_board.com
RewriteRule /* http://www.malicious_website.org [R,L]


If Troll "A" posts a direct link on www.Troll_Bulletin_Board.com to your board at www.My_Bulletin_Board.net and you put the above code in an .htaccess file in your root folder (just like .htpasswd you can put it in any folder you want to protect), when Troll "B" and "C" click on that link...they be sent directly to www.Malicious_Website.org instead.

Troll's "B" and "C" will not be happy with Troll ""A"" since he/she posted a link to a site that either screwed up their computer, or gave them a scare that something messed up their computer.

Here are some other great ways to use .htaccess

The problem is .htaccess only works on Apache, so Admins that aren't running Apache are basically screwed. While there are ways of accomplishing similar things with Windows...it's still a real hassle, and it leads back to...why?

Regardless, you can do some great stuff with .htaccess...but since not every vBulletin owner can use it, I'm not sure that this lends itself to a vBulletin hack.

Also for web admins that are running Apache and can use .htaccess, be careful...because .htaccess is powerful stuff. Banning IP ranges can knock out a whole (small) country or a part of a (large) country (state, city, Etc.) if you're not carful. Be sure you know what you are doing.
Reply With Quote
  #8  
Old 01-16-2007, 08:40 AM
The Finman's Avatar
The Finman The Finman is offline
 
Join Date: Jun 2006
Posts: 78
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I hope I didn't come off as criticizing, as that wasn't what I was trying to do. Just offering a different insight.

Cheers!
Reply With Quote
  #9  
Old 01-16-2007, 11:40 AM
Terminatoronly's Avatar
Terminatoronly Terminatoronly is offline
 
Join Date: Mar 2006
Posts: 313
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok The Finman thanks for your reply i think that this thread is not good maybe i will report it
Reply With Quote
  #10  
Old 01-16-2007, 04:41 PM
Forza Forza is offline
 
Join Date: Aug 2006
Location: The Netherlands
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well it can be handy for a lot of people who dont know .htaccess and what it can do. Since it is the easiest way to incease basic security I would keep it. I would however try to add more instructions to your post that can apply directly to a vbulletin forum (securing files/folders, .htpassword file, blocking certain files, blacklist referring domains). Additionally i would upload an example file that people can edit and then upload.
Reply With Quote
Reply


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 07:03 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.04591 seconds
  • Memory Usage 2,322KB
  • Queries Executed 24 (?)
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
  • (2)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete