phpBBHacks.com - IP search in phpmyadmin
Bad Boy Blog, an unofficial Diddy and Bad Boy fan blog
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Username:    Password:
Remember Me?    
   I Lost My Password!
Bookmark and Share
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> General phpBB 2 Support and Discussion
 See a User Guidelines violation? Please contact us.
Author Message

jimbean223
New User

Joined: 10 Sep 2009
Posts: 7

PostPosted: February 12th 2010, 1:53 pm    Post subject: IP search in phpmyadmin Reply with quote

Hi,

Could someone please kindly advise me how I can do searches using SQL queries for specific ips?

I've tried this...

SELECT * FROM phpbb_banlist WHERE ban_ip LIKE '%82.23.11.44%'

And it did not really help. even searching less numbers also did not help.

I think I might have an error in the line.


Thank you in advance
Back to top
View user's profile Send private message

Wicher
Experienced User

Joined: 23 Apr 2003
Posts: 443
Location: Netherlands or Holland, your choice..

PostPosted: February 12th 2010, 4:28 pm    Post subject: Reply with quote

ip's are not saved in the database like 82.23.11.44
They are saved with md5 and are saved like 537cd5fd
You should use the phpbb function decode_ip to get the real ip back from the database.
_________________
My little mods | Statistics Mod 4.x.x (revision of 2.1.5) | My hacks at phpbbhacks
Back to top
View user's profile Send private message Send e-mail Visit poster's website

jimbean223
New User

Joined: 10 Sep 2009
Posts: 7

PostPosted: February 12th 2010, 6:20 pm    Post subject: Reply with quote

Wicher wrote:
ip's are not saved in the database like 82.23.11.44
They are saved with md5 and are saved like 537cd5fd
You should use the phpbb function decode_ip to get the real ip back from the database.


How do I do that?

(sorry not really good with this)
Back to top
View user's profile Send private message

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.

PostPosted: February 12th 2010, 7:07 pm    Post subject: Reply with quote

Hey jimbean223,

Thanks for posting. I'm not sure what you are wanting to do exactly, but if you are trying to find if users (and what users) are using a given IP address, you might want to take a look at IP Search: http://www.phpbbhacks.com/download/1812

Thanks,

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator - Feedback? Questions? Please Contact Me!
User Guidelines - Featured phpBB - Featured Author - phpBBHacks.com Awards - Supported Sites - About Us
Author, Managing Online Forums - A Practical Guide to Community Management
phpBB 3 Tutorials: Add Hacks | Clear Your Cache | Fix Missing Images | phpBB 3 Permissions Guide
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

jimbean223
New User

Joined: 10 Sep 2009
Posts: 7

PostPosted: February 13th 2010, 8:44 am    Post subject: Reply with quote

Patrick wrote:
Hey jimbean223,

Thanks for posting. I'm not sure what you are wanting to do exactly, but if you are trying to find if users (and what users) are using a given IP address, you might want to take a look at IP Search: http://www.phpbbhacks.com/download/1812

Thanks,

Patrick


Hiya,

Well, I have a member saying he is banned.
I've looked everywhere his IP seems to be banned despite it not being in the IP ban list (i've checked email and username also)

I wanted to be able to go into the SQL data base and run an IP search.

Can this not be done like searching of email addresses can?
Back to top
View user's profile Send private message

Wicher
Experienced User

Joined: 23 Apr 2003
Posts: 443
Location: Netherlands or Holland, your choice..

PostPosted: February 13th 2010, 3:00 pm    Post subject: Reply with quote

Select and copy below code and save it as admin_searching_ip.php in your phpbb admin folder.
Then go to the Users section in your admin panel and click on Search banlist.
You will be able to view all content in the banlist table, including a decoded ip plus the coded one.
You will also be able to remove the ban from the banlist table from the new page.

Code:
<?php
/***************************************************************************
 *                                admin_searching_ip.php
 *                            -------------------
 *   begin                : Tuesday, Feb 13, 2010
 *   copyright            : Wicher
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

define('IN_PHPBB', 1);

if( !empty($setmodules) )
{
   $filename = basename(__FILE__);
   $module['Users']['Search banlist'] = $filename;
   return;
}


// Include required files, get $phpEx and check permissions
$phpbb_root_path = "./../";
require($phpbb_root_path . 'extension.inc');
require('./pagestart.' . $phpEx);


if ( !$userdata['session_logged_in'] )
{
   redirect(append_sid("login.$phpEx?redirect=searching_ip.$phpEx", true));
}
if ( !$userdata['user_level'] == ADMIN)
{
   redirect(append_sid("index.$phpEx", true));
}


if (isset($HTTP_GET_VARS['mode']) && htmlspecialchars($HTTP_GET_VARS['mode']) == 'delete')
{
   $sql = "DELETE FROM " . BANLIST_TABLE . " WHERE ban_id = " . intval($HTTP_GET_VARS['id']);
   if ( !$db->sql_query($sql) )
   {
      message_die(GENERAL_ERROR, 'Could not delete ban', '', __LINE__, __FILE__, $sql);
   }
}



echo '<h3>You are looking at the content of the banlist table</h3><br /><br />';
echo '<table border="2" bgcolor="#ffffff"><tr><td>ban_id</td><td>ban_userid</td><td>ban_ip</td><td>ban_email</td><td>&nbsp;</td></tr>';
// start
$sql = "SELECT * FROM " . BANLIST_TABLE;
if ( !($result = $db->sql_query($sql)) )
{
   message_die(GENERAL_ERROR, 'Could not ips', '', __LINE__, __FILE__, $sql);
}
   do
   {
      if (!empty($ips_row['ban_ip']))
      {
         $decoded_ip = decode_ip($ips_row['ban_ip']);
      }
      else {$decoded_ip = '';}
      echo '<tr><td>'.$ips_row['ban_id'].'&nbsp;</td><td>'.$ips_row['ban_userid'].'&nbsp;</td><td>MD5: '.$ips_row['ban_ip'].'<br />Decoded: '.$decoded_ip.'&nbsp;</td><td>'.$ips_row['ban_email'].'&nbsp;</td><td><a href="admin_searching_ip.php?mode=delete&amp;id='.$ips_row['ban_id'].'">Remove</a></td></tr>';
   }
   while ($ips_row = $db->sql_fetchrow($result));
   $db->sql_freeresult($result);
echo '</table>';



include('./page_footer_admin.'.$phpEx);

?>

_________________
My little mods | Statistics Mod 4.x.x (revision of 2.1.5) | My hacks at phpbbhacks
Back to top
View user's profile Send private message Send e-mail Visit poster's website

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.

PostPosted: February 14th 2010, 1:53 pm    Post subject: Reply with quote

Thanks for the reply, jimbean223. Ah, I see.

Nice little hack there, Wicher!

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator - Feedback? Questions? Please Contact Me!
User Guidelines - Featured phpBB - Featured Author - phpBBHacks.com Awards - Supported Sites - About Us
Author, Managing Online Forums - A Practical Guide to Community Management
phpBB 3 Tutorials: Add Hacks | Clear Your Cache | Fix Missing Images | phpBB 3 Permissions Guide
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Wicher
Experienced User

Joined: 23 Apr 2003
Posts: 443
Location: Netherlands or Holland, your choice..

PostPosted: February 15th 2010, 12:10 pm    Post subject: Reply with quote

If you want you may put in your mods database Patrick.

Maybe some one else will have some use for it.
_________________
My little mods | Statistics Mod 4.x.x (revision of 2.1.5) | My hacks at phpbbhacks
Back to top
View user's profile Send private message Send e-mail Visit poster's website

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 17279
Location: Harbinger, NC, U.S.A.

PostPosted: February 16th 2010, 2:02 pm    Post subject: Reply with quote

Cool, thanks for that. I'm sure others may find it useful.

Thanks,

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator - Feedback? Questions? Please Contact Me!
User Guidelines - Featured phpBB - Featured Author - phpBBHacks.com Awards - Supported Sites - About Us
Author, Managing Online Forums - A Practical Guide to Community Management
phpBB 3 Tutorials: Add Hacks | Clear Your Cache | Fix Missing Images | phpBB 3 Permissions Guide
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> General phpBB 2 Support and Discussion All times are GMT - 6 Hours
Page 1 of 1
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil - phpBB Portugal - phpBBpersian.com

Network: iFroggy Hosting - PhotoshopForums.com - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - KarateForums.com - Bad Boy Blog - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Disclosure Policy - Staff - User Guidelines >

Copyright © 2001-2012. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.