Skip to content
Misconfiguration Write-up Intermediate

Exploring Weasel: A Windows Privilege Escalation Journey

A Jupyter Notebook login token was found in an SMB share, allowing access to a terminal as a low-privilege user. The user could run a missing file with sudo, leading to root access in WSL, and then escalate to Windows administrator via AlwaysInstallElevated.

0xViKi Follow

Published on systemweakness.com

{{media:0}}

0xViKi, on systemweakness.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely multiple issues: a sensitive token stored in an SMB share, a sudo rule allowing execution of a non-existent file, and the AlwaysInstallElevated registry setting enabled.

Impact

An attacker could gain root access in WSL and then administrator privileges on the Windows system, leading to full control.

What the attacker needed

Access to SMB share; Jupyter token in share; sudo rule for missing file; AlwaysInstallElevated enabled

How it was found

  1. Scan the target with Nmap to find open ports and services.
  2. Enumerate SMB shares and find a file containing a Jupyter Notebook login token.
  3. Use the token to log into Jupyter Notebook and access a terminal as a low-privilege user.
  4. Run sudo -l to find a sudo rule for a missing file, then copy bash to that path and execute it with sudo to get root in WSL.
  5. Mount the Windows C: drive from WSL and find user profiles, then connect via SSH to a low-privilege Windows user using a discovered SSH key.
  6. Run WinPeas to find AlwaysInstallElevated set to 1, then use Metasploit to escalate to administrator.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A shared folder on a Windows machine contained a secret token that let the tester log into a Jupyter Notebook web page. That page had a terminal, and from there the tester found a way to become the most powerful user on the system, then used a Windows setting to become administrator.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.