Posted on

SetUID privilege escalation in Linux

Hello, aspiring Ethical Hackers. In this article, you will learn how to perform SetUID privilege escalation in Linux. In our previous article, we have exploited cron jobs to change SetUID bit of an executable. What exactly is a SetUID bit?

SETUID stands for Set User ID on execution. This allows a user with low privileges to run a command with higher privileges. The difference between SUDO and SETUID is that in SUDO you can execute a command only if the root user can do it.

With the concept of SETUID understood, let’s see how binaries with SETUID bit set can be found. One way to find them is by using find command as shown below.

setuid privilege escalation


Here are some examples of gaining root privileges by exploiting programs with SETUID bit set.

1. bash

Emp116

2. csh

Emp117

3. env

Emp117 1

4. nice

Emp119

5. node

Emp120

6. setarch

Emp121

7. stdbuf

Emp122

8. strace

Emp123

9. taskset

Emp124

10. tclsh

Emp125

11. time

Emp126

12. timeout

Emp127

13. unshared

Emp128

14. xargs

Emp129

15. php

Emp130

16. expect

Emp131

17. find

Emp132

18. python

Emp133

19. flock

Emp134

20. gdb

Emp135

21. ionice

Emp136

22. logsave

Emp137

23. make

Emp138

These are some examples of linux privilege escalation by exploiting SETUID bit.

Follow Us