Advertisement
Guest User

Untitled

a guest
May 17th, 2016
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. /usr/share/pam-external/auithenticate.py:
  2.  
  3. #!/usr/bin/python
  4.  
  5. from sys import exit
  6.  
  7. print ")Username: "
  8. username = raw_input()
  9.  
  10. if username != 'pamtest':
  11. print '[PAM_USER_UNKNOWN]'
  12. exit(1)
  13.  
  14. for i in range(0, 3):
  15. print ":Password: "
  16. password = raw_input()
  17. if password == 'boogaloo':
  18. print '[PAM_SUCCESS]'
  19. exit(0)
  20. print "!Password incorrect. Please try again."
  21.  
  22. print '!Authentication failed.'
  23. print '[PAM_AUTH_ERR]'
  24. exit(1)
  25.  
  26. ls -al /etc/pam-external:
  27.  
  28. drwxr-xr-x 2 root root 4096 May 16 13:30 .
  29. drwxr-xr-x 145 root root 12288 May 16 13:30 ..
  30. lrwxrwxrwx 1 root root 39 May 16 13:30 authenticate -> /usr/share/pam-external/authenticate.py
  31.  
  32. pamtester:
  33.  
  34. root@westeros:~# pamtester flarp pamtest authenticate
  35. Password:
  36. Password incorrect. Please try again.
  37. Password:
  38. pamtester: successfully authenticated
  39.  
  40.  
  41. /var/log/auth.log:
  42.  
  43. May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): Debug activated
  44. May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): <-- )Username:
  45. May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): --> pamtest
  46. May 17 14:12:59 westeros pamtester: pam_external(flarp:auth): <-- :Password:
  47. May 17 14:13:02 westeros pamtester: pam_external(flarp:auth): --> Sending password
  48. May 17 14:13:02 westeros pamtester: pam_external(flarp:auth): <-- !Password incorrect. Please try again.
  49. May 17 14:13:02 westeros pamtester: pam_external(flarp:auth): <-- :Password:
  50. May 17 14:13:06 westeros pamtester: pam_external(flarp:auth): --> Sending password
  51. May 17 14:13:06 westeros pamtester: pam_external(flarp:auth): <-- [PAM_SUCCESS]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement