Finding Exposed Http(s) Admin Pages
This post is a kinda fix for a really great series of posts by Chris Gates (@carnalownage), he wrote a blog post about finding exposed web admin pages on a network using Metasploit’s database, Firefox and a plugin called Linky, read it here http://carnal0wnage.attackresearch.com/2012/04/from-low-to-pwned-1-exposed-services.html
Since the article was written Rapid7/Metasploit devs chose to change the way web services are listed in the database of Metasploit, they changed them from ‘http’, ‘https’ to just plain ‘www’.
Oops edit the http and https labels have reappeared ! The script still should work just alter the services command to include http and https
I was on an internal network test this week and wanted to look for exposed web admin pages so I had to modify the ruby script that Chris wrote, not rocket science but the thing works now.
Installing Metasploit Framework GIT version
Recently with the release of Metasploit 4.5 the developers changed they way the framework is updated, previously it used to be done via ‘svn’, but due to various reasons it has been changed to be updated via ‘git’.
Also the developers chose to change the ‘Community’ version somewhat, they removed a large chunk of code that was kinda duplicated, this and other changes has altered the update frequency of the framework. The Community version now only receives updated modules etc on a weekly basis as the updates are QA’ed in the same way the Pro version is. The Community version also has to be activated to allow it to be updated also.
There is a way still to allow developers, pentesters or guys who just want the latest version. It follows the the ‘old way’ were the framework shipped without the database, but with support to connect to one.
I’ll show you here how to set up the git version of the framework, I did this on my pentesting laptop which runs Arch Linux, but as the framework is written in ‘ruby’ it should follow the same for any distro.
First off we need to install git, if you don’t already have it installed
sudo pacman -S git
2012 in review
The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.
Here’s an excerpt:
4,329 films were submitted to the 2012 Cannes Film Festival. This blog had 25,000 views in 2012. If each view were a film, this blog would power 6 Film Festivals
Metasploit MS08_067 Scanner Version 2
Following on from the previous post, I’ve improved the MS08_067 scanner by removing the sledge-hammer approach, ie scan everything, to a more defined and controlled approach, ie get some hosts, work out if they might be a windows box and then scan.
Here is the script;
<ruby>
###########################################################
#Must set Global RHOSTS via setg RHOSTS xxx.xxx.xxx.xxx/xx#
###########################################################
#Check to see if RHOSTS is set Globally
if (framework.datastore['RHOSTS'] == nil)
print_line("Please set RHOSTS globally with this command setg RHOSTS xxx.xxx.xxx.xxx/xx...exiting")
return
end
#Populate the datastore with some Hosts
#######################################
#Setup NMAP Options
nmapopts = "-O -T 5"
run_single("db_nmap #{nmapopts} #{framework.datastore['RHOSTS']}")
#Remove RHOSTS
run_single("unsetg RHOSTS")
framework.db.workspace.hosts.each do |host|
host.services.each do |serv|
next if not serv.host
next if (serv.state != ServiceState::Open)
if (serv.name =~ /smb/ or serv.name =~ /microsoft-ds/ or serv.name =~ /netbios/ or serv.port == 445 or serv.port == 139 or serv.port == 137)
if(serv.port == 445)
run_single("use exploit/windows/smb/ms08_067_netapi")
run_single("set RHOST #{host.address}")
run_single("check")
end
end
end
end
</ruby>
Some changes to the way the resource script works, first we need to set the Global variable RHOSTS, this can be set via the ‘setg RHOSTS xxx.xxx.xxx.xxx/xx’ command.
Then we just fire up the resource script as before, but this time you will get a bunch of nmap output.
I used a db_nmap scan to populate the database
Then, if there are any Windows hosts on the network with the correct services listening, you will see this;
And the rest is down to you…Enjoy
Credit to the MSF guys, as a couple of lines of code were taken from the default resource scripts that ship with the framework and of course to @mubix for the initial rapid psexec script that this was based upon.
Metasploit MS08_067 Scanner Resource Script
Today I’ve been messing around with Metasploit and came up with this, its not rocket science and uses a bit of code from another resource script written by @mubix, you can find it here http://www.room362.com/blog/2010/9/12/rapid-fire-psexec-for-metasploit.html
Any ways I thought why not try and write some resource scripts that look for ‘low hanging fruit’ to kinda speed up the pwnage on big network penetration tests.
The ms08_067 exploit module supports the ‘check’ function which we use to find our vulnerable hosts, there are more exploits with this function but not all.
Here’s the code its pretty self explanitory, just set the rhosts variable in the script.
################################################
# MS08_067 Vulnerability Checker Resource Script
################################################
use exploit/windows/smb/ms08_067_netapi
require 'rex/socket/range_walker'
#################################################
#Set rhosts to be network range you want to check
#################################################
rhosts = "192.168.0.0/24"
iplist = Rex::Socket::RangeWalker.new(rhosts)
iplist.each do |rhost|
self.run_single("set RHOST #{rhost}")
self.run_single("check")
end
Copy the code into a file called ms08_067_checker.rc and save it here /root/.msf4/scripts/resource or /yourusername/.msf4/scripts/resource, to be able to use it directly from msfconsole.
The resource script output is as below:
Unlucky…
Woot, we’re in luck.
The rest is simple, Happy hunting.
Easily Find Domain Controllers – More Active Directory Kung-Fu
Following on from the previous Active Directory Kung-Fu post, I thought I would add a few more things that could be useful on a Pentest.
The tools used are not installed on a standard XP build and will have to be downloaded from Microsoft and installed.
First off get the 2 new tools, AdminPack and Group Policy Management.
http://www.microsoft.com/en-us/download/details.aspx?id=16770 - Admin Pack for XP
http://www.microsoft.com/en-us/download/details.aspx?id=21895 - Group Policy Management for XP
Extract and install the Admin Pack and install gpmc.msi
Once these 2 tools are installed you will find that there are new gui tools.
Metasploit POST Module – Interesting Documents Finder
I wrote this metasploit post module to search and download files from compromised hosts.
Initial credit to @3vilJohn whose module inspired this. http://johnbabio.wordpress.com
It searches open Metasploit SESSIONS for file types Word, Excel, Pdf and user specified types.
It can enumerate and search specified drives too using a bit of Railgun Kung-Fu from Mubix, aka http://www.room362.com
You can set the dump location for the downloaded files and even attempt to elevate privileges with a Get_System function, useful for when you’re in as a un priv user.
Here’s some screenshots of it in action,
Daily Papers
Links
- 0entropy
- Attack Vector
- BackTrack Linux
- Carlos Perez – The Dark Operator
- Common Exploits
- Corelan Website
- CoreSec Blog
- Digital Security Research Blog
- Emerging Threats – Snort Rules and Other Stuff
- Ethical Hacker
- Exploit Database
- Fun Over IP Blog
- Hak5
- HolisticInfoSec.org
- ihasomgsecurityskills – sickness's Blog
- Inside Trust Blog
- Irongeek
- jcran Pages, Blog etc
- Joshua 'Jabra' Abraham Blog
- KOrUPt
- Leon Ward Blog
- Metasploit Home Page
- Metasploit Unleashed – Best Place for Metasploit Training
- Michael Daw Blog
- Myne-Us Blog
- nightslayer.eu
- Offensive Security
- Paul Dot Com
- Rapid 7 Blog
- Relentless Coding Blog
- Room 362
- Script Junkie's Blog
- Secmaniac – The Home Of SET
- Security Database
- Security Monks Blog
- Snort Blog
- Social Engineering Website – The Home of SET
- SourceFire VRT Blog
- The H-OnLine
- Threatpost Website
- W3aF – Web Application Attack and Audit Framework
- Webantix
- x-n2o
Magazines
Archives
- March 2013 (1)
- December 2012 (2)
- November 2012 (2)
- June 2012 (2)
- January 2012 (1)
- February 2011 (1)
- January 2011 (3)
- December 2010 (3)
- November 2010 (3)
- October 2010 (1)
- September 2010 (9)
- August 2010 (1)
- July 2010 (2)
- January 2010 (1)
- August 2009 (2)
Metasploit Blog
- An error has occurred; the feed is probably down. Try again later.
Offensive Security – Blog
- Kali Linux on a Galaxy Note 10.1 April 2, 2013Here at Offsec, we love playing with hardware. Be it something like the Onity Hotel Door Unlocker, a Teensy USB HID attack payload, or RFID hacks - if it's shiny, we like it. While we were in the last stages of developing Kali Linux, we made the effort to to get Kali working on some ARM hardware, such as the Samsung Chromebook, Odroid U2, Raspberry Pi a […]
- Kali Linux Has Been Released! March 13, 2013Seven years of developing BackTrack Linux has taught us a significant amount about what we, and the security community, think a penetration testing distribution should look like. We've taken all of this knowledge and experience and implemented it in our "next generation" penetration testing distribution.
- Advanced Windows Exploitation Vienna February 19, 2013The Advanced Windows Exploitation (AWE) class in Vienna is coming up quick! This will be our first time teaching the class outside of the US and is the only public planned AWE this year outside of BlackHat Vegas. We have secured a beautiful facility on the 24th floor of the Millennium Tower on the Vienna waterfront, and still have a couple of seats left open […]
Attack Vector – Blog
- An error has occurred; the feed is probably down. Try again later.
Exploit DB – Blog
- [webapps] - Simple File Manager v.024 - Login Bypass Vulnerability June 17, 2013Simple File Manager v.024 - Login Bypass Vulnerability
- [local] - Winamp 5.12 (.m3u) - Stack Based Buffer Overflow June 17, 2013Winamp 5.12 (.m3u) - Stack Based Buffer Overflow
- [webapps] - SPBAS Business Automation Software 2012 - Multiple Vulnerabilities June 17, 2013SPBAS Business Automation Software 2012 - Multiple Vulnerabilities









