Skip to content

Instantly share code, notes, and snippets.

@misterch0c
Last active January 12, 2022 06:36
Show Gist options
  • Save misterch0c/eb575efb43383dc98b4d7357d519ec21 to your computer and use it in GitHub Desktop.
Save misterch0c/eb575efb43383dc98b4d7357d519ec21 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