Privilege Escalation Flashcards

1
Q

Name three popular privilege escalation enumeration scripts for Linux

A

LinEnum

Linuxprivchecker

LinPEAS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name two popular privilege escalation enumeration scripts for Windows

A

Seatbelt

JAWS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Older/unpatched systems can be vulnerable to exploits within the OS.

A

Kernel Exploits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In Linux how do we check all installed software on a system.

A

dpkg –l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In Windows where do we check all installed software on a system.

A

C:\Program Files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Name some common ways to exploit user privileges

A

Sudo

SUID

Windows Token Privileges

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Command used to check sudo privileges

A

sudo –l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

sudo –l output that says we can run all commands with sudo.

A

GhostfaceDinna@htb[/htb]$ sudo -l

[sudo] password for user1:

…SNIP…

User user1 may run the following commands on ExampleServer:

(ALL : ALL) ALL
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to escalate our privileges knowing we can run all commands with sudo?

A

sudo su -

[sudo] password for user1:
whoami
root

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the NOPASSWD entry in the sudo –l output tells us?

A

That the /bin/echo command can be executed without a password

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to privilege escalate the NOPASSWD entry?

A

sudo -u user /bin/echo Hello World!

Hello World!
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When we find a certain application that runs via sudo, we can use it to exploit and escalate our privileges. Name a couple of websites.

A

GTFOBins contains a list of commands and how they can be exploited through sudo.

LOLBAS contains a list of Windows applications that can leverage to perform certain functions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can we priv escalation, if we can write to a cron job directory.

A

We can write a bash script with a reverse shell command. Which will send us a reverse shell when executed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

In Linux what are some cron directions to check to determine if we have write permissions over them?

A

/etc/crontab

/etc/cron.d

/var/spool/cron/crontabs/root

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Where are some common places to find files with exposed credentials?

A

Configuration files

Log files

User history files (bash_history in Linux PSReadLine in Windows).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Where are some locations of .ssh directories?

A

/home/user/.ssh/id_rsa or /root/.ssh/id_rsa

17
Q

If we have read access over the .ssh directory, what can you do?

A

You may be able to read the private ssh keys found in the directory.

18
Q

Syntax for using a private key

A

vim id_rsa

chmod 600 id_rsa – read/write current user

ssh root@10.10.10.10 -i id_rsa

19
Q

If we have write access to a user’s /.ssh/ directory, what can we do?

A

We can place our public key in the user’s ssh directory at /home/user/.ssh/authorized_keys. This technique is used to ssh after we’ve already gained a shell.

20
Q

Syntax for generating public key

A

ssh-keygen -f key

Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): ***
Enter same passphrase again: **
*

Your identification has been saved in key
Your public key has been saved in key.pub
The key fingerprint is:
SHA256:…SNIP… user@parrot
The key’s randomart image is:
+—[RSA 3072]—-+
| ..o.++.+ |
…SNIP…
| . ..oo+. |
+—-[SHA256]—–+

21
Q

ssh-keygen and the flag for specifying the output file.

A

-f <filename></filename>

22
Q

What two files are outputted by ssh-keygen? (name of the file is key)

A

key - (which we’ll use with ssh -i)
key.pub - which we will copy to the remote machine

23
Q

Copy the key.pub what directory on the remote machine?

A

/root/.ssh/authorized_keys

24
Q

SSH flag for logging into remote machine with a private key.

A

-i <private></private>