Tophography

All things Topher, and other stuff too.

Browsing Posts in Linux – Misc.

Telnet is a wonderful tool for sysadmins and network application programmers. If you ever find yourself wearing either of these hats, you’ve got to know how to use telnet. Though, sometimes telnet requires a little too much from the user in order to get anything done. Netcat to the rescue! This is a tool that I’ve seen used before, but only recently really looked in to. Netcat (‘nc’) can be used as a server or a client, Netcat can be used to transmit files, Netcat can even be used as a port-scanner. Once I found myself trying to debug a web server with telnet. It was a pain to type in all the HTTP request headers by hand. If I would have known about Netcat, I could have just done this each time:
nc host 80 < request.txt
and just edited the request.txt file each time I wanted to try something different. Go read the man page (man nc), it’s actually well-written.

Now for the next cool tool! Ever wanted to do some testing on a server that uses TLS/SSL? Telnet obviously isn’t the answer. OpenSSL to the rescue!  s_client lets you have the simple power of telnet, but it takes care of all the overhead of TLS/SSL.  You can use s_client to test a server to find out if it will allow SSL2 sessions, or find out what happens if the client only requests certain ciphers.  s_server gives you similar control from the server side.

Here at UTOSC (the Utah Open Source Conference), I’ve found some very reliable evidence for which editor is better. After examining the sticker table, I found that the Vim stickers completely disappeared, while there are still a large number of Emacs stickers. I’m sure you all agree that this can finally end the debate.

Installing dsniff

4 comments

I just thought I’d include a list of packages that I needed to install on my FC5 machine to get dsniff to compile.

  • db4-devel : Berkeley database libraries
  • libpcap : Libpcap
  • libnet : (API for network packet injection)
  • libnids : Network Intrusion Detection System (I got it from dries)
  • openssl-devel : OpenSSL libraries

After I installed these, the configure script completed, then I got some errors with make. I later realized that I ran into some major dependency-hell. Dsniff development stopped almost 6 years ago, and in that time, libnet and libnids have changed. I tried to find some older versions of the libraries, but no luck getting them old enough. I later found a couple rpms on the following site, but should I really trust them?

http://voidmain.is-a-geek.net/files/RPMS/dsniff/

I have to create histograms quite frequently for my Digital Signal Processing class this semester. Here’s a quick gnuplot setup for a histogram. You can either type these commands into gnuplot, or enter them into a file (usually with a .gpi extension), and use ‘gnuplot file.gpi’ or ‘load file.gpi’ inside gnuplot.

example:

set boxwidth VALUE # Probably 3-5.
set xlabel "STRING"
set ylabel "STRING"
set term svg # Create an SVG image
set output 'file.svg'
set key off # Unless you really want a key
# For this next line, lw is linewidth (2-4)?
plot [XMIN:XMAX] 'myHistogramData' with boxes lw VALUE

The input is expected to be in this format:

x-value y-value
x-value y-value
etc...