Waraxe IT Security Portal
Login or Register
May 3, 2026
Menu
Home
Logout
Discussions
Forums
Members List
IRC chat
Tools
Base64 coder
MD5 hash
CRC32 checksum
ROT13 coder
SHA-1 hash
URL-decoder
Sql Char Encoder
Affiliates
y3dips ITsec
Md5 Cracker
User Manuals
AlbumNow
Content
Content
Sections
FAQ
Top
Info
Feedback
Recommend Us
Search
Journal
Your Account
User Info
Welcome, Anonymous
Nickname
Password
(Register)

Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144

People Online:
Visitors: 953
Members: 0
Total: 953
Full disclosure
ESP-RFID-Tool v2 PRO — Full Public Disclosure
Re: SEC Consult SA-20260427-0 :: Missing TLS Certificate Validation leading to RCE in DeskTime Time Tracking App
SEC Consult SA-20260427-0 :: Missing TLS Certificate Validation leading to RCE in DeskTime Time Tracking App
SEC Consult SA-20260423-0 :: DLL Hijacking in EfficientLab Controlio (cloud-based employee monitoring service)
SEC Consult SA-20260421-0 :: Broken Access Control in Config Endpoint in LiteLLM
SEC Consult SA-20260415-0 :: Exposed Private Key of X.509 Certificate in SAP HANA Cockpit & SAP HANA Database Explorer
APPLE-SA-04-22-2026-2 iOS 18.7.8 and iPadOS 18.7.8
APPLE-SA-04-22-2026-1 iOS 26.4.2 and iPadOS 26.4.2
Research: When Trusted Tools Become Attack Primitives
[KIS-2026-08] SocialEngine <= 7.8.0 (get-memberall) SQLInjection Vulnerability
[KIS-2026-07] SocialEngine <= 7.8.0 Blind Server-Side RequestForgery Vulnerability
Trojan-Spy.Win32.Small / Remote Command Execution
[IWCC 2026] CfP: 15th International Workshop on Cyber Crime - Linköping, Sweden, Aug 24-27, 2026
[SBA-ADV-20251120-01] CVE-2026-0972: GoAnywhere MFT Email HTML Injection
CyberDanube Security Research 20260408-1 | Multiple Vulnerabilities in Siemens SICAM A8000
Log in Register Forum FAQ Memberlist Search
IT Security and Insecurity Portal

www.waraxe.us Forum Index -> Newbies corner -> I have a slight problem...
Post new topicReply to topic View previous topic :: View next topic
I have a slight problem...
PostPosted: Tue Sep 29, 2009 1:55 am Reply with quote
tox1c
Active user
Active user
Joined: Sep 22, 2009
Posts: 41




Hey i just searched the forum but couldnt find what i was looking for.

Is there a tool around or a code that i can use to extract the emails salts and usernames from a database? i have the database in .sql format was wondering if theres a way to extract all the hashes salts and emails into a seperate notepad or something
View user's profile Send private message
PostPosted: Tue Sep 29, 2009 9:46 am Reply with quote
cMD
Advanced user
Advanced user
Joined: Sep 23, 2008
Posts: 67




Code:
<?
error_reporting(0);
set_time_limit(0);

$filename = 'xxx.sql'; # sql дамп
$separator = ":"; # Разделитель
$mode = 1; # 2 режима, 0 - Нормальный (без чека мыла) 1 - чек мыла.
$columns = 'email,pswd'; # Выводить определенные колинки. Если не указывать, то парсится весь дамп.

$fd = fopen($filename, 'r');
while(!feof($fd)) {
$line = fgets($fd);
if(preg_match("/VALUES/i", $line))
preg_match_all("/INSERT\s+INTO\s+`.*`(\s+|)\(`(.*?)`\)/i", $line, $fields);
if($fields[1][0] != NULL)
$into = $fields[1][0];
else $into = $fields[2][0];
$parsed = explode('`, `', $into);
$column = regex($parsed, $line);
if($column[0][0] == true) {
if($columns == false)
$done = full_parse_dump($column);
else
$done = selectively($column);
if(modes($done) == true) {
qwrite($filename.'_out.txt', $done."\r\n");
//echo $done."\r\n";
}
}
}

function full_parse_dump($column) {
global $separator;
for($i = 1; $i < count($column); $i++) {
if($i == 1) $result = $column[$i][0];
else $result .= $separator.$column[$i][0];
} return $result;
}

function modes($in) {
global $mode;
if($mode == 0) {
return $in;
}
elseif ($mode == 1) {
preg_match("/([a-z0-9_\.\-]{1,20})@([a-z0-9\.\-]{1,20})\.([a-z]{2,4})/is", $in, $email);
if(validEmail($email[0]) == false)
return;
else
return $in;
}
return $cname;
}

function selectively($column) {
global $columns,$separator;
$first = true;
foreach(search_fields($columns) as $i) {
if($first == true) {
$parsed = $column[$i][0];
$first = false;
} else
$parsed .= $separator.$column[$i][0];
}
return $parsed;
}

function search_fields($fields) {
global $parsed;
$colname = explode(',', $fields);
foreach($parsed as $index => $name) {
foreach($colname as $cname) {
if($name == $cname)
$i_name[$name] = $index + 1;
}
}
if($i_name == null)
die("Fields -> ".$fields." <- Not Found!\n");

return sorting($i_name);
}

function sorting($cname) {
global $columns;
$coname = explode(',', $columns);
foreach($coname as $colname) {
foreach($cname as $index => $field) {
if($index == $colname)
$sort[] = $field;
}
}
return $sort;
}

function regex($fields, $line) {
for($i = 0; $i < count($fields); $i++) {
if($i == 0) $col = "'(.*?)'";
else $col .= ",\s+'(.*?)'";
}
preg_match_all("/VALUES\s+\(".$col."/i",$line, $column);
return $column;
}

function validEmail($email) {
$isValid = true;
if(!$atIndex = strrpos($email, "@"))
return false;
if (is_bool($atIndex) && !$atIndex) {
$isValid = false;
}
else {
$domain = substr($email, $atIndex+1);
$local = substr($email, 0, $atIndex);
$localLen = strlen($local);
$domainLen = strlen($domain);

if ($localLen < 1 || $localLen > 64) {
$isValid = false;
}
else if ($domainLen < 1 || $domainLen > 255) {
$isValid = false;
}
else if ($local[0] == '.' || $local[$localLen-1] == '.') {
$isValid = false;
}
else if (preg_match('/\\.\\./', $local)) {
$isValid = false;
}
else if (!preg_match('/^[A-Za-z0-9\\-\\.]+$/', $domain)) {
$isValid = false;
}
else if (preg_match('/\\.\\./', $domain)) {
$isValid = false;
}
else if(!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',
str_replace("\\\\","",$local))) {
if (!preg_match('/^"(\\\\"|[^"])+"$/',
str_replace("\\\\","",$local))) {
$isValid = false;
}
}
if ($isValid && !(checkdnsrr($domain,"MX") || checkdnsrr($domain,"A"))) {
$isValid = false;
}
}
return $email;
}

function qwrite($name, $content) {
if(!$file = @fopen($name, "a+")) exit;
fwrite($file, $content);
fclose($file);
}
?>
View user's profile Send private message
I have a slight problem...
www.waraxe.us Forum Index -> Newbies corner
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
All times are GMT
Page 1 of 1

Post new topicReply to topic


Powered by phpBB © 2001-2008 phpBB Group



PCWizardHub - Helping you fix, build, and optimize your PC life
All logos and trademarks in this site are property of their respective owner. The comments and posts are property of their posters, all the rest (c) 2004-2024 Janek Vind "waraxe"
Page Generation: 0.038 Seconds