Hack Forums
[PHP] Simple lookup for database - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] Simple lookup for database (/showthread.php?tid=5283021)



Simple lookup for database - ugofirstimtrusted - May 26, 2016

I have a bunch of databases and someone scammed my mate and I'm trying to find a hash of his account. I have reasons to believe that the databases that I have contain some of his information.

The database dumps that I have are in .db .sql .sqlite and .txt
I have a web server where I can upload all the databases.

I just want to search through my DB's all at once. Currently, they are in a folder and I just use the search function but it doesn't search inside all the files, just the file name.

If anyone can help then i can share my DB's if you need a certain one.

I was hoping there is a simple source or script that I can use.

All I really want to do is search all the databases for a certain string like an email or something all at once.

Thanks for reading. Hope I can get some help.


* - ugofirstimtrusted - May 27, 2016

I should have posted this elsewhere can a staff member move this for me


* - newQuery - May 27, 2016

If you know what you are looking for, why don't you just Ctrl+F ?


* - SkidPaste/Daedra - May 27, 2016

Are you just looking to search through a bunch of files?


* - RumbleFrog - May 27, 2016

Ctrl F is the easiest method to go, no need for PHP


* - ugofirstimtrusted - May 27, 2016

To all the responses, i've been using ctrl f but it doesn't search through .sql and those extensions inside the file itself even .txt
it just searches the file name im trying to see inside so if theres a user itll check all the dbs in the directory for that user as the title of the file


i want it to search in the file.


* - Niko - May 27, 2016

I personally just shoved everything in one text file and do this

PHP Code

<?php
$searchthis 
= $_GET['string'];
$matches = array();

// Your database file
$handle = @fopen("YourDatabase.txt", "r");
if (
$handle)
{
    while (!
feof($handle))
    {
        
$buffer = fgets($handle);
        if(
strpos($buffer, $searchthis) !== FALSE)
            
$matches[] = $buffer;
    }
    
fclose($handle);
}

// Shows if there is nothing found
if (empty($matches)) {
 echo 
"Nothing Found";
} else {
print_r($matches);
}
?>



* - TickTockMan - May 27, 2016

Use grep for linux or a Windows port of it.

https://wingrep.codeplex.com/


Be aware, some databases files may be in an encrypted format.


* - ugofirstimtrusted - May 29, 2016

thank you guys

saints you are.

much love