This checks the network connections through netstat, monitors changes and then notifies the users if changes are made quickly, indicating a possible attack.
Here is the checker:
float r=0;
float a=0'
void setup() {
size(600,50);
String one[]=loadStrings("1.txt");
String two[]=loadStrings("2.txt");
println(one.length);
println(two.length);
for( int t=0;r<one.length;r++){
if(one[t] != two[t]) {
if(a<5){
a=a+1;
}
if(a=5){
textSize(50);
text("Possible Intrusion",10,40);
a=0;
}
}
}
And here is the netstat:
//NETSTAT
:A
netstat > 1.txt
TIMEOUT 7>NUL
netstat >2.txt
TIMEOUT 5>NUL
GOTO A
No comments:
Post a Comment