Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 48
1 members and 47 guests
bescm9ttgamiiyr
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
» .:.

Go Back   Nukemods Forum > General > Site design

Reply
 
LinkBack Thread Tools Display Modes
User Database
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
User Database - 12-14-2004, 12:46 AM

Hello all,
I was wondering how i can extract the user database into a text file. This may be somewhat advanced, but i am running a HUB software on my server, and i want everyone to have a login and password. Thus, i want to link my php site with my hubsoftware. I figure the easiest way to do this would be to have the user database for all the people that register on my website also copied to a textfile. This way, i a can have a PERL script that will read the text file and insert the users and passwords into the HUB database. Any help OR different approaches to this would be very much appreciated. At the very least, where is the user database located? THANKS
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#2 (permalink))
Junior Member
 
Status: Offline
Posts: 10
Join Date: Dec 2004
Location: France
12-14-2004, 04:55 AM

You know you have only MD5 of password and not the password itself in nuke database ?

If you know it... then it's just a matter of an SQL query such as the following non tested code.

ExtractUsersPass.php
Code:
<?php
// Extract users/pass from phpNuke database
// Non tested code by Rica http://www.thehorde.be
require_once("mainfile.php");
global $db;
$sql="SELECT username,user_password FROM nuke_users";
$result=$db->sql_query($sql);
echo "<table border="1" cellspacing="3" cellpadding="3"><tr><th>Username</th><th>MD5 Password Hash</th></tr>";
while($row=$db->sql_fetchrow($result)){
 echo "<tr><td>".$row["username"]."</td><td>".$row["user_password"]."</td></tr>";
}

echo "<tr><td colspan="2">".$db->sql_numrows()." users in database."</td></tr>";
echo "</table>";
?>
  Send a message via MSN to Rica  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Senior Member
 
Status: Offline
Posts: 2,905
Join Date: Sep 2002
12-14-2004, 11:31 AM

Nice code Rica...I had a few errors with it though. Here's what I used once I got rid of the errors

Code:
<?php
// Extract users/pass from phpNuke database
// Non tested code by Rica http://www.thehorde.be
require_once("mainfile.php");
global $db;
$sql="SELECT username,user_password FROM nuke_users";
$result=$db->sql_query($sql);
echo "<table border=\"1\" cellspacing=\"3\" cellpadding=\"3\"><tr><th>Username</th><th>MD5 Password Hash</th></tr>";
while($row=$db->sql_fetchrow($result)){
 echo "<tr><td>".$row["username"]."</td><td>".$row["user_password"]."</td></tr>";
}

echo "<tr><td colspan=\"2\">".$db->sql_numrows()." users in database.";
echo "</td></tr></table>";
?>
qwicker, Like rica said, the passwords are MD5 hashes, which cannot be decrypted or unencrypted. So if you use the code above, it will list all your users and their MD5 hash password.
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#4 (permalink))
Junior Member
 
Status: Offline
Posts: 18
Join Date: Dec 2004
12-14-2004, 01:55 PM

Hmmm alright, the code looks good, but the MD5 hash password is a problem. I cannot use an encrypted password for my hub. I know this must be possible, though it is probobly quite tricky. Is there prehaps another block or form that i can use to register users without an encrypted password and the results would be stored in a text file. I know how to make a form like this in html, but not in php. Thanks
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#5 (permalink))
Junior Member
 
Status: Offline
Posts: 10
Join Date: Dec 2004
Location: France
12-14-2004, 02:40 PM

Quote:
Originally Posted by mikem
Nice code Rica...I had a few errors with it though. Here's what I used once I got rid of the errors
Thanks for fix , mikem.. bad habits from my phpEdit that escape double quote for me


Quote:
Originally Posted by qwicker
Hmmm alright, the code looks good, but the MD5 hash password is a problem. I cannot use an encrypted password for my hub. I know this must be possible, though it is probobly quite tricky. Is there prehaps another block or form that i can use to register users without an encrypted password and the results would be stored in a text file. I know how to make a form like this in html, but not in php. Thanks
There is some problem with this technic because user usually dont enter their name/pass each times , cookies are used (and they use the MD5 hashed password AFAIK [but I can be wrong]).

Let suppose you wanna force them to reenter their account info to log (you can force them by changing cookies domain/path in your phpBB preference or asking them nicely) , you could intercept "uncrypted password" from the login box.

Code:
#
#-------[OPEN]----------
#
modules/Your_Account/index.php

#
#-------[FIND]----------
#
function login($username, $user_password, $redirect, $mode, $f, $t, $random_num, $gfx_check) {

#
#-------[AFTER, ADD]----------
#
$userpasswordfile="mypasswordfile.txt";
if ($fp = fopen($userpasswordfile, "a+")) {
  fwrite($fp,"$username,$user_password\r\n");
  fclose($fp);
}

#
#-------[SAVE/UPLOAD]----------
#
it will create the file if needed and add Username and Uncrypted password in this file.

NB: It's not secure at all... I mean if someone got access to this file , he will get all your USERS PASSWORDS...

(If you use this method , change the name of the file... at least...)

( It doesnt check if user info is already in the file
It doesnt check if users accidentally make a typo on his password or login name
)
  Send a message via MSN to Rica  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
DATABASE, HOW DO I CONFIGURE MY DATABASE I SEE 3 OF THEM lhpnuke Site design 2 05-28-2006 06:08 PM
3 sites 1 user database? hman989 Nuke 7.x - General 1 02-24-2005 04:16 AM
phpbb database converter to Nukemods database palooka Open topics 3 06-15-2003 10:57 AM
User Activation "User in the database not found" F dfm123 Nuke 6.5 to 6.9 - Modules 0 05-05-2003 07:32 PM
new: Splatt Forums database into your phpBB Forums database Martin Purged Topics 2 03-01-2003 07:47 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31