Skip to content

Commit

Permalink
Merge pull request mandiant#142 from 0ssigeno/log_registry
Browse files Browse the repository at this point in the history
Adding list_subkeys and create_key log
  • Loading branch information
drewvis authored Apr 12, 2021
2 parents 5bd9d82 + 1717a84 commit a27d2cd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions speakeasy/winenv/api/usermode/advapi32.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def RegEnumKeyEx(self, emu, argv, ctx={}):
name = name.encode('utf-8')
self.mem_write(lpName, name)
rv = windefs.ERROR_SUCCESS

self.log_registry_access(key.get_path(), "list_subkeys")
return rv

@apihook('RegCreateKey', argc=3)
Expand All @@ -297,7 +297,9 @@ def RegCreateKey(self, emu, argv, ctx={}):
if lpSubKey:
lpSubKey = self.read_mem_string(lpSubKey, cw)
argv[1] = lpSubKey
self.emu.reg_create_key(key.get_path() + '\\' + lpSubKey)
sub_key_path = key.get_path() + '\\' + lpSubKey
self.emu.reg_create_key(sub_key_path)
self.log_registry_access(sub_key_path, "create_key")
else:
hkey = (hkey).to_bytes(self.get_ptr_size(), 'little')
self.mem_write(phkResult, hkey)
Expand Down
1 change: 1 addition & 0 deletions speakeasy/winenv/api/usermode/wininet.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ def InternetOpenUrl(self, emu, argv, ctx={}):
port = 80
else:
port = 443
self.log_http(crack.netloc, port, headers=lpszHeaders)
sess = wini.new_session(crack.netloc, port, '', '', '', defs, dwContext)
if not sess:
return 0
Expand Down

0 comments on commit a27d2cd

Please sign in to comment.