11.18.07

NetCat and LF vs CRLF

Posted in IT, Tools at 1:12 am by Tyler Reguly

I was attempting to grab a web page via netcat the other day, and my GET / HTTP/1.0<enter><enter> appeared to simply hang. I mentioned this to a colleague who pointed out that netcat only sends line-feed (LF / 0x0A), not carriage-return line-feed (CRLF / 0x0D0A). I did some playing around and it turns out that you can simulate CRLF while using *nix by sending the following Ctrl+V<enter><enter>. Ctrl+V<enter> is translated into CR and then <enter> alone sends the expected LF.

This unfortunately doesn't work in Windows, so I'll pose a question to my readers. Does anyone know of a way to simulate CRLF using netcat in Windows?

Social bookmark this page

3 Comments »

  1. Cd-MaN said,

    November 18, 2007 at 2:58 am

    I just tested it with NC for Windows, and it seems to work fine. Also, you could use unix2dos to convert a textfile and feed it into NC (most probably, I didn’t test it thought):

    unix2dos query
    cat query > nc google.com 80

  2. Tyop? said,

    November 18, 2007 at 8:58 am

    telnet proto use CRLF no ?
    try to use telnet compatibility of netcat. `man netcat`

  3. bugfree said,

    November 21, 2007 at 10:02 pm

    dude, grap the source code and change it to CRLF.

Leave a Comment