View Full Version : Find out the address of bin/sh?
yasokrish
April 1st, 2010, 05:20 PM
Hi,
How to put the string "/bin/sh" into the memory, and get its address. ???
I read this can be done with the help of Environment variables?
Am new to linux ,please do explain step by step by procedure...
Very urgent..pl do help..
Thank you,
yasokrish.:confused:
yasokrish
April 1st, 2010, 05:23 PM
Hi,
How to put the string "/bin/sh" into the memory, and get its address. ???
I read this can be done with the help of Environment variables?
Am new to linux ,please do explain step by step by procedure...
Very urgent..pl do help..
Thank you,
yasokrish.:confused:
DrMelon
April 1st, 2010, 05:27 PM
First things first, what is this for? Is it a programming problem? If it's a programming issue, which language are you using?
Please give us more information! :KS
yasokrish
April 1st, 2010, 05:36 PM
Hi,
How to put the string "/bin/sh" into the memory, and get its address. ???
I read this can be done with the help of Environment variables?
Am new to linux ,please do explain step by step by procedure...
Very urgent..pl do help..for my project?
Thank you,
yasokrish.:confused:
yasokrish
April 1st, 2010, 05:38 PM
Hi,
How to put the string "/bin/sh" into the memory, and get its address. ???
I read this can be done with the help of Environment variables?
Am new to linux ,please do explain step by step by procedure...
Very urgent..pl do help..
Thank you,
yasokrish.:confused:
yasokrish
April 1st, 2010, 05:49 PM
Hi,
Am doing the project "return to libc attacks"
I am doing it in C language.
:)
Thank u,
yasokrish.
yasokrish
April 1st, 2010, 05:51 PM
Hi,
Am doing a project "Return to libc attacks"
Am doing the project in C programming.
Thanks,
Yasokrish
Chesamo
April 1st, 2010, 05:53 PM
Create an array of eight characters and set its value equal to "/bin/sh\0".
Print the address by casting the array as an unsigned int and using printf. (Remember that the name A of an array A[] is the same as &A[0].)
I'm not going to give you the code (http://catb.org/~esr/faqs/smart-questions.html#homework), but there's the logic.
HellBoz
April 1st, 2010, 06:35 PM
string sh = "/bin/sh";
string * shPointer = &sh;
Memory address of < /bin/sh >: 0x22ff30
lisati
April 1st, 2010, 06:37 PM
Multiple threads with the same question. Not cool.
cubeist
April 1st, 2010, 06:40 PM
This sort of sounds like a homework problem and we don't complete other people's homework on these forums; however, we are always happy to offer hints.
Edit - provided a solution to a different thread...oops!
lisati
April 1st, 2010, 06:43 PM
Edit: see below
Please don't create multiple threads on the same subject. I have merged your 4 threads.
cariboo
April 1st, 2010, 06:48 PM
Please don't create multiple threads on the same subject. I have merged your 4 threads.
Cracauer
April 1st, 2010, 09:59 PM
The OP makes it very clear that his assignment is writing a break-in into some software package, presumably starting out from minimal code inserted via a buffer overflow.
Specifically he has been instructed to use the current techniques to get around newish OSes improved page protection schemes that block straight buffer overflow exploits (place code, then overwrite function return address to jump there).
So help him already, you slackers :)
yasokrish
April 2nd, 2010, 07:20 AM
HI,
Am doing a project on "return to libc attacks"
To put the string "/bin/sh" in the memory and find out the address,
this code is being used.
Can anyone explain on this?
Why do we use export? and use of export should be done inside the porgram or in terminal?
am new user of linux and c programming.
Pl do explain?
Thanks,
Yasokrish
---------------------------------------------
$ export MYSHELL=/bin/sh
void main(){
char* shell = getenv("MYSHELL");
if (shell)
printf("%x\n", (unsigned int)shell);
}
-------------------------------------------------
gnometorule
April 2nd, 2010, 07:54 AM
Export is a command of the Unix shell. What you see in the same line right after it; defines a (temporary) Unix shell variable. 'Export' makes the scope of that variable global, so you can use it later as you see.
yasokrish
April 2nd, 2010, 02:49 PM
Thanks a lot :)
bapoumba
April 3rd, 2010, 09:34 AM
One additional thread merged..
yasokrish
April 3rd, 2010, 02:39 PM
Can anyone explain me the usage of export with examples.
To find the address of "/bin/sh" in c programming.
Thank u,
yasokrish
Sef
April 3rd, 2010, 03:13 PM
Merged threads. Please do not open up a new thread on the same topic. Thank you.
cubeist
April 3rd, 2010, 06:49 PM
Can anyone explain me the usage of export with examples.
To find the address of "/bin/sh" in c programming.
Thank u,
yasokrish
Go Away, go use Google like the rest of us.
http://www.lmgtfy.com/?q=export+bash (http://www.lmgtfy.com/?q=export+bash)
Powered by vBulletin® Version 4.2.2 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.