
1979 changes to exploits/shellcodes Couchdb 1.5.0 - 'uuids' Denial of Service Apache CouchDB 1.5.0 - 'uuids' Denial of Service Beyond Remote 2.2.5.3 - Denial of Service (PoC) udisks2 2.8.0 - Denial of Service (PoC) Termite 3.4 - Denial of Service (PoC) SoftX FTP Client 3.3 - Denial of Service (PoC) Silverstripe 2.3.5 - Cross-Site Request Forgery / Open redirection SilverStripe CMS 2.3.5 - Cross-Site Request Forgery / Open Redirection Silverstripe CMS 3.0.2 - Multiple Vulnerabilities SilverStripe CMS 3.0.2 - Multiple Vulnerabilities Silverstripe CMS 2.4 - File Renaming Security Bypass SilverStripe CMS 2.4 - File Renaming Security Bypass Silverstripe CMS 2.4.5 - Multiple Cross-Site Scripting Vulnerabilities SilverStripe CMS 2.4.5 - Multiple Cross-Site Scripting Vulnerabilities Silverstripe CMS 2.4.7 - 'install.php' PHP Code Injection SilverStripe CMS 2.4.7 - 'install.php' PHP Code Injection Silverstripe Pixlr Image Editor - 'upload.php' Arbitrary File Upload SilverStripe CMS Pixlr Image Editor - 'upload.php' Arbitrary File Upload Silverstripe CMS 2.4.x - 'BackURL' Open Redirection SilverStripe CMS 2.4.x - 'BackURL' Open Redirection Silverstripe CMS - 'MemberLoginForm.php' Information Disclosure SilverStripe CMS - 'MemberLoginForm.php' Information Disclosure Silverstripe CMS - Multiple HTML Injection Vulnerabilities SilverStripe CMS - Multiple HTML Injection Vulnerabilities Apache CouchDB 1.7.0 and 2.x before 2.1.1 - Remote Privilege Escalation Apache CouchDB 1.7.0 / 2.x < 2.1.1 - Remote Privilege Escalation Monstra CMS before 3.0.4 - Cross-Site Scripting Monstra CMS < 3.0.4 - Cross-Site Scripting (2) Monstra CMS < 3.0.4 - Cross-Site Scripting Monstra CMS < 3.0.4 - Cross-Site Scripting (1) Navigate CMS 2.8 - Cross-Site Scripting Collectric CMU 1.0 - 'lang' SQL injection Joomla! Component CW Article Attachments 1.0.6 - 'id' SQL Injection LG SuperSign EZ CMS 2.5 - Remote Code Execution MyBB Visual Editor 1.8.18 - Cross-Site Scripting Joomla! Component AMGallery 1.2.3 - 'filter_category_id' SQL Injection Joomla! Component Micro Deal Factory 2.4.0 - 'id' SQL Injection RICOH Aficio MP 301 Printer - Cross-Site Scripting Joomla! Component Auction Factory 4.5.5 - 'filter_order' SQL Injection RICOH MP C6003 Printer - Cross-Site Scripting Linux/ARM - Egghunter (PWN!) + execve(_/bin/sh__ NULL_ NULL) Shellcode (28 Bytes) Linux/ARM - sigaction() Based Egghunter (PWN!) + execve(_/bin/sh__ NULL_ NULL) Shellcode (52 Bytes)
61 lines
No EOL
2.7 KiB
Text
61 lines
No EOL
2.7 KiB
Text
Many shell users, and certainly a lot of the people working in
|
|
computer forensics or other fields of information security, have a
|
|
habit of running /usr/bin/strings on binary files originating from the
|
|
Internet. Their understanding is that the tool simply scans the file
|
|
for runs of printable characters and dumps them to stdout - something
|
|
that is very unlikely to put you at any risk.
|
|
|
|
It is much less known that the Linux version of strings is an integral
|
|
part of GNU binutils, a suite of tools that specializes in the
|
|
manipulation of several dozen executable formats using a bundled
|
|
library called libbfd. Other well-known utilities in that suite
|
|
include objdump and readelf.
|
|
|
|
Perhaps simply by the virtue of being a part of that bundle, the
|
|
strings utility tries to leverage the common libbfd infrastructure to
|
|
detect supported executable formats and "optimize" the process by
|
|
extracting text only from specific sections of the file.
|
|
Unfortunately, the underlying library can be hardly described as safe:
|
|
a quick pass with afl [1] (and probably with any other competent
|
|
fuzzer) quickly reveals a range of troubling and likely exploitable
|
|
out-of-bounds crashes due to very limited range checking. In binutils
|
|
2.24, you can try:
|
|
|
|
$ wget http://lcamtuf.coredump.cx/strings-bfd-badptr2
|
|
|
|
Exploit-DB Mirror: https://github.com/offensive-security/exploitdb-bin-sploits/raw/master/bin-sploits/35081.bin
|
|
|
|
...
|
|
$ strings strings-bfd-badptr2
|
|
Segmentation fault
|
|
...
|
|
strings[24479]: segfault at 4141416d ip 0807a4e7 sp bf80ca60 error 4
|
|
in strings[8048000+9a000]
|
|
...
|
|
while (--n_elt != 0)
|
|
if ((++idx)->shdr->bfd_section)
|
|
elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section;
|
|
...
|
|
(gdb) p idx->shdr
|
|
$1 = (Elf_Internal_Shdr *) 0x41414141
|
|
|
|
In other words, this code appears to first read and then write to an
|
|
arbitrary pointer (0x41414141) taken from the input file. Many Linux
|
|
distributions ship strings without ASLR, making potential attacks
|
|
easier and more reliable - a situation reminiscent of one of
|
|
CVE-2014-6277 in bash [2].
|
|
|
|
Interestingly, the problems with the utility aren't exactly new; Tavis
|
|
spotted the first signs of trouble in other parts of libbfd some nine
|
|
years ago [3].
|
|
|
|
In any case: the bottom line is that if you are used to running
|
|
strings on random files, or depend on any libbfd-based tools for
|
|
forensic purposes, you should probably change your habits. For strings
|
|
specifically, invoking it with the -a parameter seems to inhibit the
|
|
use of libbfd. Distro vendors may want to consider making the -a mode
|
|
default, too.
|
|
|
|
[1] Obligatory plug: http://code.google.com/p/american-fuzzy-lop/
|
|
[2] http://lcamtuf.blogspot.com/2014/10/bash-bug-how-we-finally-cracked.html
|
|
[3] https://bugs.gentoo.org/show_bug.cgi?id=91398 |