Twenty Year Anniversary

Andr01d Magic Dumper 0.1

Andr01d Magic Dumper 0.1
Posted Jan 11, 2011
Authored by Sw1tCh

Andr01d Magic Dumper is a perl script that lets you search for 3rd party passwords, dump the call log, dump contacts, dump wireless configuration, and more.

tags | tool, perl
systems | unix
MD5 | b1d05072f80cc1941ef505cf754cd3cc

Andr01d Magic Dumper 0.1

Change Mirror Download
#!/usr/bin/perl
###############################################
# Version 0.1 Andr01d Magic dumper
#
# Written by Sw1tCh
#
###############################################
# Process goes: Untar -> Search -> Dislay
#
#
##############
# You will need the following to work with
# SQLite3
#
# $ perl -MCPAN -e shell
# cpan> install DBI
# cpan> install DBD::SQLite
##############################################
use strict;
#use warnings;
use Archive::Tar;
use Term::Menu;
use DBI;


print "#############################################################\n";
print "## Android Harassment Tool \n";
print "## Version 0.1 \n";
print "## Written by Sw1tCh \n";
print "#############################################################\n";

#############Sub Routines#################


#// Untar the Files to the _temp dir
sub untar {
my $tar = Archive::Tar->new();
$tar->read( $ARGV[0] );
`mkdir _temp`;
#// Extract into the directory
chdir('./_temp/') or die "$!";
$tar->extract();
#// Reset when done
chdir('../') or die "$!";
}

#// Dumps The Passwords that are stored for Third Party Apps:
sub thridpartyPasswords
{
##// Connects to Database
my $dbh = DBI->connect( "dbi:SQLite:_temp/system/accounts.db" ) || die "Cannot connect: $DBI::errstr";
my $Accounts3p = $dbh->selectall_arrayref( q( SELECT * FROM accounts) );

foreach( @$Accounts3p ) {
foreach my $i (0..$#$_) {
print "$_->[$i] \n";
}
# print "\n";
}

$dbh->disconnect;
print "\n\n\n\n";
}

#// Dumps the Phone Contacts by Connecting to the sqlite3 database
sub DumpTheContacts
{


print "\n\n\n Phone Contacts:\n Account Name - Display Name - Alt. Display Name - Displayed Name Source - Times Contacted \n-------------------------------------------------------------------------------------------------------\n";

#// Connected to the database
my $dbh = DBI->connect( "dbi:SQLite:_temp/data/com.android.providers.contacts/databases/contacts2.db" ) || die "Cannot connect: $DBI::errstr";
my $calls = $dbh->selectall_arrayref( q( SELECT raw_contacts.account_name, raw_contacts.display_name, raw_contacts.display_name_alt, phone_lookup.normalized_number, raw_contacts.times_contacted FROM raw_contacts, phone_lookup WHERE raw_contacts._id = phone_lookup.raw_contact_id;) );

foreach( @$calls ) {
foreach my $i (0..$#$_) {
print "$_->[$i] ";
}
print "\n";
}

$dbh->disconnect;
print "\n\n\n";
}


#// Dump Email Contacts from the contact2.db which is in sqlite3 format.
sub DumpEmailContacts
{
print "\n\n\n Email Contacts:\n Account Name - Display Name - Alt. Display Name - Displayed Name Source - Times Contacted\n-------------------------------------------------------------------------------------------------------\n";


my $dbh = DBI->connect( "dbi:SQLite:_temp/data/com.android.providers.contacts/databases/contacts2.db" ) || die "Cannot connect: $DBI::errstr";
my $calls = $dbh->selectall_arrayref( q(SELECT account_name, display_name, display_name_alt, display_name_source, times_contacted, last_time_contacted FROM raw_contacts) );

foreach( @$calls ) {
foreach my $i (0..$#$_) {
print "$_->[$i] ";
}
print "\n";
}

$dbh->disconnect;
print "\n\n\n";
}


#// Dumps out the contact groups. 99% of the time... Totally useless
sub DumpTheGroups
{
my $dbh = DBI->connect( "dbi:SQLite:_temp/data/com.android.providers.contacts/databases/contacts2.db" ) || die "Cannot connect: $DBI::errstr";
my $calls = $dbh->selectall_arrayref( q( SELECT account_name, title FROM groups) );

print "\n";
foreach( @$calls ) {
foreach my $i (0..$#$_) {
print "$_->[$i] ";
}
print "\n";
}

$dbh->disconnect;
print "\n\n\n";
}




#// Dumps Log of Calls Made from Phone
sub CallLog
{
my $dbh = DBI->connect( "dbi:SQLite:_temp/data/com.android.providers.contacts/databases/contacts2.db" ) || die "Cannot connect: $DBI::errstr";
my $calls = $dbh->selectall_arrayref( q( SELECT _id, number, name FROM calls) );

foreach( @$calls ) {
foreach my $i (0..$#$_) {
print "$_->[$i] ";
}
print "\n";
}

$dbh->disconnect;
print "\n\n\n";

}


#// Dumps Contents of wpa_supplicant.conf, which contains the details on the wireless networks
##// Really needs to be cleaned up / formatted...but w/e
sub DumpWirelessNetworks
{

my $wirelessConf ="_temp/misc/wifi/wpa_supplicant.conf";
open(DAT, $wirelessConf) || die("Could not open file!");
my @rawWireless = <DAT>;

foreach (@rawWireless){
print "$_";
}
close (DAT);
print "\n\n\n";
}



########### Main #######################

#// Validates Input
my $filename = $ARGV[0];
if ((! -e $filename) || !( $filename =~ m/tar$/ ) )
{
print "##################################################################\n";
print "## Usage: #> perl AndroidMagic.pl <data.tar (from phone)> \n";
print "## <data.tar - From Nandroid Dump > \n";
print "##################################################################\n\n\n\n\n";
exit;
}


#//Untars the Files
untar($ARGV[0]);

#// Menu

my $menu = new Term::Menu;
while (1)
{
my $answer = $menu->menu(
SearchPasswords => ["Search for 3rd Party Passwords", '1'],
DumpCallLog => ["Dump the Call Log", '2'],
DumpContacts => ["Dump Contacts", '3'],
DumpEmailContacts => ["Dump Email Contacts", '4'],
DumpGroups => ["Dump Contact Groups", '5'],
WirelessNetworks => ["Dump Wireless Configuration", '6'],
quit => ["Exit", "q"],
);
# print "$answer\n";
chomp ($answer);

if($answer eq "SearchPasswords" ) {
print "Search for Passwords\n\n";
thridpartyPasswords();
}
elsif ($answer eq "DumpContacts")
{
print "Dump Contacts";
DumpTheContacts();
}
elsif ($answer eq "DumpEmailContacts")
{
DumpEmailContacts();
}
elsif ($answer eq "DumpGroups")
{
DumpTheGroups();
}
elsif ($answer eq "DumpCallLog")
{
CallLog();
}
elsif ($answer eq "WirelessNetworks")
{
DumpWirelessNetworks();
}
elsif ($answer eq "quit")
{
print "Quiting --> \n\n";
`rm -rf _temp/`;
exit;

}
}
print "failing out: should not see this\n\n";

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

Want To Donate?


Bitcoin: 18PFeCVLwpmaBuQqd5xAYZ8bZdvbyEWMmU

File Archive:

June 2018

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jun 1st
    14 Files
  • 2
    Jun 2nd
    1 Files
  • 3
    Jun 3rd
    3 Files
  • 4
    Jun 4th
    18 Files
  • 5
    Jun 5th
    21 Files
  • 6
    Jun 6th
    8 Files
  • 7
    Jun 7th
    16 Files
  • 8
    Jun 8th
    18 Files
  • 9
    Jun 9th
    5 Files
  • 10
    Jun 10th
    2 Files
  • 11
    Jun 11th
    21 Files
  • 12
    Jun 12th
    32 Files
  • 13
    Jun 13th
    15 Files
  • 14
    Jun 14th
    16 Files
  • 15
    Jun 15th
    4 Files
  • 16
    Jun 16th
    1 Files
  • 17
    Jun 17th
    2 Files
  • 18
    Jun 18th
    15 Files
  • 19
    Jun 19th
    15 Files
  • 20
    Jun 20th
    15 Files
  • 21
    Jun 21st
    15 Files
  • 22
    Jun 22nd
    7 Files
  • 23
    Jun 23rd
    2 Files
  • 24
    Jun 24th
    1 Files
  • 25
    Jun 25th
    0 Files
  • 26
    Jun 26th
    0 Files
  • 27
    Jun 27th
    0 Files
  • 28
    Jun 28th
    0 Files
  • 29
    Jun 29th
    0 Files
  • 30
    Jun 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2018 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close