Donnerstag, 25. Juni 2015

JS On Security: IBM Xforce Exchange - my client script

JS On Security: IBM Xforce Exchange - my client script: As some of you may know, my SendMeSpamIDS includes a script to check data against the IBM XForce Exchange api. https://exchange.xforce.ib...

Mittwoch, 17. Juni 2015

JS On Security: Call it a day

JS On Security: Call it a day: What else should happen today? If you want to know the original story: http://securityintelligence.com/cyber-and-financial-crimes-aff...

Montag, 15. Juni 2015

SendMeSpam: JST IrcBot revisited

SendMeSpam: JST IrcBot revisited: Maybe you remember the shellinjection I reported yesterday. This morning I took the time to read a bit through the code  JST Perl IrcBot...

SendMeSpam: JST IrcBot revisited

SendMeSpam: JST IrcBot revisited: Maybe you remember the shellinjection I reported yesterday. This morning I took the time to read a bit through the code  JST Perl IrcBot...

Sonntag, 14. Juni 2015

SendMeSpam: Perl script injection: 85.214.60.234/den

SendMeSpam: Perl script injection: 85.214.60.234/den: The last two days several Shell injections have hit my Honeypot. Any of them tried to download a prscript and execute it Jun 13 06:42:11 ...

Freitag, 5. Juni 2015

The Mission: Keep the cats secure (DLink, Arduino, Raspberry)

You know, now living in the Netherlands also causes that me and my wife travel back to Germany for a weekend once in a while. Leaving the cats back in Amsterdam creates a bad feeling.This leads to a little bit of coding and playing with various technologies :-)

Centre of the information, cause my wife wants to see the cats, is a D-Link webcam. This is placed in a central room which the cats need to cross when they want to go to eat something, go to the toilet or go to bed :-)
The installation is very simple, basically it results in sending a email with 6 pictures (3x before the event and 3x after the event) to a Gmail address.



 Now, the new apartment does all the heating and cooking with gas. That was an issue too, cause when we are away no one knows what could happen. So I took an arduino and a MQ2 gas sensor. It is really easy cabled as only three wires are needed which can be directly plugged into the arduino
  1. GND (Ground)
  2. Analog output (A1)
  3. 5V power supply

by the way: 3V work too, just lead to a not so good output.

The script to read out the data is very smale an simple.





void setup() {
  Serial.begin(9600);
}
void loop() {
  float vol;
  int sensorValue = analogRead(A0);
  vol=(float)sensorValue/1024*5.0;
  if (vol > 1.5) {
    Serial.println(vol,4);
    delay(2000);
  }
}

Than finally, how to get the data? Well honestly, I first bought a network shield which I wanted to use, but like always, when the next trip was three days away, I realized that I will not have it done by that day. So I simply connected it to my raspberry pi which is in use anyway.

So the Arduino usb cable is now connected to the Raspberry USB port. And the data is fetched via the serial console.

The code to get the data is even more simple.



import serial
ser = serial.Serial('/dev/ttyACM1',9600)
import time
import smtplib
import sys

def mail(msg):
        # code to send email via Gmail

while (1) :
        data = ser.readline()
        if  data > 1.5:
                txt = "actual Gas indicator = " + str(data)
                mail(txt)
                print "Gas: " + data
                time.sleep(60)