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





Controlling iPhones in your enterprise

iPhone 2.0 is really cool and it will, like all other Microsoft Mobile devices, allow the user to synchronize their email to the device unless you take action to prevent it.   Whether you plan to support the iphone or not you will need to take some steps if you want any control of the devices in your enterprise.   See these arguments in support of the iPhone.  And this organization that suggests not supporting it.  

If your not supporting iPhones you have a couple of options.   You can block the requestes based on their User-Agent by using isapirewrite as I suggested in an earlier blog.   The iPhones USER-AGENT string is  Apple-iPhone/501.347 so your new isapi filters begin to look like this..

RewriteEngine  on

#Block Blackberry, iphones and other smartphones

RewriteCond %{HTTP:User-Agent}  (?:BWC.Worker.*|BWC.Engine.*|MSFT-SPhone.*|PalmOne-TreoAce.*|AvantGO.*|Apple-iPhone.*) [NC]  

RewriteRule .? -  [F,L]  


This is a good approach for handling any devices that use WEBDAV or OWA Screen scraping (such as Entourage and Blackberry) to synchronize to handhelds.
Alternatively, since the iPhone is a Microsoft ActiveSync device you can block it by disabling ActiveSync on your exchange server.  I will describe that process in this article.

If you plan to allow the iPhone but want to control who can use it you will need to make some changes.  By default anyone with iPhone 2.0 software can point their phone at your webmail server and start storing email.     To prevent this from happening you need to set the users msExchOmaAdminWirelessEnable attribute to a value of 7.  By default its value is NULL which allows all ActiveSync functions.   (Default ALLOW... Thanks Microsoft)
I like a little control over who is storing corporate emails on mobile devices.   Like minded corporations will need to run a script nightly that disables active sync for new users that are added to your network.  Microsoft has a sample script that will disable active-sync for unconfigured users.   The script takes user objects where the msExchOmaAdminWirelessEnable is NULL (unconfigured) and sets them to a value of 7 which disables ActiveSync.  Download the sample script here.

Here is an explanation of the msExchOmaAdminWirelessEnable attribute:

1 (bit 0) = 1 to disable Server Activesync, 0 to enable it

2 (bit 1) = 1 to disable OMA, 0 to enable it

4 (bit 2) = 1 to disable Always Up-To-Date (AUTD), 0 to enable it 

1 + 2 + 4 = 7 = All ActiveSync Features disabled


When you want to enable a user you will need to set the value to 0 (ZERO).  A value of 0 (Zero) enables all ActiveSync Functions.    This can be enabled through the Exchange Admin tool on the "EXCHANGE FEATURES" tab.

If you enable it you will want to consider enabling some security controls.   The iPhone and Microsoft ActiveSync falls short (by a long shot) of the controls you have with Blackberry enterprise.   Most notably in  my opinion is the lack of device encryption.   But you can enable some features such as requiring passwords on the device, inactivity timeouts, wiping the device after a number of failed login attempts and remote "Wipe" of the device.    These policies are set on your exchange server using Microsoft Tools.

You can also try the Apple utility, but it lacks central enforcement and users can simply choose not to use it.  It is more of a configuration convenience than a security policy enforcement tool.  If you try to use that tool, but do not address the fundamental problem of ActiveSync being enabled by default for everyone, then users can simply point to your web server and ignore your Apple XML based configuration.

Note "Wipe" is in quotes.  If you "Wipe" the device using the ActiveSync functions built into exchange it appears to just put the device in recovery mode requiring the reinstallation of the iPhone software.   I somewhat doubt that this actually wipes the device.   It will be interesting to check that out after I get dd on my 2.0 phone.  

I also found it interesting that once the "WIPE" command is sent from Exchange, it continues to send the command until you tell it to stop.    This will put iPhone users in a circular loop of Wipe, Reinstall,  Restore backup (which contains Exchange settings), and the phone is IMMEDIATELY wiped again if they have PUSH email enabled.    The users only choice is to setup the iPhone as a new device and not restore that backup again.   





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 …