In this installment im going to show you a way to keep an eye on your computer while your away, using NetCat. Assuming you've gotten all the basics commands for NetCat from "day 1", so im not going to explain them.


NetCat tutorial: Day1

http://www.antionline.com/showthread...ghlight=Netcat


Here we'll use NetCat to run a Batch file which generates a web page when it's connected to, that

you can access from the internet. Although their are more efficient ways of doing this with perl or asp, this is meant to show you ways of using NC. you can adapt this to run or do anything on connect like run a .pl file.

The log file used here is from ZoneAlarm Pro but the batch file used can be altered for the FW

you're using.



Write a batch file containing a NC initialization line and put it in your start up folder:

nc -L -d -p2500 -e c:\inform.bat


Any time a connection is established to port 1234 (or whatever port you chose) inform.bat will be

run.

you need to decide what you want to keep an eye on so this can copy those lines to a HTM file so you can view them


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


inform.bat
---------------------------------
@echo off

type c:\Preform.txt |more >>c:\inetpub\wwwroot\inform.htm

type c:\winnt\Interne~1\ZALog.txt |more >>c:\inetpub\wwwroot\inform.htm

type c:\Postform.txt |more >>c:\inetpub\wwwroot\inform.htm

---------------------------------

The pre and porform text files must exist before this will work or you can just save the output as a txt file without them

=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


you could keep an eye on only certain things by using:

find /I "ICMP" c:\winnt\Intern~1\filter.log |more >>c:\inetpub\wwwroot\inform.htm

instead of:

type c:\winnt\Interne~1\ZALog.txt |more >>c:\inetpub\wwwroot\inform.htm

substituting "icmp" with any string from the logfile making a new "find" line for each thing you want to look for




=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


PreForm.txt
---------------------------------
<HTML><BODY BGCOLOR = BLACK TEXT = YELLOW><PRE>


---------------------------------


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+



PostForm.txt
---------------------------------

</PRE></BODY></HTML>

---------------------------------


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+


Before you can view the created Web-page the batch files must run. You can make this happen by

telneting to port 2500 (telnet xxx.xxx.xxx.xxx 2500).

Now point your browser to your computer: http:www.yoursite.com/inform.htm

for testing purposes on your own computer use 127.0.0.1