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

Pages: 1
Ythan
User
****

Reged: 10/26/02
Posts: 27
Loc: Westminster, CO, USA
Finished-[6.4] Security Code to Prevent Automated Login Attempts
      #116399 - 07/05/04 11:11 PM Attachment (32 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  
JoshPetAdministrator
The artist formerly known as Mr. Bug
****

Reged: 11/29/01
Posts: 11414
Loc: Charlotte, NC
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: Ythan]
      #116402 - 07/06/04 12:01 AM

Good work!
Thanks!

--------------------
Josh - Joshua PettitWebsite - For Hire Coding work and Modifications

Feel Better, Look younger - www.BuyTransD.com
Use Coupon Code 1004 to Save $20 Off Your Initial Order of Trans-D Tropin


Post Extras: Print Post   Remind Me!   Notify Moderator  
PaNTerSan
Journeyman
*****

Reged: 03/19/04
Posts: 127
Loc: EU, Slovenia
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: Ythan]
      #119788 - 09/12/04 04:30 AM

You want more?
Image verification

--------------------
Kind regards,
PaNTerSan


Post Extras: Print Post   Remind Me!   Notify Moderator  
MattUK
Power User


Reged: 01/12/03
Posts: 95
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: PaNTerSan]
      #126676 - 03/27/05 09:52 PM

Does this work on 6.5 ?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Ythan
User
****

Reged: 10/26/02
Posts: 27
Loc: Westminster, CO, USA
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: MattUK]
      #126693 - 03/28/05 03:13 PM Attachment (24 downloads)

It should work fine in 6.5.x with small changes, but if you're thinking of using this mod you should know that I've updated it a bit. The biggest change is that now it only asks for a security code after 2 failed login attempts in a row. I also fixed some browser-specific bugs so I recommend you use this new version instead of the one above. Please download captchamod.zip attached to the first post in this thread, but then follow the instructions attached to this reply. Let me know if you have any problems.

-Y

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
ScriptZ Man
User


Reged: 01/03/05
Posts: 41
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: Ythan]
      #126696 - 03/28/05 08:55 PM

This new captcha.txt makes mention of a ubbt_captcha.tmpl file. Where is it?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Ythan
User
****

Reged: 10/26/02
Posts: 27
Loc: Westminster, CO, USA
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: ScriptZ Man]
      #126697 - 03/28/05 09:20 PM

The contents of that file is at the bottom of the updated instructions.

Peace,

-Y

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Astaran
Addict
****

Reged: 12/21/00
Posts: 1552
Loc: Germany
Re: Finished-[6.4] Security Code to Prevent Automated Login Attempts [Re: Ythan]
      #126720 - 03/29/05 08:57 AM

Thx for the update!

--------------------
Running a community? -> Keep informed and take it to the next level


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



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

Moderator:  JoshPet, Gardener, Ian_W, Anno 

Print Topic

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

Rating:
Topic views: 3523

Rate this topic

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
11 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:
7 Last 24 hours
29 Last 7 days
77 Last 31 days

Boards:
11675 Total topics
73324 Total replies

Totals:
4355 Members
84999 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.242 seconds in which 0.217 seconds were spent on a total of 26 queries. Zlib compression enabled.


Renegade Motorhomes - Credit Card Consolidation - Credit Counseling - Credit Consolidation