Skip to content

Linux escalate steps

lethanhtung01011980 edited this page Apr 23, 2020 · 19 revisions

Goals

  • From nobody to user
  • From User to root

LinEnum to check vulnerability

Already have shell access

From nobody to normal user

Methods

  • Can attack using user with same uid and gid as with victim uer in victim PC
  • Via NFS root_squash,no_all_squash

To use setuid to execute as a user

image

image

Try to generate ssh key to login as a user

  • root is attacker user in Kali. frank is victim user in victim PC.
  • In attacker, ssh-keygen to generate private / public key with id-frank file name.
  • Copy public key of attackers to victim's /home/frank/.ssh/authorized_keys
  • Attacker to login as frank: ssh -i /root/.ssh id-frank frank@victim-ip

From user to root

To if can run sudo with "NOPASSWD" aka as root:

  • sudo -l
  • User frank may run the following commands on this host:
  • (frank) NOPASSWD: /opt/logreader/logreader.sh
  • (adm) NOPASSWD: /usr/bin/rvim /var/www/html/jailuser/dev/jail.c

If see "Vim: Warning: Output is not to a terminal"

  • Type ZQ

keybase-redirector PoE

Or run LinEnum

Sidebar

0. COMMON exploits

1. Scan Info

1.2 Passive Gathering

1.3 Active Gathering

2. Pre-attack

2.2 File transfer

3. Get Reverse Shell

4. Exploits

4.2 Windows Exploits

4.3 Linux Exploits

4.4 Password crack

4.5 Buffer Overflow

4.6 Web attacks

6. Escalate Privilege

6.1 Escalate in Windows

6.2 Escalate in Linux

7. Access and further attacks

8. Port redirection and Tunnelling

9. Metasploit

10. Kali

11. Thirdparty scripts

Clone this wiki locally