I remembered seeing on here a while back that somebody had posted a very basic shell script or batch file (cant remember which) that was basically a fake finger server with logging. I'm just now getting into shell scripting and the like so I'm going to attempt (most likely poorly) to "speak in code". Basically I want to have a finger server listening on port 79. when it gets a connection I want it to log the IP and send them a message of my choosing showing them their IP.

I was thinking something like this. Forgive me, I'm a noob at this stuff. I'm still learning basic shell syntax, and I love it. I'm also typing this at school. Night classes bore me so I've been thinking this one up. Yeah, thats right, I've learned enough to "put it together" (albeit not a working implementation) I probably would have done away with most of this jargon through trial and error, but I'm on a windows box.


#/bin/bash

$FINGER= "/etc/local/fingerserver_wherever_it_may_be" ;
$INTRUDER= "netstat -a inet | grep TCP 79" ;

{

echo "$INTRUDER" >> /usr/var/log/fingerlog

}

echo "cat /usr/var/log/fingerlog | last" << send output of file back over the socket?



I dunno, I'm wanting to learn, and this is my "teach your god damn self" kinda project. I would just like a few friendly pointers and whatnot. Any help would be much appreciated.