Why you should always scan UDP ports (1/2)
An SNMP service exposed with the default community string allowed enumeration of running processes, which revealed a Jenkins password. The attacker used that password to access Jenkins and its scripting console to obtain a reverse shell.
medium.com
Published on medium.com
Link to part 2
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 the SNMP service used the default read-only community string and exposed process command lines containing a Jenkins credential, and the Jenkins scripting console was enabled.
Impact
The attacker could gain a shell on the Jenkins host, and the text says this allowed taking control of the whole network.
What the attacker needed
SNMP reachable over UDP; default community string in use; Jenkins console enabled
How it was found
- Scan UDP ports and find an open SNMP port.
- Use nmap SNMP scripts and snmpwalk to enumerate the device.
- Run the snmp-processes script to list running processes.
- Extract the Jenkins password from a process command line.
- Log in to Jenkins and open the scripting console.
- Run a reverse shell script from the console to get a shell.
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.
SNMP is a protocol for monitoring network devices, and many devices ship with a default read-only password called a community string. If that default is left in place, anyone can query the device and see details such as running processes. Here, one of those processes had a password typed on its command line, which gave the attacker access to a Jenkins server.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.