Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /usr/share/pam-external/auithenticate.py:
- #!/usr/bin/python
- from sys import exit
- print ")Username: "
- username = raw_input()
- if username != 'pamtest':
- print '[PAM_USER_UNKNOWN]'
- exit(1)
- for i in range(0, 3):
- print ":Password: "
- password = raw_input()
- if password == 'boogaloo':
- print '[PAM_SUCCESS]'
- exit(0)
- print "!Password incorrect. Please try again."
- print '!Authentication failed.'
- print '[PAM_AUTH_ERR]'
- exit(1)
- ls -al /etc/pam-external:
- drwxr-xr-x 2 root root 4096 May 16 13:30 .
- drwxr-xr-x 145 root root 12288 May 16 13:30 ..
- lrwxrwxrwx 1 root root 39 May 16 13:30 authenticate -> /usr/share/pam-external/authenticate.py
- pamtester:
- root@westeros:~# pamtester flarp pamtest authenticate
- Password:
- Password incorrect. Please try again.
- Password:
- pamtester: successfully authenticated
- /var/log/auth.log:
- May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): Debug activated
- May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): <-- )Username:
- May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): --> pamtest
- May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): <-- :Password:
- May 17 14:13:02 westeros pamtester: pam_external(flarp:auth): --> Sending password
- May 17 14:13:02 westeros pamtester: pam_external(flarp:auth): <-- !Password incorrect. Please try again.
- May 17 14:13:02 westeros pamtester: pam_external(flarp:auth): <-- :Password:
- May 17 14:13:06 westeros pamtester: pam_external(flarp:auth): --> Sending password
- May 17 14:13:06 westeros pamtester: pam_external(flarp:auth): <-- [PAM_SUCCESS]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement