Friday, September 22, 2017

DerbyCon 7: DeepBlueCLIv2 Talk and links

Here's a link to my DerbyCon 7 talk: Introducing DeepBlueCLI v2, Now Available in PowerShell and Python

Last year's talk: http://www.ericconrad.com/2016/09/deepbluecli-powershell-module-for-hunt.html

 DeepBlueCLIv2

References:
  1. Deconstructing Petya: how it spreads and how to fight back, https://nakedsecurity.sophos.com/2017/06/28/deconstructing-petya-how-it-spreads-and-how-to-fight-back/
  2. Mandiant M-Trends 2015, https://www2.fireeye.com/rs/fireye/images/rpt-m-trends-2015.pdf
  3. Command Line Kung Fu Episode #31: Remote Command Execution, http://blog.commandlinekungfu.com/2009/05/episode-31-remote-command-execution.html
  4. https://github.com/jaredhaight/PSAttack
  5. https://github.com/darkoperator/Posh-VirusTotal
  6. https://www.virustotal.com/en/documentation/public-api/
  7. http://blog.securityonion.net/2017/09/elastic-stack-alpha-release-and.html
  8. https://github.com/philhagen/sof-elk
  9. https://nxlog.co/products/nxlog-enterprise-edition
  10. https://github.com/williballenthin/python-evtx
  11. https://github.com/libyal/libevtx

Sunday, April 16, 2017

ShadowBrokers PCAPs, etc.

I spent some time enjoying Easter Sunday by analyzing the Shadowbrokers EternalBlue attacks vs. a Windows 7 system. It is a service-side attack vs. TCP port 445. On Monday I analyzed EternalRomance and DoublePulsar.

I will update this post as I test other exploits and victim operating systems.

EternalBlue is the 2017 version of MS08-067, which was the last universal service-side vulnerability in Windows systems. EternalRomance is a similar SMB exploit.

I created EternalBlue PCAPs showing successful compromise vs. an unpatched system, reconnecting to a previously-infected system (using DoublePulsar), plus failed compromise vs. a patched system. I just added successful EternalRomance exploits.

PCAPs are here: https://cyber.gd/shadowbrokers

Includes:
  • eternalromance-success-2008r2.pcap (new)
  • eternalromance-doublepulsar-meterpreter.pcap (new)
  • eternalblue-success-unpatched-win7.pcap
  • eternalblue-failed-patched-win7.pcap
  • doublepulsar-backdoor-connect-win7.pcap
VirusTotal PCAP analysis (Includes both Snort and Suricata alerts):
I confirmed that MS17-010 mitigates this attack. Patch now!

Default Windows event logging shows nothing. Neither EMET nor Applocker stopped EternalBlue.

Promising Wireshark display filters to detect EternalBlue (unconfirmed; there may be false positives):
  • EternalBlue: smb.mid == 65
  • DoublePulsar: smb.mid == 81
I disabled SMB1 on Windows 7, which stopped EternalBlue with default settings. I need to test more since EternalBlue can allegedly use SMB2. EternalRomance appears to be SMB1-only.

SMB1 is awful, and should be disabled regardless (be sure to test).

It appears Windows 2003 and XP will be vulnerable forever, barring a change in policy by Microsoft.

DoublePulsar is the backdoor (which listens via SMB or RDP) installed by both EternalBlue and EternalRomance. It allows you to inject other DLLs or code. I used it to inject Metasploit's Meterpreter payload, which will probably be a common approach once attacks take off in the wild.

Monday, October 24, 2016

Quality not Quantity talk, commands, and links


Quality not Quantity: Continuous Monitoring's  Deadliest Events



Commands:

Search service creation events and errors:
PS> Get-WinEvent -FilterHashtable @{logname='system'; id=7045,7030}

User creation events and users added to local and global security-enabled group:
PS> Get-WinEvent -FilterHashtable @{LogName="Security"; ID=4720,4732,4728}

Full command line of all processes (requires https://support.microsoft.com/en-us/kb/3004375):
PS> Get-WinEvent -FilterHashtable @{Logname="Security"; ID=4688}

AppLocker Events (requires AppLocker):
PS> Get-WinEvent -FilterHashTable @{LogName="Microsoft-Windows-AppLocker/EXE and DLL"; ID=8003,8004}

Detect when EMET blocks malware (requires EMET):
PS> Get-WinEvent -FilterHashtable @{LogName="application"; ProviderName="EMET"; id=2}

References:

  1. Mandiant M-Trends 2016: https://www2.fireeye.com/rs/848-DID-242/images/Mtrends2016.pdf
  2. Verizon DBIR: http://www.verizonenterprise.com/DBIR/2015/
  3. USENIX Enigma 2016 - NSA TAO Chief on Disrupting Nation State Hackers https://www.youtube.com/watch?v=bDJb8WOJYdA
  4. Neiman Marcus Hackers Set Off 60,000 Alerts While Bagging Credit Card Data: http://www.bloomberg.com/news/articles/2014-02-21/neiman-marcus-hackers-set-off-60-000-alerts-while-bagging-credit-card-data
  5. The ASD 35 Strategies to Mitigate Targeted Cyber Intrusions: http://www.asd.gov.au/infosec/top-mitigations/mitigations-2014-table.htm
  6. Patch-crazy Aust Govt fought off EVERY hacker since 2013 http://www.theregister.co.uk/2015/06/02/patchcrazy_aust_govt_fought_off_every_hacker_since_2013/
  7. CIS Critical Security Controls: https://www.cisecurity.org/critical-controls/download.cfm?f=CSC-MASTER-VER%206.0%20CIS%20Critical%20Security%20Controls%2010.15.2015
  8. AppLocker: https://technet.microsoft.com/en-us/library/mt431813(v=vs.85).aspx
  9. AppLocker CSP: https://msdn.microsoft.com/library/windows/hardware/dn920019(v=vs.85).aspx
  10. Windows 10 Enterprise 90-day Trial: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise
  11. Microsoft EMET: https://support.microsoft.com/en-us/kb/2458544
  12. Enable Windows command-line auditing: https://support.microsoft.com/en-us/kb/3004375 
  13. Windows Commands Abused by Attackers http://blog.jpcert.or.jp/.s/2016/01/windows-commands-abused-by-attackers.html

Tuesday, August 09, 2016

Time is on your Side talk and links





Links from the talk:

Friday, April 01, 2016

Quality not Quantity talk, commands, and links

Quality not Quantity: Continuous Monitoring's  Deadliest Events

Commands:

Search service creation events and errors:
PS> Get-WinEvent -FilterHashtable @{logname='system'; id=7045,7030}

User creation events and users added to local and global security-enabled group:
PS> Get-WinEvent -FilterHashtable @{LogName="Security"; ID=4720,4732,4728}

Full command line of all processes (requires https://support.microsoft.com/en-us/kb/3004375):
PS> Get-WinEvent -FilterHashtable @{Logname="Security"; ID=4688}

AppLocker Events (requires AppLocker):
PS> Get-WinEvent -FilterHashTable @{LogName="Microsoft-Windows-AppLocker/EXE and DLL"; ID=8003,8004}

Detect when EMET blocks malware (requires EMET):
PS> Get-WinEvent -FilterHashtable @{LogName="application"; ProviderName="EMET"; id=2}

References:

  1. Mandiant M-Trends 2016: https://www2.fireeye.com/rs/848-DID-242/images/Mtrends2016.pdf
  2. Verizon DBIR: http://www.verizonenterprise.com/DBIR/2015/
  3. USENIX Enigma 2016 - NSA TAO Chief on Disrupting Nation State Hackers https://www.youtube.com/watch?v=bDJb8WOJYdA
  4. Neiman Marcus Hackers Set Off 60,000 Alerts While Bagging Credit Card Data: http://www.bloomberg.com/news/articles/2014-02-21/neiman-marcus-hackers-set-off-60-000-alerts-while-bagging-credit-card-data
  5. The ASD 35 Strategies to Mitigate Targeted Cyber Intrusions: http://www.asd.gov.au/infosec/top-mitigations/mitigations-2014-table.htm
  6. Patch-crazy Aust Govt fought off EVERY hacker since 2013 http://www.theregister.co.uk/2015/06/02/patchcrazy_aust_govt_fought_off_every_hacker_since_2013/
  7. CIS Critical Security Controls: https://www.cisecurity.org/critical-controls/download.cfm?f=CSC-MASTER-VER%206.0%20CIS%20Critical%20Security%20Controls%2010.15.2015
  8. AppLocker: https://technet.microsoft.com/en-us/library/mt431813(v=vs.85).aspx
  9. AppLocker CSP: https://msdn.microsoft.com/library/windows/hardware/dn920019(v=vs.85).aspx
  10. Windows 10 Enterprise 90-day Trial: https://www.microsoft.com/en-us/evalcenter/evaluate-windows-10-enterprise
  11. Microsoft EMET: https://support.microsoft.com/en-us/kb/2458544
  12. Enable Windows command-line auditing: https://support.microsoft.com/en-us/kb/3004375 
  13. Windows Commands Abused by Attackers http://blog.jpcert.or.jp/.s/2016/01/windows-commands-abused-by-attackers.html


    Friday, December 11, 2015

    CISSP Study Guide 3E - Shipping Now

    Just a note to say the CISSP Study Guide 3E is in stock and shipping from Amazon.





    Electronic editions should be available in January. We are working on the 11th Hour CISSP Study Guide update now, chapters are due by April (but I hope to have it done before then).

    Monday, November 23, 2015

    CISSP Study Guide 3E is Complete

    Lots of people have asked me for the release date of the CISSP Study Guide 3E. Amazon (now) lists December 29th, but it will be sooner.

    I can confirm the book done and is at the printers now. I ordered copies as a surprise Christmas gift for students of my MGT 414 class coming up at SANS CDI in 3 weeks, and Syngress has confirmed the books will ship by then.

    Tuesday, April 21, 2015

    MGT 414 and CISSP Study Guide Third Edition

    ISC2 recently updated the CISSP® exam, effective April 15th 2015. The biggest change: they went from 10 to 8 domains.

    SANS MGT 414 has been fully updated:
    Course authors Eric Conrad and Seth Misenar have revised MGT414 to take into account the 2015 updates to the CISSP® exam and prepare students to navigate all types of questions included in the new version. 
    MGT414 focuses solely on the 8 domains of knowledge as determined by (ISC)2 that form a critical part of CISSP® exam. Each domain of knowledge is dissected into its critical components, and those components are then discussed in terms of their relationship with one another and with other areas of information security.
    We are also working on the CISSP® Study Guide Third Edition. It is due out in November 2015. We will update the Eleventh Hour CISSP Study Guide after that.
    I have received a lot of questions regarding CISSP® Study Guide version 2E (and other books that predate this update). Here's ISC2's take:
    Q: Since the CISSP has changed from 10 to 8 domains, was some content deleted?
    A: No. Content was not removed from the exam and/or training material, but rather refreshed and reorganized to include the most current information and best practices relevant to the global information security industry.

    So all of the CISSP® Study Guide Second Edition material still applies, but new concepts have been added. See the CISSP® 2015 Candidate Information Bulletin for specific details on the testable topics. Here's Clement Dupuis' take on cccure.training.

    Clement also has a fantastic guide to the changes (with links to online sources of new material).

    Thursday, January 22, 2015

    Long Tail Analysis of Windows Event Logs



    This is a demo from a portion of lecture and lab from SEC511: Continuous Monitoring and Security Operations.

    Link to T510-security.evtx.

    Here are the PowerShell commands:

    # Black text on white background (thank you @MarkBaggett)
    PS C:\> cmd /c "color f0"

    # Pull all security events (Requires administrator PowerShell)
    PS C:\> Get-WinEvent -LogName security

    # Pull all security events, search for date, count lines  (Requires administrator PowerShell)
    PS C:\> Get-WinEvent -LogName security| findstr "1/19/2015"| Measure-Object

    # List all events in the file T510-security.evtx
    PS C:\> Get-WinEvent -Path .\T510-security.evtx

    # Show event 4624 from T510-security.evtx, format list output
    PS C:\> Get-WinEvent -FilterHashtable @{Path=".\T510-security.evtx"; ID=4624}| fl

    # Perform long tail analysis of T510-security.evtx
    PS C:\> Get-WinEvent -Path .\T510-security.evtx| Group-Object id -NoElement| sort count

    Friday, March 28, 2014

    Announcing: SEC511: Continuous Monitoring and Security Operations

    I am happy to announce that the first beta for SANS SEC511: Continuous Monitoring and Security Operations has been scheduled for June 16-21 in Washington DC. Seth Misenar and I wrote the class, and it's proven to be a very timely (and necessary) topic!

    I will teaching the first beta.

    Note: This course is eligible for special beta pricing. Please enter discount code SEC511-BETA1 when registering to take advantage of the special beta price of $2450.



     Link to the beta



    Tuesday, June 18, 2013

    Flyer for SANS Course SEC528: SANS CompTIA Advanced Security Practitioner (CASP) Certification course


    Special Beta pricing of $1995, plus $250 additional off when you use the code CASP_528B1. 

    Hope to see you in DC!




    Friday, May 03, 2013

    CompTIA CASP added to DoD 8570


    CompTIA's CASP exam has been added to DoD 8570 for the following roles: IAT Level III, IAM Level II, and IASAE Levels I and II.

    The beta run of my brand-new course: SEC528: SANS Training Program for the CompTIA® New Advanced Security Practitioner Certification™ has been scheduled in Washington DC the week of July 22nd.

    It's a 5-day course, with a great beta discount. Hope to see you there!

    Thursday, September 06, 2012

    SANS Webcast: Passing the CompTIA CASP Exam

    I'll be conducting a webcast on September 7th called Passing the CompTIA CASP Exam.

    If you miss the live webcast, an archive will be posted shortly thereafter.

    My slide deck is posted here.

    As I posted previously:
    It is based on the new CompTIA Advanced Security Practitioner (CASP) certification, which is the first in CompTIA's "Mastery Series of Exams". 
    I passed the CASP a few months ago, and was throughly impressed. It seems designed to be a more technical alternative to the CISSP. CompTIA has stated that is targeted for IA Technical Level III and IA  Management Level II of the US DoD Directive 8570. The CASP exam was also recently ISO certified.
    'The CASP is the result of our being advised over a couple of years that the Department of Defense was looking for a more technical security exam to include in the “IA Technical Level III” job classification, for those military and military contractors who are in information assurance roles.  The job classification that I referred to is in the Dept. of Defense “8570” directive that requires certification of all information assurance personnel.
    The CASP is targeted at the lead security professional in the enterprise environment who has years of experience with security considerations specific to large multi-location organizations.  The U.S. military refers to that environment as the “enclave”, which means the same thing as the enterprise in the corporate environment.'
    Source: CASP – The Evolution of Technical Security Certifications? (ethicalhacker.net)



    Wednesday, July 11, 2012

    Teensy talk at SANSFIRE SANS360

    I'm reposting some information from a previous post, for a SANS360 talk tonight at SANSFIRE 2012
    My paper is available here. The Arduino sketches used in my talk are here.
    Here are the resources I used to launch the Teensy attack:
    Here are some excellent Teensy articles:

    Monday, July 02, 2012

    CISSP Study Guide, 2nd Edition

    Just a quick note to say the CISSP Study Guide, 2nd Edition, will be out in a few weeks. More details to follow: stay tuned.

    Here's the Amazon Link.

    Here's the Syngress link.

    Monday, May 14, 2012

    Installing OpenWRT on a RouterBOARD 750GL

    I have a project that requires a small Linux router/firewall, with a requirement of no wireless (due to physical security policies for the site). There are many third-party firmware options for wireless routers, with distributions such as dd-wrt and Open-WRT on APs from Linksys, Buffalo, etc. But the options for a simple wired router are more limited.

    I found this excellent post: OpenWRT on Mikrotik Routerboard 411/750 on Wolfs Tech Blog, which indicated that OpenWRT is flashable onto a RouterBoard 750GL. I bought a pair from rOc-nOc.com. They were $59.95 each via Google Checkout, and shipping was fast.

    I highly recommend rOc-nOc.com: great service!

    The RouterBOARD 750GL has 5 gigabit ports, 64MB of SDRAM, 64MB NAND, and it literally fits in the palm of your hand.
    RouterBOARDs ship with a proprietary RouterOS, but my project requires Linux.

    I used the Wolfs Tech Blog post as my guide for installation, with help from this German post, with an assist from Google Translate. I ran into a few gotchas, so I thought I'd save someone else future grief and post my step-by-step instructions. Firmware installation can be tricky: there is no serial or display port on the 750GL: you need to "fly blind" and install over the network.

    I used Xubuntu 12.4 as the OS for building OpenWRT, and as the TFTP/DHCP server to boot the RouterBoard via the network. I initially tried using a VMWare Workstation guest, but later encountered problems making the DHCP server work properly via a bridged interface. I ended up installing to USB, booted off the USB, and ran Xubuntu natively.

    Install the required packages and Wireshark (which will be handy later):
    $ sudo apt-get install subversion
    $ sudo apt-get install g++ gawk libncurses5-dev zlib1g-dev git-core
    $ sudo apt-get install dhcp3-server atftpd apache2
    $ sudo apt-get install wireshark
    Download the OpenWRT trunk code with Subversion and "make menuconfig":
    $ cd
    $ mkdir openwrt
    $ cd openwrt
    $ svn co svn://svn.openwrt.org/openwrt/trunk
    $ cd trunk
    $ make menuconfig
    We need to compile twice. Once for the .tar.gz file, and once for the ramdisk.  Two steps because the .tar.gz file has has different requirements than the ramdisk, such as squashfs.

    First the tar.gz file:

    Choose:
    • Target System: Atheros AR7xxx/AR9xxx 
    • Subtarget: (Devices with NAND flash (mostly Mikrotik)) 
    • Target Images: .tar.gz
    Exit and type "make". It will take a long time to compile.

    When complete, type the following:
    $ cp ~/openwrt/trunk/bin/ar71xx/openwrt-ar71xx-nand-vmlinux-initramfs.elf /var/www
    $ cp ~/openwrt/trunk/bin/ar71xx/openwrt-ar71xx-nand-rootfs.tar.gz /var/www
    This prepares them for the "wget2nand" flashing step, coming up later.

    Next the ramdisk:
    $ cd ~/openwrt/trunk
    $ make clean
    $ make menuconfig
    Choose:
    • Target System: Atheros AR7xxx/AR9xxx 
    • Subtarget: (Devices with NAND flash (mostly Mikrotik)) 
    • Target Images: ramdisk
    Exit and type "make". 

    When complete copy the ramdisk to /srv/tftp:
    $ cp ~/openwrt/trunk/bin/ar71xx/openwrt-ar71xx-nand-vmlinux-initramfs.elf /srv/tftp/
    Configure atftpd and isc-dhcp-server. I used 192.168.1.3 as the TFTP server address, and assigned 192.168.1.99 to the RouterBoard. Avoid 192.168.1.1 (the default OpenWRT IP address).

    Edit /etc/network/interfaces, use 192.168.1.3 as a static IP address:
    auto eth0
    iface eth0 inet static
    address 192.168.1.3
    netmask 255.255.255.0
    Edit /etc/default/atftpd, changes in bold:
    USE_INETD=false
    OPTIONS="--bind-address 192.168.1.3 --tftpd-timeout 300 --retry-timeout 5 --mcast-port 1758 --mcast-addr 239.239.239.0-255 --mcast-ttl 1 --maxthread 100 --verbose=5 /srv/tftp"
    Locate the first MAC address printed on the bottom of the RouterBOARD 750GL:
    Edit /etc/dhcp/dhcpd.conf, and use the first listed MAC address as the hardware ethernet address:
    authoritative;
    allow booting;
    allow bootp;
    one-lease-per-client true;
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
      option routers 192.168.1.254;
      option subnet-mask 255.255.255.0;
      option broadcast-address 192.168.1.255;
      ignore client-updates;
    }
    
    group {
      host routerboard {
        hardware ethernet 00:0c:42:aa:bb:cc;
        next-server 192.168.1.3;
        fixed-address 192.168.1.99;
        filename "openwrt-ar71xx-nand-vmlinux-initramfs.elf";
      }
    }
    Now restart networking, atftpd and isc-dhcp-server:
    $ sudo /etc/init.d/networking restart
    $ sudo /etc/init.d/atftpd restart
    $ sudo /etc/init.d/isc-dhcp-server restart
    Run Wireshark, sniffing on eth0, to watch network traffic.

    Boot the RouterBOARD 750GL via TFTP:
    • Connect an ethernet cable between port 1 on the RouterBOARD 750GL and the TFTP server.
      • Other ports won't work 
    • Press the small "RES" button and plug in the power cable. 
    • The "PWR" and "ACT" lights will illuminate. Then "ACT" will flash, and finally stop. 
    • Now release the "RES" button. 
    • The 750GL should request a DHCP address, receive 192.168.1.99, download openwrt-ar71xx-nand-vmlinux-initramfs.elf via TFTP, and boot OpenWRT. 
    Use Wireshark to ensure everything's working; look for the TFTP "DATA Packet" packets to verify the ramdisk download.
    The device will boot OpenWRT and use IP address 192.168.1.1.

    Swap the cable to a different port to access OpenWRT. I used port 2 (port 1 won't work). Then telnet to the device:
    $ telnet 192.168.1.1
    Trying 192.168.1.1...
    Connected to openwrt.lan.
    Escape character is '^]'.
     === IMPORTANT ============================
      Use 'passwd' to set your login password
      this will disable telnet and enable SSH
     ------------------------------------------
    
    
    BusyBox v1.19.4 (2012-05-10 11:17:53 PDT) built-in shell (ash)
    Enter 'help' for a list of built-in commands.
    
      _______                     ________        __
     |       |.-----.-----.-----.|  |  |  |.----.|  |_
     |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
     |_______||   __|_____|__|__||________||__|  |____|
              |__| W I R E L E S S   F R E E D O M
     -----------------------------------------------------
     ATTITUDE ADJUSTMENT (Bleeding Edge, r31673)
     -----------------------------------------------------
      * 1/4 oz Vodka      Pour all ingredients into mixing
      * 1/4 oz Gin        tin with ice, strain into glass.
      * 1/4 oz Amaretto
      * 1/4 oz Triple sec
      * 1/4 oz Peach schnapps
      * 1/4 oz Sour mix
      * 1 splash Cranberry juice
     -----------------------------------------------------
    root@OpenWrt:/# 
    Now that the 750GL has booted to ramdisk, the last step is flashing OpenWRT to make it permanent.

    WARNING: the next steps will erase the existing RouterOS installation. Make sure to back up the OS, configuration and license first.
    root@OpenWrt:/# wget2nand http://192.168.1.3
    Connecting to 192.168.1.3 (192.168.1.3:80)
    kernel               100% |*******************************|  2717k  0:00:00 ETA
    Connecting to 192.168.1.3 (192.168.1.3:80)
    rootfs.tgz           100% |*******************************|  1222k  0:00:00 ETA
    Erasing filesystem...
    Mounting /dev/mtdblock2 as new root and /dev/mtdblock1 as kernel partition
    Copying kernel...
    Preparing filesystem...
    ...
    Cleaning up...
    Image written, you can now reboot.  Remember to change the boot source to Boot from Nand
    
    The 750GL should boot OpenWRT natively and respond to pings shortly.

    Friday, March 23, 2012

    USB Reloaded: the Teensy Attack

    I'm posting this information in advance of my "USB Reloaded: the Teensy Attack" lightning talk, which I am delivering at SANS 2012 in Orlando. The talk is part of SANS360: Top Security Takeaways. The talk is scheduled for Tuesday, March 27, 2012 at 7:30 PM EDT and will be streamed live here.


    Ten talks in 60 minutes, with 360 seconds per speaker. I can't wait!


    My paper is available here. The Arduino sketches used in my talk are here.


    Here are the resources I used to launch the Teensy attack:
    Here are some excellent Teensy articles: