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\"></textarea></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
.png.c9b8f3e9eda461da3c0e9ca5ff8c6888.png)
A group blog by Leader in
Hacker Website - Providing Professional Ethical Hacking Services
-
Entries
16114 -
Comments
7952 -
Views
863153525
About this blog
Hacking techniques include penetration testing, network security, reverse cracking, malware analysis, vulnerability exploitation, encryption cracking, social engineering, etc., used to identify and fix security flaws in systems.
Entries in this blog
source: https://www.securityfocus.com/bid/56110/info
Amateur Photographer's Image Gallery is prone to multiple SQL injection vulnerabilities, a cross-site scripting vulnerability, and an arbitrary file-disclosure vulnerability because the application fails to sufficiently sanitize user-supplied data.
An attacker may leverage these issues to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site, steal cookie-based authentication credentials, compromise the application, access or modify data, exploit latent vulnerabilities in the underlying database, and obtain sensitive information from local files on computers running the vulnerable application.
Amateur Photographer's Image Gallery 0.9a is vulnerable; other versions may also be affected.
http://www.example.com/path_gallery/force-download.php?file=[RFD]
source: https://www.securityfocus.com/bid/56110/info
Amateur Photographer's Image Gallery is prone to multiple SQL injection vulnerabilities, a cross-site scripting vulnerability, and an arbitrary file-disclosure vulnerability because the application fails to sufficiently sanitize user-supplied data.
An attacker may leverage these issues to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site, steal cookie-based authentication credentials, compromise the application, access or modify data, exploit latent vulnerabilities in the underlying database, and obtain sensitive information from local files on computers running the vulnerable application.
Amateur Photographer's Image Gallery 0.9a is vulnerable; other versions may also be affected.
http://www.example.com/path_gallery/plist.php?albumid=[SQLi]
source: https://www.securityfocus.com/bid/56110/info
Amateur Photographer's Image Gallery is prone to multiple SQL injection vulnerabilities, a cross-site scripting vulnerability, and an arbitrary file-disclosure vulnerability because the application fails to sufficiently sanitize user-supplied data.
An attacker may leverage these issues to execute arbitrary script code in the browser of an unsuspecting user in the context of the affected site, steal cookie-based authentication credentials, compromise the application, access or modify data, exploit latent vulnerabilities in the underlying database, and obtain sensitive information from local files on computers running the vulnerable application.
Amateur Photographer's Image Gallery 0.9a is vulnerable; other versions may also be affected.
http://www.example.com/path_gallery/plist.php?albumid=[XSS]

- Read more...
- 0 comments
- 1 view

Keeper IP Camera 3.2.2.10 - Authentication Bypass
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

Microsoft Office 2007 - OneTableDocumentStream Invalid Object
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

FirePass 7.0 SSL VPN - 'refreshURL' Open Redirection
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

- Read more...
- 0 comments
- 1 view

Inventory - Multiple Cross-Site Scripting / SQL Injections
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

VideoLAN VLC Media Player 2.2.1 - m3u8/m3u Crash (PoC)
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

Gramophone - 'rs' Cross-Site Scripting
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

Microsoft Excel - Denial of Service
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

EasyITSP - 'customers_edit.php' Authentication Bypass
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

TP-Link TL-WR841N Router - Local File Inclusion
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

- Read more...
- 0 comments
- 1 view

Microsoft Office 2007 - Malformed Document Stack Buffer Overflow
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

CMS Mini 0.2.2 - 'index.php' Script Cross-Site Scripting
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

WordPress Plugin Wordfence Security - Cross-Site Scripting
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

SMF - 'view' Cross-Site Scripting
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

ZSNES 1.51 - Local Buffer Overflow
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

Magento eCommerce - Remote Code Execution
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

VicBlog - Multiple SQL Injections
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

Microsoft Paint 5.1 - '.bmp' Denial of Service
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view

KMPlayer 3.0.0.1440 - '.avi' File Local Denial of Service
HACKER · %s · %s
- Read more...
- 0 comments
- 1 view