Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - leonteale

Pages: [1]
1
agreed! when i updated my blog it must have messed up the formatting :/ which i only just realized when trying to port over the tutorial.

problem is, when writing on this forum, the preview box is different to the actual saved product so i have to keep previewing to make sure its formatting correctly. PITA.

I will go through and reformat when i have some time

3
Im all up for teaching on here. if you have any questions, either IRC on here, PM me or twitter (@leonteale) or even email (leonteale89[at]gmail.com)


Also i am posting a few tutorials of stuff i do day today when performing penetration tests for clients.

4
High Quality Tutorials / Null Session Domain Controller Enumeration
« on: May 20, 2015, 05:20:12 pm »
Today we are going to discuss Null Session enumeration, specifically against a Windows Domain Controller.

Null session attacks have been around a long time. Probably back since Windows 2000. Yet it is something that System Administrators often neglect to consider when hardening their domain and network. This can lead to disastrous results as enumeration of a null session can divulge just about every bit of useful information an attacker needs to remotely gain access to a system. Many people consider this an old technique, hell, many Pentesters and companies don’t even check for this. However, this is one of the very first checks i do when performing a Penetration test and providing they haven’t had previous Pentests that have found this and they have remediated against, then i can safely say i find this on nearly every test.

So what exactly is Null Session Authentication?

Well, to put it very briefly, it’s how Windows represents an anonymous user. A remote session is created when a user logs onto a computer, providing a user name and password that has access to the system resources. This is accomplished through the SMB protocol and the Windows Server service.

So as you’d expect, a Null Session comes into play when a user without providing a username or password. This type of connection can not be made to any typical windows share, but it can be made to the IPC share. The IPC share is used exclusively by the SMB protocol.

Using the IPC share with no credentials is typically reserved for programs communicating with one another, but there is nothing to say that a user can’t connect using the IPC connection instead. This would not allow for unrestricted access to the machine, but will allow for pretty extensive enumeration that could aid an attacker.

Exploitation

So that’s the run down of Null Session authentication. I will now go onto the means and methods of enumerating a domain controller using this vulnerability and finish this post with remediation advice for you to help protect your own network/domain against this type of attack.

I think the first thing to discuss is what tools we can use for the job to enumerate information from a host with Null Sessions enabled.

Enum4Linux

http://labs.portcullis.co.uk/tools/enum4linux/

Features include:

  • RID Cycling (When RestrictAnonymous is set to 1 on Windows 2000)
  • User Listing (When RestrictAnonymous is set to 0 on Windows 2000)
  • Listing of Group Membership Information
  • Share Enumeration
  • Detecting if host is in a Workgroup or a Domain
  • Identifying the remote Operating System
  • Password Policy Retrieval (using polenum)

WinscanX

http://packetstormsecurity.com/files/84199/WinScanX-Password-Utility.html

==== WinScanX Advanced Features ====

  • -a  -- Get Account Policy Information
  • -b  -- Get Audit Policy Information
  • -c  -- Get Display Information
  • -d  -- Get Domain Information
  • -e  -- Get LDAP Information
  • -f  -- Get Administrative Local & Global Group Information
  • -g  -- Get Local & Global Group Information
  • -p  -- Get Installed Programs
  • -k  -- Get Interactively Logged On Users
  • -l  -- Get Logged On Users
  • -i  -- Get Patch Information
  • -j  -- Get Registry Information
  • -m  -- Get Scheduled Task Information
  • -n  -- Get Server Information
  • -o  -- Get Service Information
  • -s  -- Get Share Information
  • -t  -- Get Share Permissions
  • -q  -- Get SNMP Community Information
  • -u  -- Get User Information
  • -r  -- Get User Information via RA Bypass
  • -x  -- Get User Rights Information
  • -w  -- Get WinVNC3 & WinVNC4 Passwords
  • -y  -- Save Remote Registry Hives

Enum4Linux

Enum4linux is a tool for enumerating information from Windows and Samba systems. It attempts to offer similar functionality to enum.exe formerly available from www.bindview.com.

It is written in PERL and is basically a wrapper around the Samba tools smbclient, rpclient, net and nmblookup. The samba package is therefore a dependency.



Usage for this is also very straight forward.

Quote
$ ./enum4linux.pl 10.1.1.100

From here it will list out (using various methods) to enumerate the local users and groups.

I would recommend that you firstly test you do get output. If a host is not vulnerable it will get permission denied for the null user.

Once you know the host is affected and you are getting the desired output then rerun the command and pipe the results to a text file.

Quote
$ ./enum4linux.pl 10.1.1.100 > dcenum.txt

From here I usually strip out all the domain users and all the domain admins.

You can use these two commands here to do that:

Quote
cat dcenum.txt | grep “Domain Users” | awk {‘print $8′} | cut -d \\ -f 2 > users.txt

cat dcenum.txt | grep “Domain Admins” | awk {‘print $8′} | cut -d \\ -f 2 > admins.txt

Now you will have two lists “Users” and “Admins”. You can use this lists as a reference to identify privileged users but also as a userlist for password attacks. For example running the username list for “Users” through Hydra with the password “Password1″. So if you have a list of 2000 users. Im sure some of them will have Password1 ;)

WinscanX

WinScanX is a Windows enumeration utility featuring over 20 options including the ability to identify easy-to-guess Windows passwords, the ability to identify easy-to-guess SNMP community strings, and the ability to locate and decrypt WinVNC passwords. Includes an optional GUI front-end.

Usage is pretty easy. Since this is a Windows tool by design, I will stick to showing you the GUI. If your a true techie and don’t like using GUI’s, then why are you using Windows anyway?



The interface is quite straight forward. Simply enter the IP address of the host which has null sessions enabled. Select ‘Use Anonymous Credentials’

Then you can select any of the tick boxes you want on the right. A word of advice, do NOT select ‘Guess Windows Passwords’ or else you will find user accounts lockout as this will perform a password attack. I would stick with just selecting “Get Local And Global Group Information’ this will be enough to return enough information for you to know a. The site is vulnerable b. Get local users to perform password attacks against.

NOTE:

Domain Controllers with large amount of users (and i mean anything more than about 5000+) then WinscanX will hang and look like its crashed. Just leave it, it will work. If you check netstat / ps list etc.. you will see it doing something. If it does completely crash its still a good sign the site is vulnerable so seek alternate methods to obtain the information. I recommend using ‘enum’ a win32 application after connecting to the DC using ‘net use’

How can i defend against this?

well, and i say this with as much enthusiasm as possible, make sure you have backups and make changes out of hours for obvious reasons so you can test there is no adverse affects.

Here is an article by Microsoft

http://support.microsoft.com/kb/837964

Now this vulnerability effects server 2000 and 2003 by default so it is up to you to disable it.

Server 2008 remediates this in its build (fresh build). However, if you upgrade from Windows Server 2003 to Windows Server 2008 then you will migrate the settings with your from 2003 and you will still be vulnerable to Null Sessions unless you follow the steps below.

Enable:

  • Network access: Restrict Anonymous access to Named Pipes and Shares
  • Network access: Do not allow anonymous enumeration of SAM accounts

Disable:

  • Network access: Let Everyone permissions apply to anonymous users
  • Network access: Allow anonymous SID/Name translation

It has also been noted that there must be no session pipes in the registry.

5
This tool decrypts the cpassword attribute value embedded in the Groups.xml file stored in the domain controller’s Sysvol share.

Very briefly, we will be discussing how Group Policy Preferences can be used to create local users on machines and just how quickly we can crack the embedded cpass hash.As far as i’m aware, by design the Groups.xml will store the local administrator account user and password hash. However, after further research and experiences of my colleagues there are other similar .xml files which hold other user account names and hashes for different purposes.

For example, there are .xml files used for specific ‘Services’, that will hold the account needed to run said service. Other .xml files include credentials and configuration settings for ‘Printers‘ and ‘Drives‘. Further research suggests there are possible .xml files for ‘ScheduledTasks’ and ‘DataSources‘ although i have yet to see these on any pentests I have performed



Above is a Groups.xml file taken from a test lab i created some time ago. The important items within this file are:

  • Group name
  • Username
  • Cpassword

The above information will show you the user and group used for the specific policy and of course the Cpassword (often referred to as Cpass).To find the Groups.xml file your going to have to search the Sysvol folder of a domain controller mainly. You will very likely need domain credentials to be able to access this share. Simply browse to the server share and you should see the folder for Sysvol if it exists or is accessible using the credentials you have supplied. If using windows you can simply ‘search’ for groups.xml. However, you might find searching *.xml will yield more results.

Now as common as this method is to roll out user credentials for specific services Microsoft, for what ever reason!?, decided to release the key to decrypting this password.
http://msdn.microsoft.com/en-us/library/2c15cbf0-f086-4c74-8b70-1f2fa45dd4be.aspx
Now you may think
“Well why is this any different to cracking any other password hash?”
Well, the time taken to crack any cpass is less than a second, no matter the complexity.


Usage for gpprefdecrypt.py is easy. simply call the script and give it the hash.

References
Gprefdecrypt.py can be found on my pastebin as mirrors to the script are often down.
There is a Ruby version of this script for use with the new Kali Linux distribution.
http://carnal0wnage.attackresearch.com/2012/10/group-policy-preferences-and-getting.html


So what can you do to protect yourself from this exploit?
Simple, do not specify user credentials within Group Preference Policies.
I would like to send out a thank you to the below people for making this post possible
  • My collegues for their input into the groups.xml exploit
  • Loic Jaquemet for his work with gpprefdecrypt.py
  • Microsoft for providing yet another quick and easy method of getting system on a pentest

6
Found it on the Webs / Chrome Browser Memory Hog
« on: May 20, 2015, 04:20:14 pm »
http://www.addictivetips.com/web/the-great-suspender-selectively-suspends-chrome-tabs-to-save-memory/


The Great Suspender helps you suspend tabs to free up some of Chrome’s memory. Clicking on the Great Suspender button lets you choose from suspending the current tab, suspending all other tabs or restoring all your tabs. The tool allows for automatic and manual suspending, configurable in the settings. The settings also allow you to set a whitelist of sites that won’t get suspended.


Pages: [1]