ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ Undergroundthalo Hacking Team - Security Advisory ³ ³ ³ ÚÁ----------------------------------------À³Ù-----------------------------------Á¿ ³ ³Ú´ Author : cr4wl3r ³ Release Date : 18-Okt-2012 ÿ³ ³³³ Product : BSW Gallery ³ Size : 38.2 kB ³³³ ³³³ Link : http://sourceforge.net/projects/bswgallery/ ³³³ ³ÃÁ------------------------------------------³-------------------------------------Á´³ ³³ gallery.zip ³ ³³ ³ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ³ ³ Details ³ ³ ³ ³ BSW Gallery ³ ³ ³ ³ This is a very simple photo gallery which is written in PHP code ³ ³ designer by Dr.Mohamed AbdelWahab ³ ³ The web application is vulnerable Arbitrary File Upload ³ ³ where an attacker could upload a malicious php code without difficulty ³ ³ on the file to be uploaded ³ ³------------------------------------------------------------------------------------³ Code in uploadpic.php print "
"; print ""; print ""; print "
File Upload:
"; print""; print"
Image Title
"; print""; print"
Image Description
"; Code in dopic.php $fname=$_POST['picture']; $descrip=$_POST['descrip']; $file_dir ="gallery/"; foreach($_FILES as $file_name => $file_array) { echo "path: ".$file_array["tmp_name"]."
\n"; echo "name: ".$file_array["name"]."
\n"; echo "type: ".$file_array["type"]."
\n"; echo "size: ".$file_array["size"]."
\n"; if (is_uploaded_file($file_array["tmp_name"])) { move_uploaded_file($file_array["tmp_name"], "$file_dir/".$file_array["name"]) or die ("Couldn't copy"); echo "Done!
"; } } $image=$file_dir.$file_array["name"]; $ip = getenv("REMOTE_ADDR"); $sql = "insert into gallery (picture,files,descrip,updated)values('$fname','$image','$descrip',now());"; mysql_query($sql,$mysql); mysql_close($mysql); ³------------------------------------------------------------------------------------³ ³ Proof of Concept : ³ ³ ³ ³ http://b0x/path_gallery/uploadpic.php ³ ³ ³ ³ Shell : ³ ³ ³ ³ http://b0x/path_gallery/gallery/shell.php ³ ³ ³ ³ See for the demo : ³ ³ ³ ³ http://0xuht.org/demo/demo1.png ³ ³ http://0xuht.org/demo/demo2.png ³ ³ http://0xuht.org/demo/demo3.png ³ ³ ³ ³ ³ ³ Undergroundthalo Hacking Team ³ ³ Site: http://0xuht.org ³ ³ Twitter: @hackb0x ³ ³ ³ ³ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ ³ Happy Birhtday Saskia Adam :) ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ