This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ctypes import (windll, wintypes, c_uint64, cast, POINTER, Union, c_ubyte, | |
LittleEndianStructure, byref, c_size_t) | |
import zlib | |
# types and flags | |
DELTA_FLAG_TYPE = c_uint64 | |
DELTA_FLAG_NONE = 0x00000000 | |
DELTA_APPLY_FLAG_ALLOW_PA19 = 0x00000001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Example: Which users can access the SMB Session information on a Windows 10 computer (NetCease status) | |
#Retrieve the binary value | |
$acl=Get-ItemProperty -Path Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\DefaultSecurity -Name SrvsvcSessionInfo | |
#Use WMI helper to obtain a converter | |
$converter = new-object system.management.ManagementClass Win32_SecurityDescriptorHelper | |
#Do the conversion to SDDL | |
$outsddl = $converter.BinarySDToSDDL($acl.SrvsvcSessionInfo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://docs.python-requests.org/en/master/api/ | |
import requests | |
class RequestsApi: | |
def __init__(self, base_url, **kwargs): | |
self.base_url = base_url | |
self.session = requests.Session() | |
for arg in kwargs: | |
if isinstance(kwargs[arg], dict): | |
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg]) |