Skip to content

Instantly share code, notes, and snippets.

@msuhanov
Created April 8, 2024 19:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save msuhanov/8636611d65b7d1aac4c2b00510fd10c1 to your computer and use it in GitHub Desktop.
Save msuhanov/8636611d65b7d1aac4c2b00510fd10c1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import ctypes
import time
import threading
def test():
def access(path):
f = open(path, 'rb')
__ = f.read(8192)
f.seek(-32, 2)
__ = f.read(32)
f.close()
ctypes.windll.advapi32.OperationStart.restype = ctypes.c_uint32
ctypes.windll.advapi32.OperationEnd.restype = ctypes.c_uint32
buf = ctypes.create_string_buffer(b'\x01\x00\x00\x00\x31\x33\x37\x00\x01\x00\x00\x00')
res = ctypes.windll.advapi32.OperationStart(ctypes.byref(buf))
print('OperationStart:', res)
access('C:\\Windows\\System.ini')
access('C:\\Windows\\System32\\zipcontainer.dll')
access('C:\\Windows\\System32\\ze_loader.dll')
access('C:\\Windows\\System32\\xwizard.exe')
access('C:\\Windows\\System32\\wpncore.dll')
access('C:\\Windows\\System32\\wsock32.dll')
access('C:\\Windows\\System32\\xpsprint.dll')
access('C:\\Windows\\System32\\zipcontainer.dll')
access('C:\\Windows\\System32\\xolehlp.dll')
try:
access('C:\\Windows\\System32\\thisfiledoesnexist_12.dll')
except Exception:
pass
access('C:\\Windows\\System32\\xolehlp.dll')
access('C:\\Windows\\System32\\wwapi.dll')
access('C:\\Windows\\comsetup.log')
try:
access('C:\\Windows\\System32\\config\\SAM')
except Exception:
pass
buf = ctypes.create_string_buffer(b'\x01\x00\x00\x00\x31\x33\x37\x00\x00\x00\x00\x00')
res = ctypes.windll.advapi32.OperationEnd(ctypes.byref(buf))
print('OperationEnd:', res)
print('Sleeping...')
time.sleep(125)
thread = threading.Thread(target = test)
thread.start()
thread.join()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment