Image
 
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 29 guests online
EH-Net Donations

Enter Amount:
$

Google Ads
EH-Net News Feeds
Latest Additions
Book Recommendations





 
Advertisement

You are here: Home arrow Forum
Ethical Hacker Community Forums
January 09, 2009, 06:34:14 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: ChicagoCon 2009 - May 4 - 9. Boot Camps & an Ethical Hacking Conf. www.chicagocon.com
 
  Home Help Calendar Login Register  
  Show Posts
Pages: [1] 2 3 4
1  Ethical Hacking Discussions and Related Certifications / Malware / Re: THe website is Evil but what to do?? on: Yesterday at 05:59:23 AM
that's a massive assumption you're making there....

as far as I'm aware - exploits using mp3's are similar to the ones using image files that you asked about in July last year. 

as an mp3 is just a file format (http://en.wikipedia.org/wiki/Mp3#File_structure / http://www.mpgedit.org/mpgedit/mpeg_format/MP3Format.html) the mp3 would have to exploit a specific buffer overflow or some other vulnerability in order to start executing.  I remember something like this happening in winamp a while back, but havn't heard anything recently about this being possible in any popular mp3 players.

you can open the mp3 in a hex editor to see what's in it.  if you think it contains exploit code then you can look at it in a dissassembler or do any number of system level reversing tricks in a virtual machine. 
2  Resources / News from the Outside World / Re: Is this acceptable? on: January 06, 2009, 09:50:18 AM
I loved this bit:

Quote
Police might also send an e-mail to a suspect’s computer. The message would include an attachment that contained a virus or “malware”.

Dispite the potential ineffectiveness of this method it raises issues such as:

- as there is now a potential market for malware in the form of governments, where do malware writers stand legally now?
- if a security researcher finds said malware, reverses it and reports on it's inner workings on the internet, where does this put the security researcher legally?
- if a security researcher developes a tool to remove government malware - where does it put them - or any anti-virus company/group for that matter.
- how the hell are they going to deal with people who actually know how to secure their pc's? 

orwellian slope anyone?


3  Ethical Hacking Discussions and Related Certifications / Programming / Re: understanding for rid null bytes from my code ??? on: December 19, 2008, 06:51:58 PM
the idea is that you compile the asm, objdump it, extract the opcodes and then test it in a C program. 

Code:
bt shellcode # objdump -d ./shell

./shell:     file format elf32-i386

Disassembly of section .text:

08048060 <_start>:
 8048060:       eb 1a                   jmp    804807c <gotocall>

08048062 <shellcode>:
 8048062:       5e                      pop    %esi
 8048063:       31 c0                   xor    %eax,%eax
 8048065:       88 46 07                mov    %al,0x7(%esi)
 8048068:       8d 1e                   lea    (%esi),%ebx
 804806a:       89 5e 08                mov    %ebx,0x8(%esi)
 804806d:       89 46 0c                mov    %eax,0xc(%esi)
 8048070:       b0 0b                   mov    $0xb,%al
 8048072:       89 f3                   mov    %esi,%ebx
 8048074:       8d 4e 08                lea    0x8(%esi),%ecx
 8048077:       8d 56 0c                lea    0xc(%esi),%edx
 804807a:       cd 80                   int    $0x80

0804807c <gotocall>:
 804807c:       e8 e1 ff ff ff          call   8048062 <shellcode>
 8048081:       2f                      das
 8048082:       62 69 6e                bound  %ebp,0x6e(%ecx)
 8048085:       2f                      das
 8048086:       73 68                   jae    80480f0 <gotocall+0x74>
 8048088:       41                      inc    %ecx
 8048089:       42                      inc    %edx
 804808a:       42                      inc    %edx
 804808b:       42                      inc    %edx
 804808c:       42                      inc    %edx
 804808d:       43                      inc    %ebx
 804808e:       43                      inc    %ebx
 804808f:       43                      inc    %ebx
 8048090:       43                      inc    %ebx

take the opcodes and stick into a test framework:

Code:
char shellcode[] =
"\xeb\x1a\x5e\x31\xc0\x88\x46\x07\x8d\x1e\x89\x5e\x08\x89\x46\x0c"
"\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\xe8\xe1\xff\xff"
"\xff\x2f\x62\x69\x6e\x2f\x73\x68\x41\x42\x42\x42\x42\x43\x43\x43"
"\x43";
int main()
{
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int)shellcode;
}

and that should run fine.

edit:  here's a good article I found helpful too:

http://www.madirish.net/?article=168

4  Ethical Hacking Discussions and Related Certifications / Certification / Re: CREA Certified Reverse Engineering Analyst on: December 12, 2008, 04:15:52 AM
the course costs $2,950, although they had an introductory offer in August (which may or may not still be going of $1,950, which is what I paid.

at this stage, I would unfortunately have to recommend NOT getting the course.

I've nearly finished and should post a review early next week and you can make up your own mind but IMHO it needs quite a bit of improving, it's not that it's bad or lacks content.

I would instead recommend 'Reversing - the secrets of reverse engineering' by Eldad Eilam. A significant cost-saving compared to the course and yet scarily similar content.
5  Ethical Hacking Discussions and Related Certifications / Certification / Re: CREA Certified Reverse Engineering Analyst on: December 11, 2008, 12:42:54 PM
Got an e-mail back from Jack Koziol (snipped for relevence):

Quote from: Jack Koziol
You have very valid points about the CREA. We are working hard on getting the practical portion set up for this exam, and are currently "beta testing" a number of different practicals. We initially had a number of simple crackmes, but all of the CREA certification board members decided it would be best to include a mix of traditional "crackmes" and malware, because so many people out there are looking for reversers to reverse malware. The challenge has been how to properly distrubute malware for the pratical, we have to accomplish two goals:

1. Make sure there isnt a write up on the malware somewhere else, which would just encourage cheating or "peeking"
2. Properly "neuter" the malware so it cannot harm someone's computer who is doing the pratical.

Number 1 is much harder than number 2, because security community seems to love to rip apart just about every piece of widely circulated malware and post ooodles of details all over blogs, etc. Wink

Anyway, to make a long story short, we are definately working hard on the pratical portion of the exam, and we do expect a rollout and conversion for certification candidates in Feburary of 2009.

Awesome :-)

and so I asked if he recommended taking the exam now or later (and also for permission to post his comments here) and I got back:

Quote from: Jack Koziol
I sure wish that all of our exam candidates were as hard working as
you. You should see the number of people complaining about having to do the
CEPT or CPT practicals. But, that is the whole idea, to weed these
candidates out.

I would recommend you take the exam now, and, for kicks, I will let you know
when the practical is ready and you can retake the practical portion if you
are up for it. Ill send it to you ahead of time before we release them to
the public, id like to hear your comments.

double-plus-awesome!

in addition - they're short on people who would be capable of producing valid test-cases and would appreciate any volunteers.

Course is going well - I have some concerns about it though but I'll hold back on commenting too much until I finish it.
6  Ethical Hacking Discussions and Related Certifications / Programming / Re: understanding for rid null bytes from my code ??? on: December 11, 2008, 04:34:29 AM
I'm by no means an expert, just learning, like yourself so I may be very wrong, (please someone stop me if I am!) but I'm almost certain that for the most part when writing shellcode yourself you're not going to be  able to simply manipulate the existing assembly to remove the nulls, you're going to have to analyse the code that you're wanting to execute and break it down into its essential components and then re-write as efficiently as you can.

Even when you do a simple exit as below:

Code:
> vi exitcode.c
void main()
{
  exit(0);
}

> gcc -static -o exitcode exitcode.c

> objdump -d ./exitcode > exitcode.dump

0804e12c <_exit>:
 804e12c:       8b 5c 24 04             mov    0x4(%esp),%ebx
 804e130:       b8 fc 00 00 00          mov    $0xfc,%eax
 804e135:       cd 80                   int    $0x80
 804e137:       b8 01 00 00 00          mov    $0x1,%eax
 804e13c:       cd 80                   int    $0x80

you're still going to have to figure out what is being loaded into ebx (0 apparently).
 
and determine whether you need both int 80's. (one is exit_group() and one is exit())
 
The resulting assembly would be

Code:
section .text

   global _start
   
_start:   

   xor ebx, ebx
   xor eax, eax
   mov al, 1
   int 80
   
which doesn't really bear a lot of resemblence to the original disassembly   
 
7  Resources / Tools / Re: Nmap Network Scanning Book Released! on: December 10, 2008, 08:50:07 AM
I suspect actually that most wife implementations have a buffer overflow vulnerability when parsing flowers/chocolate.  if you send them with a well-crafted payload in the form of an attached note, you can overwrite the return address, directing them to a particularly romantic resturant of your choice and thereafter continually drop references to your book in the context of christmas presents. 

make sure you handle the exit gracefully though so as to avoid segfaulting....
8  Ethical Hacking Discussions and Related Certifications / Programming / Re: understanding for rid null bytes from my code ??? on: December 09, 2008, 06:05:05 AM
Hi again,

I was going to try to type out an excerpt from the shellcoder's handbook, but it is multiple pages long.  This was a Good Thing because it forced me to understand it prior to posting here :-)  I havn't done so previously because I'm focusing on the reversing course that I'm doing at the moment.

Anyway, In summary:

We want to spawn a shell by calling

Code:
execve ('/bin/sh','/bin/sh',null);

So first we write what we want to do in c (this is code from the book): 

Code:
#include <stdio.h>
int main()
{
  char *happy[2];
  happy[0] = "/bin/sh";
  happy[1] = null;
  execve (happy[0],happy,null);
}

Next we disassemble it and take a look at the execve call (this is cut down to show the parameters and the call itself, but it's good to look at the entire function):
Code:
  804e15b:       8b 5d 08                mov    0x8(%ebp),%ebx
  <snip>
  804e165:       8b 4d 0c                mov    0xc(%ebp),%ecx
  804e168:       8b 55 10                mov    0x10(%ebp),%edx
  804e16b:       b8 0b 00 00 00          mov    $0xb,%eax
  804e170:       cd 80                   int    $0x80

As you can see, int 80 performs the syscall which is stored in eax (execve is 0xb)  and takes three arguments, passed in via the registers ebx, ecx and edx (fastcall convention). 

The problem with simply taking the disassembly and removing null bytes is that there are a lot of hard-coded addresses in there - which, as you've found, are difficult to deal with.

So we need a way to make it so we can reference everything via relative addressing.

The simplest way to do this is to have our shellcode execute in it's own stack frame that we can control.  The idea is that we start the shellcode off with a call and then go from there.

Here's the assembly code from the book (sorry for the intel syntax):

Code:
Section .text

   global _start

_start:

   jmp short gotocall

shellcode:


   pop esi
   xor eax, eax
   mov byte [esi+7], al
   lea ebx, [esi]
   mov long [esi +8], ebx
   mov long [esi + 12], eax
   mov byte al, 0x0b
   mov ebx, esi
   lea ecx, [esi + 8]
   lea edx, [esi +12]
   int 0x80

gotocall:

   call shellcode
   db '/bin/shABBBBCCCC'

When the call instruction is executed, the instruction immediately following is placed on the stack.  We've included some padding in the db (define byte) instruction in order to make room for the extra parameters in our call to execve.

Next we pop esi to get the address of our '/bin/shABBBBCCCC' string into the ESI register - now we can reference this as offsets from ESI.

Code:
xor eax, eax
sets eax to null.

Code:
mov byte [esi+7], al

places a null over the 7th byte in our string the "A"

Code:
lea ebx, [esi]

places our string into ebx

Code:
mov long [esi +8], ebx

moves our string into the address at esi+8.  our string now should look like: '/bin/sh./bin/shCCCC'  with the "." representing a null

Code:
mov long [esi + 12], eax
This moves null (eax was xor'd previously) into the last part of our string

Now we set up ready for the interrupt 80:

Code:
mov byte al, 0x0b
mov ebx, esi
lea ecx, [esi + 8]
lea edx, [esi +12]

At this point - EAX will contain 00 00 00 0b
EBX will contain a pointer to the string '/bin/sh'
Ecx will also contain a pointer to the string '/bin/sh'
And edx will contain a pointer to a null

Then we execute the interrupt.

Code:
int 0x80

So you merely have to compile that assembly and extract the opcodes.

hope that helps -
9  Ethical Hacking Discussions and Related Certifications / Certification / Re: CREA Certified Reverse Engineering Analyst on: December 08, 2008, 06:22:39 AM
One thing I've just noticed with the CREA exam itself is according to the website it is merely a multiple choice exam.

This confuses me a bit because the CEPT and CPT certifications have practical components - that's what makes them such good certifications.  it further confuses me that the CEPT exam has a binary reversing component, but the Reversing exam does not despite their obvious capability for administering practical assessment.

surely a crackme or two wouldn't go astray in increasing the value of this cert?  I've sent them an e-mail asking about it in anycase.

10  Ethical Hacking Discussions and Related Certifications / Programming / Re: understanding for rid null bytes from my code ??? on: December 08, 2008, 04:31:14 AM
don't say sorry for posting!  there's no such thing as a stupid question.

yes, your code may compile differently under different operating systems and definately with different compilers, but it should all by syntactically the same.

the general process for writing shellcode goes:

1. write your code in a high level language
2. compile to assembly
3. take only the assembly component that you need from it
4. compile cut-down assembly to binary
5. disassemble resulting binary to identify null bytes
6. re-work the assembly until you remove null bytes (see above posts for general idea of how to remove null bytes).

you may need to engage in some jiggery-pokery to reserve space for strings such as /bin/sh etc.

if you're serious about getting into this, I Highly recommend getting "the shellcoders handbook" - the entire book is dedicated to writing shellcode.

I'll post an excerpt from it detailing the above steps later on if you like (don't have the book in front of me right now).
11  Ethical Hacking Discussions and Related Certifications / Physical Security / Re: Getting started in lockpicking on: December 06, 2008, 11:52:33 AM
I'll second that - I've been a member there since the beginning of 2004 (not under this nick name). if you can get past the regular newbie questions you'll find there's a lot of knowledgable locksmiths ans hobyists alike hanging arround.

the (restricted) advanced forum has quite a bit more information about higher security locks and different bypass methods that are not discussed in the open forum.
12  Ethical Hacking Discussions and Related Certifications / Programming / Re: understanding for rid null bytes from my code ??? on: December 04, 2008, 04:48:16 AM
Hi Nubie - I'm also new at writing shellcode, but it is my understanding that you should look at the actual opcodes to determine where the null byte is coming from.

Use objdump -d on the compiled file and identify which commands have null bytes - for example:

80483a5:       b8 11 00 00 00          mov    $0x11,%eax

Has three null bytes, but you can fix this by changing to use the low 8 bit register:
mov $0x11, %al

Which will remove the null bytes from the shellcode but still perform the same function.

Does this assist at all?
13  Ethical Hacking Discussions and Related Certifications / Certification / Re: CREA Certified Reverse Engineering Analyst on: December 03, 2008, 10:34:58 AM
oh, I was definately ntending on posting it here on EH.net (and on my blog with gratuitous linking to the EH article of course) - would you prefer I start a new article or place it in this thread?   
14  Ethical Hacking Discussions and Related Certifications / Certification / Re: CREA Certified Reverse Engineering Analyst on: December 03, 2008, 07:51:50 AM
Finally recieved my package with the software and lab notes.  It was merely a miss-communication of package tracking numbers rather than the fault of the infosec institute.

They've also fixed the online component and added practical excersise videos also.

Now to get stuck into it.  I'll be writing a complete review after about a week or so.

I'm particularly impressed with the CD's that just came - they have all the software required for the lab excersises including the crackme's and viruses that are analysed and on the other CD there's one large VMware image containing everything for those who don't have a lab environment set up already.

*rubs hands together with childish glee*
15  Ethical Hacking Discussions and Related Certifications / Other / Re: Do we or Dont we... on: December 01, 2008, 09:23:46 AM
well done - that's a hard thing to do when it's family/friends you're working with.

sounds like you've made the right decision.


Pages: [1] 2 3 4
Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2007, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.07 seconds with 21 queries.
 
Sponsors

cwnp_moto__120x90.gif

Polls
How many security events including conferences and training do you attend a year:
 
Support EH-Net


Support EH-Net by
Buying all of your
Amazon items using
the search bar above.

cbtnuggets_logo_125.jpg
Try CBT Nuggets Free!
Recent Forum Topics
Vote For EH-Net

progenic.com
Click here to Vote!

binarica.com
Binarica Logo

Add to Technorati Favorites
technorati fave

 
         
Advertisement

© 2009 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.