Endian banner

endian.authentication.utils package

Submodules

endian.authentication.utils.encrypt_local_password module

main(input_file, output_file)

Convert all the users plain text passwords from the input file into SHA-512 crypt passwords and save the result on the output file

endian.authentication.utils.htpasswd module

class HtPasswd(path)

Bases: object

users()

Return the users names

Returns:a list of the loaded users names
Return type:list of string
verify_password(user, password)

Verify a password

Parameters:
  • user (string) – username
  • password (string) – cleartext password
Returns:

True is the password is corrent, False otherwise

Return type:

boolean

endian.authentication.utils.md5crypt module

md5crypt(password, salt, magic='$1$')

endian.authentication.utils.pldap module

class LDAPConnection(ldap_uri='', ldap_bind_dn='', ldap_bind_password='', ldap_preset='', ldap_user_basedn='', ldap_user_searchfilter='', ldap_user_uidattribute='', ldap_select_groups=False, ldap_user_groups=[], ldap_group_basedn='', ldap_group_searchfilter='', ldap_group_uidattribute='', ldap_group_memberattribute='')

Bases: object

fetch_remote_group(conn, groupname, retrieve_attributes=[])
fetch_remote_groups(fetch_all=False)
fetch_remote_user(conn, username, retrieve_attributes=[])
fetch_remote_users(fetch_all=False)
fetch_remote_users_in_group(groupname)

endian.authentication.utils.rsa module

class RSAPasswordDecoder

Bases: object

Decode a password with the RSA private key

class RSAPasswordEncoder

Bases: object

Encode a password with the RSA public key

endian.authentication.utils.shadow module

authenticate(username, password)

Returns True if the given username and password authenticate again /etc/shadow.

Parameters:
  • username (string) – the username to authenticate
  • password (string) – the password in plain text
Returns:

Returns True if the given username and password authenticate, False otherwise

Return type:

boolean

get_encrypted_password(username)

Return the password for the given user name.