Privilege escalation

One of the fun parts!

Windows

Windows versions

Clients

Windows OS                    Version Number

Windows 1.0                    1.04
Windows 2.0                    2.11
Windows 3.0                    3
Windows NT 3.1                 3.10.528
Windows for Workgroups 3.11    3.11
Windows NT Workstation 3.5     3.5.807
Windows NT Workstation 3.51    3.51.1057
Windows 95                     4.0.950
Windows NT Workstation 4.0     4.0.1381
Windows 98                     4.1.1998
Windows 98 Second Edition      4.1.2222
Windows Me                     4.90.3000
Windows 2000 Professional      5.0.2195
Windows XP                     5.1.2600
Windows Vista                  6.0.6000
Windows 7                      6.1.7600
Windows 8.1                    6.3.9600
Windows 10                     10.0.10240

Servers

Users

Which user privileges do we have?

Which users are there?

Maybe we are local admin already?

Credential manager

Currently cached Kerberos tickets (and maybe some info about other network components)

Are there other logged in users?

Passwords

Password hashes

If domain controller, search for the "cpassword" within the groups.xml:

Search for passwords

Search for files that contain "password" in the filename:

Search for "password" in files:

Some common files:

Moaaahr files:

Unquoted Service Path

AlwaysInstallElevated

Check if the following registry settings are set to "1"

If so, create your own malicious MSI that will add a local user

And execute

upnp host

Got an error for a missing dependency?

Or just remove the dependency:

Scheduled tasks

List scheduled tasks

Running processes linked to services

PowerShell tools

PowerUp.ps1

Checks for common Windows privesc vectors

Download at target:

Add to bottom:

Run:

Sherlock.ps1

Download at target:

Add to bottom:

Run:

Nishang

Cross compiling

Compile Windows exploit in Linux

Compile Python script to executable

Misc

Windows remote exploits

Windows local exploits

Precompiled exploits

Linux

Sudo

Becoming a super hero is a fairly straight forward process:

circle-info

The root user can execute from ALL terminals, acting as ALL (any) users, and run ALL (any) command.

circle-info

The user john can from any terminal, run the command power off using john's user password.

circle-info

The user john can from any terminal, run the command scp as root user without password.

Below a selection of gotmi1k's privesc blogarrow-up-right which I use a lot.

Distribution type & kernel version

Default writeable directory / folder

Search for passwords

Search for password within config.php

Search at whole system

Moaaar grepping

Find possible other writeable directory / folder

Service(s) running as root user

Installed applications

Scheduled jobs

Search for juicy shizzle

Find pattern in file:

SSH

https://www.ssh.com/ssh/arrow-up-right

Host keys

authorized_keys Contains the signature of the public key of any authorised client(s), in other words specifies the SSH keys that can be used for logging into the user account for which the file is configured. This file lets the server authenticate the user.

id_rsa Contains the private key for the client. This RSA key can be used with SSH protocols 1 or 2.

id_rsa.pub Contains the public key for the client

id_dsa Contains the private key for the client. This (insecure) DSA key only can be used with SSH protocol 2.

id_dsa.pub Contains the public key for the client

known_hosts Contains a list of host signatures for hosts the client has ever connected to.

Search for RSA private keys

Search for DSA private keys

Sticky bit, SGID, SUID, GUID

Sticky bit

SGID (chmod 2000)

SUID (chmod 4000)

SUID or GUID

Example SUID exploitation

The following file has the SUID bit set:

We can use this to execute nano and then add a new root user to /etc/passwd. The next step is to create a password "hodor" with salt "hodor":

Add to /etc/passwd using nano:

Switch to new user:

Add user to /etc/passwd and root group

Enumeration tools

Linenum.sh https://raw.githubusercontent.com/rebootuser/LinEnum/master/LinEnum.sharrow-up-right

LinPrivChecker.py https://github.com/reider-roque/linpostexp/blob/master/linprivchecker.pyarrow-up-right

Linux local exploits

Precompiled exploits

Last updated