Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Run script on failed login attempt

  1. #11
    Join Date
    Jun 2010
    Beans
    36

    Re: Run script on failed login attempt

    We have a winner!

    BkkBonaza
    Your solution is much better thank you.

  2. #12
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Run script on failed login attempt

    If for a laptop/notebook in a theft situation...

    My latest thoughts are that a pam script should upload captured images to some file hosting service and/or email them, or a link. This way once they're captured they get sent off to "somewhere" you can get to, along with some IP info.

    The reason being that once they boot up and try to login a couple times unsuccessfully they'll probably install Windows and be done with it. You want to catch as much ID/Location info as you can in the briefest opportunity before it's gone.

  3. #13
    Join Date
    Jun 2010
    Beans
    36

    Re: Run script on failed login attempt

    Here we go, this is the end result.
    Using the uuencode and mailx will send the captured jpgs to my e-mail account the second a network connection is found.

    Since I am on a college campus with an auto-connect set up for the campus wide wifi this will work fine for a anti-theft device (or at least I can see the face of the dude that stole my laptop while he is within range of campus).

    Thanks for all of the help everyone.

    Code:
    #! /bin/bash
    
    EMAIL='[your@email.address]'
    USR=[your user name]
    TIMESTAMP=$(date +%R.%S-%B-%d)
    
    cd /home/$USR/Pictures/Webcam/
    streamer -t 10 -r 1 -s 640x480 -o cap00.jpeg > /dev/null
    
            cp cap03.jpeg $TIMESTAMP-1.jpg
            cp cap04.jpeg $TIMESTAMP-2.jpg
            cp cap05.jpeg $TIMESTAMP-3.jpg
            cp cap06.jpeg $TIMESTAMP-4.jpg
            cp cap07.jpeg $TIMESTAMP-5.jpg
            rm cap*
    
    (for i in *.jpg
    do 
          uuencode $i $(basename $i) 
    done
    ) | mailx -s "Security Allert- $TIMESTAMP" $EMAIL
    
    mv /home/$USR/Pictures/Webcam/*.jpg /home/$USR/Pictures/Webcam/old/
    Last edited by kkaldroma; September 29th, 2010 at 03:33 PM. Reason: Cleaned up the code

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •