ThreadsDev FusionBB Greeting Cards FusionBBDev.com Measurection.com VertexHost NASCAR Racing MouseFunFacts.com Myrtle Beach Info UBB.Threads Modifications threadsdev.net
FusionBB

Trans-D Tropin
Use Coupon Code '1004' to Save $20 Off Your Initial Order of Trans-D Tropin®
V6 Threads Development >> Modifications

Ythan
User
****

Reged: 10/26/02
Posts: 27
Loc: Westminster, CO, USA
Finished-[6.4] Security Code to Prevent Automated Login Attempts
      07/05/04 11:11 PM Attachment (33 downloads)

Mod Name / Version: Security Code to Prevent Automated Login Attempts

Description: Recently there have been some brute force attempts to crack passwords on my BB. These attacks are automated, and work simply by trying every possible password (starting with common words and phrases). In order to protect our members from having their accounts compromised, I created a security code feature which prevents automated login attempts. I don't know how many other administrators have this same problem, but for those that do this modification is relatively easy to install and provides reasonably strong protection against automated login attempts.

The security code is a standard CAPTCHA (Completely Automated Public Turing Test to Tell Computers and Humans Apart). It generates an image of a 4 digit number which must be typed in correctly for the login to succeed. Here is an example of what it looks like on my BB.

Working Under: UBB.Threads 6.4

Mod Status: Finished

Any pre-requisites: PHP compiled with GD library support.

Author(s): Ythan

Date: 07/05/04

Credits: Thomas Jacob for the Captcha PHP Script.

Files Altered:
/login.php
/logout.php
/start_page.php
/ubbt.inc.php
/templates/login.tmpl

New Files:
/includes/captcha/captcha_func.php
/includes/captcha/captcha_pic.php

Database Altered: No, but if your server doesn't support sessions you will have to create a new table.

Info/Instructions: First, download and extract the new files you will need (they are attached to this post).

Captcha_func.php contains the configuration information for the script. If your server supports sessions, you should not need to alter any settings. Otherwise, you will need to configure the script to use mySQL. Instructions can be found on the script's web page.

After verifying the configuration settings are correct, make a new directory called 'captcha' in your /forums/includes directory, and upload the two new files to that location. (You can use another location if you like, but you will have to update the code manually.)

Next, open login.php and logout.php. In both files, find the line which reads:
Code:
require ("main.inc.php");


Directly beneath it, add the following:
Code:
  // BEGIN CAPTCHA MOD

header ("Expires: ".gmdate("D, d M Y H:i:s", time())." GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
if(!session_id()) session_start();
require ("$thispath/includes/captcha/captcha_func.php");
if ($_GET['new']) {
captcha_delete();
}
if (!captcha_avail()) {
captcha_create(false, 4, 0, 0, false);
}
// END CAPTCHA MOD


Open start_page.php. Find the line which reads:
Code:
$rememberme = get_input("rememberme","post");


Directly beneath this add:
Code:
$Code = get_input("code","post");


Find the line which reads:
Code:
$html -> do_login ($Cat,$Username,$Password,$rememberme);


Change it to:
Code:
$html -> do_login ($Cat,$Username,$Password,$rememberme,$Code);


Open ubbt.inc.php. Find the part which reads:
Code:
function do_login($Cat = "",$Username="",$Password="",$rememberme="") {


Change it to:
Code:
function do_login($Cat = "",$Username="",$Password="",$rememberme="",$Code="") {


Find the part that reads:
Code:
       if ( ($approved != "no") && ($approved != "yes") ) {

$this -> not_right($ubbt_lang['UNVERIFIED'],$Cat);
}


Directly beneath this, add:
Code:
       // BEGIN CAPTCHA MOD

if(!session_id()) session_start();
require ("$thispath/includes/captcha/captcha_func.php");
if (captcha_code() != $Code) {
$this -> not_right("The security code you entered is incorrect.",$Cat);
} else {
captcha_delete();
}
// END CAPTCHA MOD


Finally, open login.tmpl. Find the part which reads:
Code:
{$ubbt_lang['PASSWORD_TEXT']}<br>

<input type="password" name="Loginpass" class="formboxes">
<br>
<br>


Directly beneath this, add:
Code:
<!-- BEGIN CAPTCHA MOD //-->

Your security code is:<br>
<img src="{$config['phpurl']}/includes/captcha/captcha_pic.php" alt="Security Code" border="1">
<br>
Type in security code:<br>
<input type="text" name="code" value="" maxlength="4"><br>
<a href="$PHP_SELF?new=1">I can't read it!</a>
<br>
<br>
<!-- END CAPTCHA MOD //-->


That's all there is to it, the security code feature is now installed.

Hope some people find this useful!

-Y

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.


--------------------
The Shroomery
RateMyPipe.com

Post Extras Print Post   Remind Me!     Notify Moderator


Entire topic
Subject Posted by Posted on
* Finished-[6.4] Security Code to Prevent Automated Login Attempts Ythan 07/05/04 11:11 PM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts PaNTerSan   09/12/04 04:30 AM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts MattUK   03/27/05 09:52 PM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts Ythan   03/28/05 03:13 PM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts ScriptZ Man   03/28/05 08:55 PM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts Ythan   03/28/05 09:20 PM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts Astaran   03/29/05 08:57 AM
. * * Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts JoshPetAdministrator   07/06/04 12:01 AM

Extra information
0 registered and 20 anonymous users are browsing this forum.

Moderator:  JoshPet, Gardener, Ian_W, Anno 



Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Thread views: 4107

Rate this thread

Jump to
 
Hot Topic
No posts have caught fire as of yet.

Developers for Hire
Are you looking for custom modifications? Upgrades? Installs?
We have developers who can help!
View Our Services Page for information.

Login
Enter your username and password to login. If you do not have a username you can register one HERE.
username:
password:

Send Password
Remember Me

Online
121 guests have been online with in the last 90 minutes.

ThreadsDev.com
Trans-D Tropin

Current Threads
No current threads found...

Modifications
Recently Added:
· View Private Messages v0.9.3
· Stop Guests from seeing "Who's Online." [6.5.5]
· User List Display Limited by Post Count 1.0
· Paginate PMs 1.0
· Today and Yesterday

Most Downloaded:
· Inline Images 3.1
· Quote Username 1.0
· Games Arcade Deluxe v1.8
· UbbThreads and Photopost Total Integration Version 4
· Tool Tip Body Preview 3.0

Highest Rated:
· Mass Threads Move for 6.3
· Update Last Posts 1.0
· Update B_Parent User 1.0
· Integrated Index Page (IIP) 5.3.1
· IIP SideBarPal 1.1

Recent Stylesheets:
· Mix-Colors_2-0_3D for UBBT v6.3 - 6.5
· Mix-Colors_2-0 for UBBT v6.3 - 6.5
· Dark-Grey_3-0 for UBBT v6.3 - 6.5
· Green-Orange_1-0 for UBBT v6.3 - 6.5
· ebay_1-0 for UBBT v6.3 - 6.5

Recent Template Mods:
· Postlist modification - line separates new topics and replies
· I need some help with my postlist.tmpl file
· Edit, reply, and quote buttons mod for Facelift 6.5
· Google Add Sense add on for Threads 6.5
· Article templates for Thread 6.5

Shout Box

Short Stats
New Members:
4 Last 24 hours
20 Last 7 days
107 Last 31 days

Boards:
11676 Total topics
73324 Total replies

Totals:
5728 Members
85000 Posts

Max Online:
814 Total
(06/01/06 09:46 AM)


Web Hosting Provided by
VertexHost Web Hosting

Content ©2003-2006 ThreadsDev.NET
Powered By UBB.threads™ 6.5.5

 .: IIP 5.5 by David Lozier ©2003 :. 
Distributed by ThreadsDev.net

Visit Our Sister Sites!
JoshuaPettit.com and ThreadsAddons.com
Web Hosting Provided by
VertexHost Web Hosting

Generated in 0.534 seconds in which 0.507 seconds were spent on a total of 25 queries. Zlib compression enabled.


Whiplash Claims - Handmade Jewellery - Jewellery - Whiplash