Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6697903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:30:54+00:00 2026-05-26T06:30:54+00:00

I am using bash. I have switched off ASLR in Ubuntu 11.04 using #sysctl

  • 0

I am using bash. I have switched off ASLR in Ubuntu 11.04 using

#sysctl -w kernel.randomize_va_space=0

And I have exported a variable from the shell using

$ export MYSHELL=/bin/sh

I wrote a C program to get the address of the MYSHELL:

void main(){
char* shell = getenv("MYSHELL");
if (shell)
    printf("0x%x\n", (unsigned int)shell);
}

It spat out 0xbffffe82.
When I used it as a part of my attack for ret-to-libc, the address changes (although by a very small offset).
Why does this happen?

Also when I change the filename of the binary and use the previously successful address, it won’t work, and it has been relocated to a different address. Why? In other words, What is the relation of binary names and environment variable addresses? Is this a protection feature by bash? How do I switch this off?

Note: this is not homework.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:30:54+00:00Added an answer on May 26, 2026 at 6:30 am

    Stack layout at program startup is documented here. It should be obvious why changing the name of the program (length really) changes the layout.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working solaris 10 and using bash shell. I have a shell script
Using bash, I have a list of strings that I want to use to
I have an xml file that I want to configure using a bash script.
I am trying to pull dynamics from a load that I run using bash.
I am using bash on CentOS 5.5. I have a string separated by space
I have been using 'bash' since the time I have been using Unix- Linux/Solaris.
I'm using linux and bash I have two files filea.wav and fileb.wav which are
I'm using bash shell. Hi,ppl Would be glad if someone could provide some kind
I'm using bash. Suppose I have a log file directory /var/myprogram/logs/ . Under this
Using bash, is it possibile to send the equivalent of a space bar stroke

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.