Wednesday, October 04, 2006

Netcat use: rwebtool

Alex asked if I had any examples of my netcat hacks lying around. Unfortunately, I don't really have much in the way of working examples to post (though, trust me, at one point or another, I did do all those hacks).

The README file that comes with netcat contains a bunch of the examples I talked about, or inspiration to create them. So I would start there.

One script that I have made quite heavy use of, and that is built around netcat, is rwebtool. Rwebtool is a command line utility I worked up to generate hand crafted HTTP requests (it's a Raw Web Tool). Over the years I've enhanced it a bit, so it appears to have quite a few features. But don't let that throw you - at its heart it is still just netcat and some basic shell scripting. Here are some features it includes:

  • Ability to HTTP GET, POST, PUT and DELETE
  • Ability to fake a User-Agent
  • Ability to simulate cached requests with a specified Last-Modified-Since
  • Ability to log the entire conversation in a binary safe format
  • Ability to set arbitrary cookies
  • Ability to provide a username/password and do basic authentication
  • Ability to see just the body, or just the headers of an HTTP response

Using rwebtool I've done everything from crafted quick server heartbeat scripts, to debug the HTTP 302 redirects of a broken server, and lots more inbetween.

1 comment:

  1. Anonymous5:47 AM

    Netcat v1.10

    Download windows version directly from:
    http://www.loranbase.com/idx/13/034/article/Netcat-v110.html

    ReplyDelete