LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 05-11-2012, 11:29 AM   #1
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Rep: Reputation: Disabled
Angry shellcode


Given below a shellcode,
char shellcode[] =
<moderated>



What it means(that is what is \x31 ,\xc0 etc.)?

Is shell code and assemby language are SAME?what is the difference? Where can i get complete shell code tutorial??

Last edited by colucix; 05-20-2012 at 12:44 PM. Reason: Removed potential dangerous code
 
Old 05-11-2012, 12:05 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,333

Rep: Reputation: Disabled
The Wikipedia article on shellcode is quite informative.

\x31 means "the number 31 in hexadecimal", which is 49 in decimal, and in this case represents some kind of instruction to the target CPU.

Shell code is machine code (for a specific CPU). Assembly language is a human-readable representation of machine code.
 
1 members found this post helpful.
Old 05-11-2012, 12:08 PM   #3
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by mr.cracker View Post
Given below a shellcode,
char shellcode[] =
<moderated>


What it means(that is what is \x31 ,\xc0 etc.)?
basically, what you show is just a string that consists of an apparently arbitrary sequence of bytes. In C, you can use the escape sequence \xHH, where HH is the hexadecimal representation of a byte.
I have no idea why the programmer calls it shellcode, nor in what context this byte sequence makes sense.

Quote:
Originally Posted by mr.cracker View Post
Is shell code and assemby language are SAME?
No. There is no such thing as shellcode, that's probably an invented name the programmer chose as being appropriate for what he's about to do. Hence your follow-up question for the difference is meaningless.
Looking at the strange byte sequence, however, it could possibly be machine code.

[X] Doc CPU

Last edited by colucix; 05-20-2012 at 12:45 PM. Reason: Removed quoted potential dangerous code
 
Old 05-11-2012, 12:31 PM   #4
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Original Poster
Rep: Reputation: Disabled
Question doubt

Quote:
Originally Posted by Ser Olmy View Post
The Wikipedia article on shellcode is quite informative.

\x31 means "the number 31 in hexadecimal", which is 49 in decimal, and in this case represents some kind of instruction to the target CPU.

Shell code is machine code (for a specific CPU). Assembly language is a human-readable representation of machine code.

How do u know num 31 in hex is 49 in decimal..Where can i study this.and how can i study machine language for my cpu?? if u know pls help me
 
Old 05-11-2012, 12:54 PM   #5
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
http://www.statman.info/conversions/hexadecimal.html will convert for you, or you can look up hexadecimal. Which CPU do you have? Something like http://www.cin.ufpe.br/~if817/arquiv...tut/index.html will get you started, anyway...
 
Old 05-13-2012, 10:19 AM   #6
mr.cracker
Member
 
Registered: May 2012
Posts: 58

Original Poster
Rep: Reputation: Disabled
Question

Quote:
Originally Posted by Snark1994 View Post
http://www.statman.info/conversions/hexadecimal.html will convert for you, or you can look up hexadecimal. Which CPU do you have? Something like http://www.cin.ufpe.br/~if817/arquiv...tut/index.html will get you started, anyway...

What u mean by CPU?? The company of my cpu??
Otherwise My processor is intel core i3. So where can i study my machine code and assemby language for my processor???
 
Old 05-14-2012, 10:49 AM   #7
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
I don't know exactly how much it changes between the different intel processors (I know that at least when they first boot, they all behave identically - I would imagine they are mostly backwards-compatible) but the ultimate reference guides will be here:http://www.intel.com/content/www/us/...r-manuals.html. I didn't download any 'cos they're massive, but I'm almost certain they will have a complete list of opcodes.
 
Old 05-20-2012, 12:52 PM   #8
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
Originally Posted by mr.cracker View Post
How do u know num 31 in hex is 49 in decimal..Where can i study this.and how can i study machine language for my cpu?? if u know pls help me
Look at the ASCII table: http://www.asciitable.com/.

Such a basic question make me suspect you've not the experience to manage a shellcode, not to mention its use and intent is mostly malicious. For this reason I removed the code posted above and close the thread. Feel free to ask for basic and generic questions in the future, but nobody here at LinuxQuestions is entitled to provide help in writing or understanding this kind of code, since it would be against our policy and philosophy. If you want to be a cracker (shame of you) as your nickname reveal, this is not the right place to start. Nuff' said.
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] C Linux Shellcode, with a catch! southpau1 Programming 9 09-26-2011 02:45 PM
shellcode for remote bf Ephracis Linux - Security 3 06-04-2005 11:10 AM
Shellcode question invisibleghost Programming 3 11-08-2004 07:02 PM
Error trying to execute shellcode Corallis Linux - Newbie 6 01-28-2004 12:46 PM
shellcode question korbin Linux - Newbie 1 01-11-2004 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration