Results 1 to 3 of 3
  1. #1
    RoB07's Avatar
    Join Date
    Feb 2008
    Posts
    41
    Reputation
    10
    Thanks
    9

    Cool [Priv]Pearl DB Extracter

    [PHP]#!/usr/bin/perl
    use strict;
    my($db_database,$db_prefix,$db_rowumbers,$db_split ter,$db_resultfile,$line,$realnum,$list,$dumplist, $x,@db_rowumbers,@fulldb,@rowdata);
    sub usage{
    print "USAGE: <database>\tdb dump
    <prefix>\tPrefix of the table you're dumping
    <rows>\tNumbers pointing to the data you want, seperate by commas
    <delimiter>\tWhat to split the resulting data by.
    \t\tIf you want spaces then enclose with quotes
    <resultfile>\tFile to dump the data to\n";
    print "EX: dump_gamers.sql e107_users 2,5 : gamerdump.txt\n";
    exit;
    }

    if(!$^O =~ m/linux/i){system("clear");}else{system("cls");}
    &usage unless @ARGV==5;
    $db_database=$ARGV[0];

    $db_prefix=$ARGV[1];
    $db_rowumbers=$ARGV[2];
    $db_splitter=$ARGV[3];
    $db_resultfile =$ARGV[4];
    @db_rowumbers = split(/,/,$db_rowumbers);
    open(xfile, "<$db_database") || die "Couldn't open $list\n";
    @fulldb = <xfile>;
    close(xfile);
    chomp(@fulldb);

    foreach $line(@fulldb){
    if(($line =~ m/INSERT INTO \'$db_prefix\'\((.*?)\)/i) || ($line =~ m/INSERT INTO \`$db_prefix\`\((.*?)\)/i) || ($line =~ m/^INSERT INTO $db_prefix(.*?)\((.*?)\)/i)){
    $line =~ s/INSERT INTO \'$db_prefix\'/INSERT INTO \`$db_prefix\`/;
    @rowdata = split(/\'/,$line);
    open(DBLOG,">>$db_resultfile") || die "Couldn't open uname-$dumplist\n";
    print "[+] ";
    for($x=0;$x<=$#db_rowumbers;$x++){
    $realnum = $db_rowumbers[$x]*2-1;
    if($x==$#db_rowumbers){
    print "$rowdata[$realnum]\n";
    print DBLOG "$rowdata[$realnum]\n";
    }
    else{
    print "$rowdata[$realnum]$db_splitter";
    print DBLOG "$rowdata[$realnum]$db_splitter";
    }
    }
    }
    }
    close(DBLOG);
    print "[+] Parsing & dumping completed\n";




    QUOTE
    USAGE: <database> db dump
    <prefix> Prefix of the table you're dumping
    <rows> Numbers pointing to the data you want, seperate by commas
    <delimiter> What to split the resulting data by.
    If you want spaces then enclose with quotes
    <resultfile> File to dump the data to
    EX: dump_gamers.sql e107_users 2,5 : gamerdump.txt[/PHP]


    This is used when you have a DB but you only want certain data, eg username & hashes, username & emails, names,addresses, whatever.

    EGX2: Say the structure for a table is like this:

    [PHP]CREATE TABLE `nigra_users` (
    `id` mediumint(Cool) NOT NULL default '0',
    `username` varchar(25) NOT NULL default '',
    `email` varchar(25) NOT NULL default '',
    `password` varchar(32) NOT NULL default ''
    );[/PHP]


    The prefix is nigra_users

    You only want to extract the usernames (row 2) & passwords (row 4).
    The usage would be:

    dbextractor.pl nigra_users 2,4 : dumped.txt

  2. #2
    rambone11's Avatar
    Join Date
    Feb 2008
    Posts
    98
    Reputation
    10
    Thanks
    4
    omg: nice really great man

  3. #3
    w00t?'s Avatar
    Join Date
    Jul 2007
    Gender
    male
    Posts
    257
    Reputation
    10
    Thanks
    29
    Depends on database type. Also u should put credits for extractor. MousePad coded it.

    cya

Similar Threads

  1. Pearl Harbor
    By Inna in forum General
    Replies: 21
    Last Post: 12-08-2007, 09:03 AM
  2. How to play Pokemon Diamond/Pearl on PC
    By arunforce in forum General
    Replies: 44
    Last Post: 08-08-2007, 03:22 PM
  3. (Request) A tutorial on how to extract addresses from trainers
    By englishpom in forum WarRock - International Hacks
    Replies: 9
    Last Post: 05-19-2007, 10:14 PM
  4. Self Extracting Trainer By OMGWTF
    By OMGWTF in forum WarRock - International Hacks
    Replies: 20
    Last Post: 02-22-2006, 07:39 AM
  5. priv server request
    By darkone1149 in forum Hack Requests
    Replies: 1
    Last Post: 02-20-2006, 09:24 AM

Tags for this Thread