Snorduino

From Cryptolife

Jump to: navigation, search


Snort + Arduino=Snorduino
A low tech Snort IDS lcd monitor.

Comments and feedbacks are welcome by email

Hardware :

A computer with snort installed

Arduino Duemilanove
lcd1602
protoboard + cables

USB Cable

Usage:

1) Connect the Arduino board to the LCD following this schema.

2) Copy the arduino code inside the IDE and upload it.

3) Connect the arduino board via USB and check with dmesg if you have something like this:
     usb 4-2: FTDI USB Serial Device converter now attached to ttyUSB0

4) Send the snort logs to the LCD:

tail -f /var/snort/log/alert.csv | sed -n 's/\(.*\)\"\(.*\)\"\(.*\)/\2/p' > /dev/ttyUSB0

Links:

http://makezine.com
http://hackaday.com
http://hacknmod.com/topics/arduino
http://www.arduinoshow.com/show
http://www.freeduino.org
http://www.instructables.com/id/Arduino/


Arduino code:

// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup(){
    // set up the LCD's number of rows and columns: 
  lcd.begin(16, 2);
  // initialize the serial communications:
  Serial.begin(9600);
  
  lcd.print("Arduino + Snort");
  lcd.setCursor(0,1);
  lcd.print("        =      ");
 
  delay(4000);
  lcd.clear();
  lcd.print("    Snorduino");
  delay(2000);
  lcd.clear();
  lcd.print("Low tech IDS");
  lcd.setCursor(0,1);
  lcd.print("monitor.");
   
  delay(4000);
  lcd.clear();
  lcd.print("Snort logs to");
  lcd.setCursor(0,1);
  lcd.print("LCD, and more....");
  delay(4000);
  lcd.clear();
  lcd.print("By pbailey@");
  lcd.setCursor(0,1);
  lcd.print("cryptolife.org");
  delay(4000);
  lcd.clear();
  lcd.print("Ready to start?");
  lcd.setCursor(0,1);
  lcd.print("");
   delay(4000);
}

void loop()
{
  // when characters arrive over the serial port...
  if (Serial.available()) {
    // wait a bit for the entire message to arrive
   delay(100);
    // clear the screen
    lcd.clear();
    // read all the available characters
    while (Serial.available() > 0) {
      // display each character to the LCD
   lcd.write(Serial.read());
        
}

{
  for (int positionCounter = 0; positionCounter < 16; positionCounter++) {
 
lcd.scrollDisplayLeft();
delay(600);
}

{
delay(1000);
}

}
  }
}


Creative Commons License