-
April 4th, 2007, 10:23 PM
#1
DOS Intrusion Detection System
I think I had posted on here ages ago asking how to create an Intrustion Detection System just using DOS commands in a batch file. Well, I actually wrote this awhile back and figured I should post it. It's not meant as a serious security tool, mainly just a learning experience for the curious newb (aka me).
The basic concept is to leave the program running at night, at a time when you are not using the computer, to check for differences in connections. The code is pretty self-explanatory.
@ECHO OFF
CLS
ECHO Written by Blithendell.
ECHO http://www.antionline.com/
ECHO.
ECHO Your current connections..
NETSTAT
ECHO.
ECHO Check C:\NIGHTWATCHLOG.TXT to see if any intrusion attempts occured.
PAUSE
ECHO Original connections..>C:\NIGHTWATCHLOG.TXT
NETSTAT>>C:\NIGHTWATCHLOG.TXT
ECHO.>>C:\NIGHTWATCHLOG.TXT
DATE /T>>C:\NIGHTWATCHLOG.TXT
TIME /T>>C:\NIGHTWATCHLOG.TXT
NETSTAT>C:\NETLOG1.TXT
ECHO.
ECHO.
ECHO.
ECHO Currently scanning for intruders..
:MAIN
NETSTAT>C:\NETLOG2.TXT
FC C:\NETLOG1.TXT C:\NETLOG2.TXT>>C:\FILELOG.TXT
IF ERRORLEVEL 1 GOTO :ALERT
GOTO :MAIN
:ALERT
ECHO.>>C:\NIGHTWATCHLOG.TXT
ECHO Intrusion attempt detected!>>C:\NIGHTWATCHLOG.TXT
ECHO Compare the above and below entries to indentify the intruder.>>C:\NIGHTWATCHLOG.TXT
NETSTAT>>C:\NIGHTWATCHLOG.TXT
ECHO.>>C:\NIGHTWATCHLOG.TXT
DATE /T>>C:\NIGHTWATCHLOG.TXT
TIME /T>>C:\NIGHTWATCHLOG.TXT
DEL C:\FILELOG.txt
DEL C:\NETLOG1.txt
DEL C:\NETLOG2.txt
SHUTDOWN -s -t 10
Similar Threads
-
By cheyenne1212 in forum Miscellaneous Security Discussions
Replies: 7
Last Post: February 1st, 2012, 02:51 PM
-
By catch in forum The Security Tutorials Forum
Replies: 7
Last Post: September 16th, 2005, 03:20 PM
-
By rpgraff in forum Spyware / Adware
Replies: 16
Last Post: August 24th, 2004, 08:01 AM
-
By catch in forum The Security Tutorials Forum
Replies: 4
Last Post: October 19th, 2003, 07:22 AM
-
By antihaxor in forum Non-Security Archives
Replies: 0
Last Post: January 24th, 2002, 05:42 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|