|
|||||||
| General IT Discussion Non BT Related Topics |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Quote:
__________________
A 3rd Party Security Audit is the IT equivalent of a Colonoscopy, it's long, intrusive, and when it's done you'll have seen a lot of things you really didn't want to see, and you'd definitely remember that you had it done. I ♣ baby harp seals. |
|
||||
|
Quote:
.But that protect you from bad PDF, it doesn't tell you IF PDF was BAD. Also, if you then forward such PDF into the wild, it could contaminate others. Soooo, all the great white hats with too much time on your hands, How do you (if you do) ensure that PDF does not contain a new cool exploit? Sin-cerely, Trol
__________________
He either fears his faith too much, or his desserts are small who dares not put to touch, to win or loose it all. |
|
||||
|
Quote:
The only real solution to this would be to quarantine all attachments until such time that definitions are available to scan. This of course is disruptive to business workflow, so it's not a real good solution. Of course, you could always manually look at every PDF that comes in, if you have nothing else to do with your time, I really don't have the time to do that myself.
__________________
A 3rd Party Security Audit is the IT equivalent of a Colonoscopy, it's long, intrusive, and when it's done you'll have seen a lot of things you really didn't want to see, and you'd definitely remember that you had it done. I ♣ baby harp seals. |
|
|||
|
JS is not the only "bad" think in a PDF. Most dangerous ones out there actually exploit the reader and you can't make sure it's clean unless you open it in a hex editor... and even then, if it's large, you're probably screwed. So no, you can't protect yourself - UPDATE your reader software and hope for the best!!!!
|
|
||||
|
Here's the method that I use in analysing malicious PDFs:
I use the tools pdfid and pdf-parser from here. I the past I have also used pdftk, but Im finding that less useful recently. The process:
I will note that PDF exploits are possible without Javascript, but in practice most of the ones out in the wild seem to use it. Certainly the ones I have seen have it.
__________________
Nancy Astor: If I were your wife I would put poison in your coffee! Winston Churchill: Madam, if I were your husband I would drink it. Last edited by lupin; 12-07-2009 at 01:02 AM. Reason: Better layout and clearer instructions |
|
||||
|
Thank you Lupin for reply, between your information and that from streaker (xorred also my thanks) my escapade into PDF documents might end up being successful (since it is goal/subject selected for fun - i also define success which is handy)
I would love to see that script ![]() Sin-cerely, Trol
__________________
He either fears his faith too much, or his desserts are small who dares not put to touch, to win or loose it all. |
|
||||
|
I knocked this together in the middle of an incident and haven't had a chance to tidy it up, so be warned its pretty rough. You basically just run it at the command line with the JS shellcode as a parameter and it spits out a C program that you can compile.
Code:
#!/usr/bin/perl
# Takes shellcode in javascript unicode coded format as a parameter and outputs it to STDOUT into c code that can be compiled into a windows executable (gcc code.c -o code.exe). Borrows metasploit c code for compiling shellcode.
# shellcode here in format "%uHHHH%uHHHH" where HH is a hexidecimal value
$jsshellcode = $ARGV[0];
if ($jsshellcode eq "") {die("Enter the javascript shellcode as the first parameter to this script in format %uHHHH%uHHHH...\n\n"); }
$code = '';
@array = split "%", $jsshellcode;
foreach $part (@array) {
if (! $part == "") { # encoding is little endian so we swap order of encoded bytes
$code = $code . '\x' . substr($part, 3, 2);
$code = $code . '\x' . substr($part, 1, 2);
}
}
print 'char code[] = "' . $code . '";' . "\n\n";
print <<CODE
int main(int argc, char **argv)
{
int (*funct)();
funct = (int (*)()) code;
(int)(*funct)();
}
CODE
__________________
Nancy Astor: If I were your wife I would put poison in your coffee! Winston Churchill: Madam, if I were your husband I would drink it. |
|
||||
|
Something relevant that I just found on the Internet Storm Center blog, Lenny Zeltser's guide to analysing malicious documents, including PDFs!
There are some usage command lines for some of the tools I mentioned (not the same command lines I have used, but still useful nonetheless). There are also a number of tools listed there I hadn't head of before, as well as a guide to analysing Microsoft Office documents, which I haven't had to do so far. Analyzing Malicious Documents Cheat Sheet by Lenny Zeltser Edit: Documented my PDF analysis process in more detail on my blog here.
__________________
Nancy Astor: If I were your wife I would put poison in your coffee! Winston Churchill: Madam, if I were your husband I would drink it. Last edited by lupin; 01-09-2010 at 01:39 PM. Reason: Added link. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|