Linux Privilege Escalation (Part 3 of 3)

 






SUID Executables

SUID is a type of permission that enables the user to execute a file with the owner's privilege. However, there are many reasons for setting this permission. For example- the ping software requires root access to start a network socket, but regular users may also use to check connection with other servers.

Having SUID permission allows many existing binaries and tools that can used to elevate rights to root. Some of the Linux executables that offers privilege escalation are nmap, vim, find, bash, etc. 

Password Attacks

Passwords are the most fundamental forms of user account and service authentication. Thus password attacks aims to find and utilize legitimate credentials to access a user. Typically, two types of techniques are used to execute password attacks. One of them is brute force attack where the penetration tester will try to guess the user's password. The other one is the dictionary attack where multiple different word lists are utilized to try and guess the user's password. Hence, brute force promotes password coverage at the price of speed, whereas dictionary attack is all about speed with less password coverage. The penetration tester can employ any technique successfully and accordingly.

Wordlists are often called dictionary files, they are simple text files containing words that can be entered in the applications to check passwords. These dictionary files can be found online and also in the /usr/share/wordlists/directory of Kali Linux. However, if the tester takes some time to create custom unique wordlists, then he will be more successful. 

Taking advantage of human errors is another way of finding passwords. Many times users accidentally type their passwords in terminal instead of a password prompt. It creates an opportunity for the tester to easily discover the user's password via history file of the home directory. This can be checked with cat / . * history command. Also, passwords in plaintext or other reversible forms are frequently found in configuration files. Finally, users occasionally create backups of crucial data but neglect to provide them with proper permission or protection. The penetration tester should keep these things in mind while trying to discover the user password. 

Linux Kernel Exploits

Many kernel exploits nave been discovered till now and are a great way to move laterally and escalate user privileges. However, their effectiveness may rely on how well they fit the target's operating system, like Debian, Redhat, Gentoo, in addition to the kernel version. So this must be the last resort. The kernel exploits exhibits unpredictable behavior that may make the target system unstable. Hence the penetration tester may try and compile the exploitation code on the targeted system. Because compiling in a different machine with different hardware and kernel may altogether fail the executable or improper execution.  Some known Linux kernel exploits are Dirty cow, Polkit, Dirty pipe, etc. 

Both human and automated enumeration are possible. 

Conclusion

All the parts of this topic are completed and we learned more about executables, attacks, and exploits. 










































Comments

Popular posts from this blog

Query, Visualize, & Monitor Data in Azure Sentinel

Planning for Implementing SAP Solutions on Azure (Part 2 of 5)

Work with String Data Using KQL Statements