Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,617 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 990 people online right now. Registration is fast and FREE... Join Now!




Shell Code?

 
Reply to this topicStart new topic

Shell Code?

Israel
post 20 Feb, 2006 - 08:54 PM
Post #1


D.I.C Addict

Group Icon
Joined: 21 Nov, 2004
Posts: 604



Dream Kudos: 175
My Contributions


Ok, I've looked in this tutorial and it was talking a lot about shell code. It looked like hexdecimal to me. But when I looked up on wikipedia it said that it was assembly? I don't know, but this is part of what the tutorial showed:

CODE
\x55\x89\xe5\x57\x56\x53\xe8\x00\x00\x00\x00\x5b\x83\xc3\xf5\
x8d\xb3\x50\x00\x00\x00\xfc\x8d\x7d\xd8\xb9\x03\x00\x00\x00\xf3\xa5\
x66\xa5\x83\xe4\xf0\xbf\x01\x00\x00\x00\x8d\x4d\xd8\xba\x0e\x00\x00\
x00\xb8\x04\x00\x00\x00\x53\x89\xfb\xcd\x80\x5b\x89\xf8\x53\xbb\x00\
x00\x00\x00\xcd\x80\x5b\x8d\x65\xf4\x5b\x5e\x5f\xc9\xc3\x48\x65\x6c\
x6c\x6f\x20\x77\x6f\x72\x6c\x64\x21\x0a\x00


I know this is not assembly but what is it? Hex?
User is offlineProfile CardPM

Go to the top of the page

Nova Dragoon
post 20 Feb, 2006 - 11:46 PM
Post #2


The Innocent Shall Suffer, Big Time

Group Icon
Joined: 16 Aug, 2001
Posts: 6,128



Thanked 4 times

Dream Kudos: 515

Expert In: Python, Linux

My Contributions


Assembly is just memonics on cpu instructions which are 1s and 0s, which can be represented in hex.

When you assemble an assembly program to create a BINARY, your doing just what I described.

Really before you get into shellcode, you need to know how a program works to its very very core, how its loaded, how memory addresses work in it. Its segements code,data,etc. You need to get that down pat. Because the shell code you write will be specific to a particular compile of a particular version of a particular program. Its a very tricky process, and you need very very strong roots in funamentals, such as program implentation.


For realz
User is offlineProfile CardPM

Go to the top of the page

Israel
post 21 Feb, 2006 - 03:22 PM
Post #3


D.I.C Addict

Group Icon
Joined: 21 Nov, 2004
Posts: 604



Dream Kudos: 175
My Contributions


I've read some about assembly and NASM. Probably not nearly enuf to be where your talking about... But do you have any suggested readings? By the way, I'm really just wanting to know what kind of why code it was. For the purposes of the tutorial I'm using I don't really need to know hex or assembly. I know I can take a hex editor and do what I need I've just never seen hex like that. (if that's what it is) But I've always seen it like this:

CODE
67 0F 01 13


or

CODE
67h 0Fh 01h 13h


not

CODE
x8d\xb3\x50\x00\x00\x00\xfc\x8d\x7d\xd8\


This post has been edited by Israel: 21 Feb, 2006 - 05:33 PM
User is offlineProfile CardPM

Go to the top of the page

Nova Dragoon
post 21 Feb, 2006 - 11:41 PM
Post #4


The Innocent Shall Suffer, Big Time

Group Icon
Joined: 16 Aug, 2001
Posts: 6,128



Thanked 4 times

Dream Kudos: 515

Expert In: Python, Linux

My Contributions


whats between the x and the \ is a byte in hex representation. In C you use this style to specify hex in a char string.

As for readings, to really need to get to know assembly, and the stack, and the heap, and pretty much how a program works from its highest form (in C language for example) all the way down through the complier, linker, and loader. Then thats a basis. Learn to use GDB well, very well.


After you've really really got the basics down, you may want to check out a book called "The Shellcoder's handbook" But if you jump into something of that level, without having the basis really down, then you will get lost very quickly. Especially trying to keep up with examples, when they are using 4 year old + compilers in the book, and you wonder why your code compiled in GCC 4 isnt working.
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 03:10AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month