Closed maaaaz closed 1 year ago
Hello there,
cmedb.py is currently missing a share export function, here's one I did, and to insert here https://github.com/Porchetta-Industries/CrackMapExec/blob/44ec821fff6516a43560290fb4256d2d91b7da84/cme/cmedb.py#L84
cmedb.py
import csv elif line[0].lower() == 'shares': if len(line) < 2: print("[-] invalid arguments, export shares <filename>") return shares = self.db.get_shares() with open(os.path.expanduser(line[1]), 'w') as export_file: spamwriter = csv.writer(export_file, delimiter=";", quoting=csv.QUOTE_ALL, lineterminator='\n') csv_header = ["host_ipaddress", "host_domain", "host_hostname", "share_name", "share_remark", "domain_username", "share_readaccess", "share_writeaccess"] spamwriter.writerow(csv_header) for share in shares: share_id, share_hostid, share_userid, share_name, share_remark, share_readaccess, share_writeaccess = share share_writeaccess = "True" if share_writeaccess == 1 else "False" share_readaccess = "True" if share_readaccess == 1 else "False" user_id, user_domain, user_username, user_password, user_credtype, user_pillaged = self.db.get_users(share_userid)[0] user_domain_username = '%s\%s' % (user_domain, user_username) hostid,host_ipaddress,host_hostname,host_domain,host_opsys,host_dc = self.db.get_computers(share_hostid)[0] csv_row = [host_ipaddress, host_domain, host_hostname, share_name, share_remark, user_domain_username, share_readaccess, share_writeaccess] spamwriter.writerow(csv_row)
So you can now do export shares <filename>
export shares <filename>
Cheers !
Hello, can you make a PR ?
Hello there,
cmedb.py
is currently missing a share export function, here's one I did, and to insert here https://github.com/Porchetta-Industries/CrackMapExec/blob/44ec821fff6516a43560290fb4256d2d91b7da84/cme/cmedb.py#L84So you can now do
export shares <filename>
Cheers !