Skip to content

Instantly share code, notes, and snippets.

@izogain
Forked from misterch0c/pamcam
Created March 28, 2018 13:50
Show Gist options
  • Save izogain/a9ecbc1eb3e9e7c9726a2717302e2696 to your computer and use it in GitHub Desktop.
Save izogain/a9ecbc1eb3e9e7c9726a2717302e2696 to your computer and use it in GitHub Desktop.
Take a screenshot when someone enters a wrong password
#/etc/pam.d/system-auth
#%PAM-1.0
# Jump two rules if login succeeds.
auth [success=2 default=ignore] pam_unix.so nullok_secure
auth optional pam_exec.so /home/pamcam.sh
auth requisite pam_deny.so
# User gets here if authentication is successful. No denying, no cam module.
auth required pam_unix.so try_first_pass nullok
auth optional pam_permit.so
auth required pam_env.so
account required pam_unix.so
account optional pam_permit.so
account required pam_time.so
password required pam_unix.so try_first_pass nullok sha512 shadow
password optional pam_permit.so
session required pam_limits.so
session required pam_unix.so
session optional pam_permit.so
#pamcam.sh
#!/bin/bash
ts=$(date +"%m_%d_%Y_%H_%M_%S")
ffmpeg -f video4linux2 -s vga -i /dev/video0 -vframes 3 /home/login-$ts.jpg
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment