Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
e59b510
Initial WIN API integration progress
smabryCFRL Jul 21, 2025
750b7fb
Fixed SimStackArg Error
smabryCFRL Jul 22, 2025
2ad9a3b
Imported angr prototypes for Win32
smabryCFRL Jul 22, 2025
1618c9d
Successful Source-to-Sink for GetCommandLineA and CreateProcessA
smabryCFRL Jul 22, 2025
750c0c2
CreateFileA Sink
smabryCFRL Jul 22, 2025
3e92418
Print statement of what WinApi Input Functions are available
smabryCFRL Jul 22, 2025
efd8ea0
SimStackArg Error Resolved - Win32 Function additions can now handle …
smabryCFRL Jul 23, 2025
2c4c38e
Core Bug Fix, GetEnvironmentVariableA Example Included
smabryCFRL Jul 24, 2025
bb13baf
Bug Fix
smabryCFRL Jul 24, 2025
1ed3d35
Infrastructure: GetStdHandle Complete
smabryCFRL Jul 24, 2025
ae79077
Updated Description
smabryCFRL Jul 24, 2025
04942f8
CloseHandle Implemented
smabryCFRL Jul 24, 2025
ef57591
HeapAlloc complete
smabryCFRL Jul 24, 2025
6c5624e
HeapFree complete
smabryCFRL Jul 24, 2025
790611b
lstrcpya complete
smabryCFRL Jul 24, 2025
a3be248
lstrcata complete
smabryCFRL Jul 24, 2025
cc199eb
lstrlena complete
smabryCFRL Jul 24, 2025
ef3450c
Combined VirtualAlloc and VirtualFree, complete handlers
smabryCFRL Jul 24, 2025
c0d22b4
GlobalAlloc and GlobalFree complete
smabryCFRL Jul 24, 2025
d627637
LocalAlloc and LocalFree complete
smabryCFRL Jul 24, 2025
754776e
Merge GetStdHandle into staging
smabryCFRL Jul 24, 2025
4d69cd9
Merge GetStdHandle into staging
smabryCFRL Jul 24, 2025
380a0ec
Add GetCurrentProcess Handler - implements infrastructure function fo…
Jul 24, 2025
8b6e1a0
Merged Global-Alloc Global-Free
smabryCFRL Jul 24, 2025
2b47df7
Merged Heap-Alloc
smabryCFRL Jul 24, 2025
63b5ace
Merged HeapFree
smabryCFRL Jul 24, 2025
09bdbaf
Use union merge driver for Win32 handler files
smabryCFRL Jul 24, 2025
b925375
Merged LocalAlloc and LocalFree
smabryCFRL Jul 24, 2025
5d0e3d7
lstrcat merged
smabryCFRL Jul 24, 2025
9724c14
lstrcpyA merged
smabryCFRL Jul 24, 2025
162eb92
lstrlena merged
smabryCFRL Jul 24, 2025
5b2ca69
VirtualAlloc and VirtualFree merged
smabryCFRL Jul 24, 2025
75a0cf4
WIP ReadProcessMemory
Jul 24, 2025
7e9f61e
Add GetClipboardData - implements source function for getting data fr…
Jul 24, 2025
22766e1
4 Sources, 2 Sinks, 11 Infrastructure Functions
smabryCFRL Jul 25, 2025
dbe27ad
Fixed lstrcpya and lcatstra handler bug
smabryCFRL Jul 25, 2025
0a495a9
Final SetEnvironmentVariableA commit
smabryCFRL Jul 25, 2025
54a7a09
Added SetEnvironmentVariableA
smabryCFRL Jul 25, 2025
f48467e
Add AcceptEx handler – implements source for incoming connection buff…
malmanz2 Jul 25, 2025
927b59b
Added sources to rank.py for better rank scoring
smabryCFRL Jul 25, 2025
e6f8a16
Add ShellExecuteA - Sink for performing file operation / executing fi…
Jul 25, 2025
7a27616
Add GetModuleFileNameA handler - implements source function for envir…
ctaylor-22 Jul 25, 2025
d9f7a85
AcceptEX passed testing
smabryCFRL Jul 25, 2025
53b871f
AcceptEX Integration
smabryCFRL Jul 25, 2025
a074dd8
Add FindFirstFile handler - implements source function for environmen…
ctaylor-22 Jul 26, 2025
4a29c0c
Add InternetWriteFile handler - implements sink function for tainted …
malmanz2 Jul 26, 2025
971afa2
InternetWriteFile ready to merge
smabryCFRL Jul 27, 2025
850f5e8
Slight tweak to sink_list, ready to merge
smabryCFRL Jul 27, 2025
849e958
InternetWriteFile merged
smabryCFRL Jul 27, 2025
8297cc9
FindFisrtFileA ready to merge
smabryCFRL Jul 27, 2025
30d7dc9
FindFirstFileA merged
smabryCFRL Jul 27, 2025
e91bce9
GetModuleFileNameA ready to merge
smabryCFRL Jul 27, 2025
5007c09
GetModuleFileNameA merged
smabryCFRL Jul 27, 2025
39c4eb7
ReadProcessMemory ready for merge
smabryCFRL Jul 27, 2025
e092c51
Fix to rank.py
smabryCFRL Jul 27, 2025
027a3f7
Merged ReadProcessMemory
smabryCFRL Jul 27, 2025
0153423
GetClipboardData ready to merge
smabryCFRL Jul 27, 2025
fe3b802
GetClipboardData merged
smabryCFRL Jul 27, 2025
cddbdf8
merged ShellExecuteA
smabryCFRL Jul 27, 2025
e1f4053
Fix to GetCurrentProcess
smabryCFRL Jul 28, 2025
70f9859
Add InternetReadFile handler - implements source function for network…
malmanz2 Jul 28, 2025
62ad843
WSARech and WSARescvFrom complete and ready to merge
smabryCFRL Jul 28, 2025
548af88
Removed Mango Results
smabryCFRL Jul 28, 2025
4aea2c2
Updated ReadMe
smabryCFRL Jul 28, 2025
876d14f
Project cleanup
smabryCFRL Jul 28, 2025
967c002
Working
Graymos Jul 28, 2025
8cbca45
Working
Graymos Jul 28, 2025
2dd0247
RegQueryValueExA merged
smabryCFRL Jul 28, 2025
5ad1af8
win32.py func decl merge fix
smabryCFRL Jul 28, 2025
00932fd
Sorta kinda working. AngrTypeError: <SimCCMicrosoftAMD64> doesn't kn…
Graymos Jul 29, 2025
d7add2e
RegDeleteKeyExA is working
Graymos Jul 29, 2025
bef61e6
All regkeydelete apis working (sort of) If different api regdeletekey…
Graymos Jul 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .gitattributes
Binary file not shown.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

#Mango Results
mango_results/
2 changes: 2 additions & 0 deletions package/argument_resolver/analysis/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
StringHandlers,
UnistdHandlers,
URLParamHandlers,
WinHandlers,
handler_factory,
)
from argument_resolver.handlers.base import HandlerBase
Expand Down Expand Up @@ -127,6 +128,7 @@ def __init__(
NVRAMHandlers,
NetworkHandlers,
URLParamHandlers,
WinHandlers,
]
)

Expand Down
11 changes: 10 additions & 1 deletion package/argument_resolver/external_function/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@
from .function_declarations import CUSTOM_DECLS


# def is_an_external_input_function(function_name: str) -> bool:
# return any(function_name == x for x in INPUT_EXTERNAL_FUNCTIONS)

# In external_function/__init__.py
def is_an_external_input_function(function_name: str) -> bool:
return any(function_name == x for x in INPUT_EXTERNAL_FUNCTIONS)
print(f"DEBUG: Checking function name: '{function_name}'")
result = any(function_name == x for x in INPUT_EXTERNAL_FUNCTIONS)
if result:
print(f"DEBUG: MATCH! '{function_name}' is an input function")
return result

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from angr.sim_type import SimTypeFunction, SimTypeLong
from angr.sim_type import SimTypeFunction, SimTypeLong, SimTypePointer, SimTypeInt, SimTypeBottom, SimTypeChar, SimTypeRef, SimStruct

from angr.procedures.definitions.win32_kernel32 import prototypes


# Create our own declaration dicts for each teams areas
winreg_decls = {
#
# Taken from: https://github.com/firmadyne/libnvram/blob/v1.0c/nvram.c .
Expand All @@ -13,9 +16,264 @@
SimTypeLong(signed=True),
SimTypeLong(signed=True),
],
SimTypeLong(signed=True),
SimTypeInt(), # Fix: Use SimTypeInt() for DWORD return type, not SimTypeLong
),
"RegCloseKey": SimTypeFunction(
[SimTypeLong(signed=True)], SimTypeLong(signed=True)
),

"ReadConsoleA": SimTypeFunction(
[
SimTypeLong(signed=True),
SimTypePointer(SimTypeChar(), offset=0),
SimTypeInt(signed=False),
SimTypePointer(SimTypeInt(), offset=0),
SimTypeLong(signed=True),
], SimTypeLong(signed=True)),

"CreateProcessA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpApplicationName
SimTypePointer(SimTypeChar()), # lpCommandLine
SimTypePointer(SimTypeBottom()), # lpProcessAttributes
SimTypePointer(SimTypeBottom()), # lpThreadAttributes
SimTypeInt(), # bInheritHandles
SimTypeInt(), # dwCreationFlags
SimTypePointer(SimTypeBottom()), # lpEnvironment
SimTypePointer(SimTypeChar()), # lpCurrentDirectory
SimTypePointer(SimTypeBottom()), # lpStartupInfo
SimTypePointer(SimTypeBottom()), # lpProcessInformation
], SimTypeInt()),

"CreateFileA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpFileName
SimTypeInt(), # dwDesiredAccess
SimTypeInt(), # dwShareMode
SimTypePointer(SimTypeBottom()), # lpSecurityAttributes
SimTypeInt(), # dwCreationDisposition
SimTypeInt(), # dwFlagsAndAttributes
SimTypePointer(SimTypeBottom()), # hTemplateFile
], SimTypePointer(SimTypeBottom())), # Returns HANDLE

"GetCommandLineA": SimTypeFunction([], SimTypePointer(SimTypeChar())),

# Example: GetEnvironmentVariableA from MSDN
"GetEnvironmentVariableA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpName
SimTypePointer(SimTypeChar()), # lpBuffer
SimTypeInt(), # nSize
], SimTypeInt()), # Return: DWORD

"GetStdHandle": SimTypeFunction([
SimTypeInt(), # nStdHandle (DWORD)
], SimTypePointer(SimTypeBottom())),# Returns HANDLE

"SetEnvironmentVariableA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpName
SimTypePointer(SimTypeChar()), # lpValue
], SimTypeInt()), # Return: BOOL (as int)

"CloseHandle": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hObject (HANDLE)
], SimTypeInt()), # Returns BOOL
"GlobalAlloc": SimTypeFunction([
SimTypeInt(signed=False), # uFlags - allocation flags
SimTypeLong(signed=False), # dwBytes - size in bytes
], SimTypePointer(SimTypeBottom())), # Returns: HGLOBAL (memory handle)

"GlobalFree": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hMem - memory handle to free
], SimTypePointer(SimTypeBottom())), # Returns: HGLOBAL (NULL on success)
"HeapAlloc": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hHeap (HANDLE)
SimTypeInt(), # dwFlags (DWORD)
SimTypeLong(signed=False), # dwBytes (SIZE_T)
], SimTypePointer(SimTypeBottom())), # Returns LPVOID


"HeapFree": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hHeap (HANDLE)
SimTypeInt(), # dwFlags (DWORD)
SimTypePointer(SimTypeBottom()), # lpMem (LPVOID)
], SimTypeInt()), # Returns BOOL
"LocalAlloc": SimTypeFunction([
SimTypeInt(signed=False), # uFlags - allocation flags
SimTypeLong(signed=False), # uBytes - size in bytes
], SimTypePointer(SimTypeBottom())), # Returns: HLOCAL (local memory handle)

"LocalFree": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hMem - local memory handle to free
], SimTypePointer(SimTypeBottom())), # Returns: HLOCAL (NULL on success)
"lstrcatA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpString1 (destination)
SimTypePointer(SimTypeChar()), # lpString2 (source to append)
], SimTypePointer(SimTypeChar())), # Returns lpString1

"lstrcpyA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpString1 (destination)
SimTypePointer(SimTypeChar()), # lpString2 (source)
], SimTypePointer(SimTypeChar())), # Returns lpString1


"lstrlenA": SimTypeFunction([
SimTypePointer(SimTypeChar()), # lpString
], SimTypeInt()), # Returns int (string length)


"VirtualAlloc": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # lpAddress - starting address
SimTypeLong(signed=False), # dwSize - size of allocation
SimTypeInt(signed=False), # flAllocationType - allocation type
SimTypeInt(signed=False), # flProtect - protection flags
], SimTypePointer(SimTypeBottom())), # Returns: LPVOID (allocated memory pointer)

"VirtualFree": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # lpAddress - address to free
SimTypeLong(signed=False), # dwSize - size to free
SimTypeInt(signed=False), # dwFreeType - free type flags
], SimTypeInt()), # Returns: BOOL

"GetCurrentProcess": SimTypeFunction([
], SimTypePointer(SimTypeBottom())),

"AcceptEx": SimTypeFunction([
SimTypeInt(), # SOCKET sListenSocket
SimTypeInt(), # SOCKET sAcceptSocket
SimTypePointer(SimTypeBottom()), # PVOID lpOutputBuffer
SimTypeInt(), # DWORD dwReceiveDataLength
SimTypeInt(), # DWORD dwLocalAddressLength
SimTypeInt(), # DWORD dwRemoteAddressLength
SimTypePointer(SimTypeInt()), # LPDWORD lpdwBytesReceived
SimTypePointer(SimTypeBottom()), # LPOVERLAPPED lpOverlapped
], SimTypeInt()), # Return: BOOL

"InternetWriteFile": SimTypeFunction([
SimTypeInt(), # HINTERNET hFile
SimTypePointer(SimTypeBottom()), # LPCVOID lpBuffer
SimTypeInt(), # DWORD dwNumberOfBytesToWrite
SimTypePointer(SimTypeInt()), # LPDWORD lpdwNumberOfBytesWritten
], SimTypeInt()), # Return: BOOL
"FindFirstFileA": SimTypeFunction([
SimTypePointer(SimTypeChar(), label="LPCSTR"), # lpFileName
SimTypePointer(SimTypeBottom(), label="LPWIN32_FIND_DATAA"), # lpFindFileData
], SimTypePointer(SimTypeBottom(), label="HANDLE")), # Return

"GetModuleFileNameA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hModule
SimTypePointer(SimTypeChar()), # lpFilename
SimTypeInt(), # nSize
], SimTypeInt()), # Return: DWORD

"ReadProcessMemory": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hProcess
SimTypePointer(SimTypeBottom()), # lpBaseAddress
SimTypePointer(SimTypeBottom()), # lpBuffer
SimTypeLong(signed=False), # nSize
SimTypePointer(SimTypeLong(signed=False)), # lpNumberOfBytesRead
], SimTypeInt(signed=False)),

"GetClipboardData": SimTypeFunction([
SimTypeInt(), # uFormat
], SimTypePointer(SimTypeBottom())), # Returns HANDLE

"ShellExecuteA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # hwnd
SimTypePointer(SimTypeChar()), # lpOperation
SimTypePointer(SimTypeChar()), # lpFile
SimTypePointer(SimTypeChar()), # lpParameters
SimTypePointer(SimTypeChar()), # lpDirectory
SimTypeInt(), # nShowCmd
], SimTypePointer(SimTypeInt())), #Return: HINSTANCE (casts to int ptr)

"InternetReadFile": SimTypeFunction([
SimTypeInt(), # HINTERNET hFile
SimTypePointer(SimTypeBottom()), # LPVOID lpBuffer
SimTypeInt(), # DWORD dwNumberOfBytesToRead
SimTypePointer(SimTypeInt()), # LPDWORD lpdwNumberOfBytesRead
], SimTypeInt()), # Return: BOOL

"WSARecv": SimTypeFunction([
SimTypeInt(), # SOCKET s
SimTypePointer(SimTypeBottom()), # LPWSABUF lpBuffers
SimTypeInt(), # DWORD dwBufferCount
SimTypePointer(SimTypeInt()), # LPDWORD lpNumberOfBytesRecvd
SimTypePointer(SimTypeInt()), # LPDWORD lpFlags
SimTypePointer(SimTypeBottom()), # LPWSAOVERLAPPED lpOverlapped
SimTypePointer(SimTypeBottom()), # LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
], SimTypeInt()), # Return: int

"WSARecvFrom": SimTypeFunction([
SimTypeInt(), # SOCKET s
SimTypePointer(SimTypeBottom()), # LPWSABUF lpBuffers
SimTypeInt(), # DWORD dwBufferCount
SimTypePointer(SimTypeInt()), # LPDWORD lpNumberOfBytesRecvd
SimTypePointer(SimTypeInt()), # LPDWORD lpFlags
SimTypePointer(SimTypeBottom()), # struct sockaddr *lpFrom
SimTypePointer(SimTypeInt()), # LPINT lpFromlen
SimTypePointer(SimTypeBottom()), # LPWSAOVERLAPPED lpOverlapped
SimTypePointer(SimTypeBottom()), # LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine
], SimTypeInt()), # Return: int

"RegQueryValueExA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCSTR lpValueName
SimTypePointer(SimTypeInt()), # LPDWORD lpReserved
SimTypePointer(SimTypeInt()), # LPDWORD lpType
SimTypePointer(SimTypeBottom()), # LPBYTE lpData
SimTypePointer(SimTypeInt()), # LPDWORD lpcbData
], SimTypeLong(signed=True)), # Return: LSTATUS (LONG)
# Registry deletion functions (ANSI and Unicode)
"RegDeleteKeyA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCSTR lpSubKey
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyW": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCWSTR lpSubKey
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyExA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCSTR lpSubKey
SimTypeInt(), # REGSAM samDesired
SimTypeLong(signed=True), # DWORD Reserved
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyExW": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCWSTR lpSubKey
SimTypeInt(), # REGSAM samDesired
SimTypeLong(signed=True), # DWORD Reserved
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyTransactedA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCSTR lpSubKey
SimTypeInt(), # REGSAM samDesired
SimTypeLong(signed=True), # DWORD Reserved
SimTypePointer(SimTypeBottom()), # HANDLE hTransaction
SimTypePointer(SimTypeBottom()), # PVOID pExtendedParameter
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyTransactedW": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCWSTR lpSubKey
SimTypeInt(), # REGSAM samDesired
SimTypeLong(signed=True), # DWORD Reserved
SimTypePointer(SimTypeBottom()), # HANDLE hTransaction
SimTypePointer(SimTypeBottom()), # PVOID pExtendedParameter
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyValueA": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCSTR lpSubKey
SimTypePointer(SimTypeChar()), # LPCSTR lpValueName
], SimTypeLong(signed=True)), # Return: LSTATUS

"RegDeleteKeyValueW": SimTypeFunction([
SimTypePointer(SimTypeBottom()), # HKEY hKey
SimTypePointer(SimTypeChar()), # LPCWSTR lpSubKey
SimTypePointer(SimTypeChar()), # LPCWSTR lpValueName
], SimTypeLong(signed=True)), # Return: LSTATUS
}

13 changes: 13 additions & 0 deletions package/argument_resolver/external_function/input_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,21 @@
"recv",
"recvfrom",
"custom_param_parser",
"ReadConsoleA",
"GetCommandLineA",
} | {x.name for x in VULN_TYPES["getter"]}

INPUT_EXTERNAL_FUNCTIONS.add("GetEnvironmentVariableA")
INPUT_EXTERNAL_FUNCTIONS.add("AcceptEx")
INPUT_EXTERNAL_FUNCTIONS.add("FindFirstFileA")
INPUT_EXTERNAL_FUNCTIONS.add("GetModuleFileNameA")
INPUT_EXTERNAL_FUNCTIONS.add("ReadProcessMemory")
INPUT_EXTERNAL_FUNCTIONS.add("GetClipboardData")
INPUT_EXTERNAL_FUNCTIONS.add("InternetReadFile")
INPUT_EXTERNAL_FUNCTIONS.add("WSARecv")
INPUT_EXTERNAL_FUNCTIONS.add("WSARecvFrom")
INPUT_EXTERNAL_FUNCTIONS.add("RegQueryValueExA")


KEY_BEACONS = {
"REQUEST_METHOD",
Expand Down
24 changes: 24 additions & 0 deletions package/argument_resolver/external_function/sink/sink_lists.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class Sink:
Sink(name="SLIBCExecv", vulnerable_parameters=[1]),
Sink(name="SLIBCPopen", vulnerable_parameters=[1]),
Sink(name="pegaSystem", vulnerable_parameters=[1]),
Sink(name="CreateProcessA", vulnerable_parameters=[2]), #[1,2] # lpApplicationName, lpCommandLine
Sink(name="CreateFileA", vulnerable_parameters=[1]), # [1] lpFileName
Sink(name="InternetWriteFile", vulnerable_parameters=[2]),

# Registry deletion sinks (all variants, parameter 2 is lpSubKey, parameter 3 is lpValueName for KeyValue)
]

PATH_TRAVERSAL_SINKS: List[Sink] = [
Expand Down Expand Up @@ -100,4 +105,23 @@ class Sink:
Sink(name="PTI_nvram_set", vulnerable_parameters=[2]),
]

SETTER_SINKS.append(Sink(name="SetEnvironmentVariableA", vulnerable_parameters=[1, 2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyA", vulnerable_parameters=[2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyW", vulnerable_parameters=[2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyExA", vulnerable_parameters=[2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyExW", vulnerable_parameters=[2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyTransactedA", vulnerable_parameters=[2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyTransactedW", vulnerable_parameters=[2]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyValueA", vulnerable_parameters=[2, 3]))
SETTER_SINKS.append(Sink(name="RegDeleteKeyValueW", vulnerable_parameters=[2, 3]))

ENV_SINKS: List[Sink] = GETTER_SINKS + SETTER_SINKS

#WIN32_PROCESS_SINKS: List[Sink] = [
# Sink(name="CreateProcessW", vulnerable_parameters=[1, 2]),
# Sink(name="WinExec", vulnerable_parameters=[1]),
# Sink(name="ShellExecuteA", vulnerable_parameters=[3, 4]), # lpFile, lpParameters
#]

COMMAND_INJECTION_SINKS.append(Sink(name="ShellExecuteA", vulnerable_parameters=[3]))

2 changes: 1 addition & 1 deletion package/argument_resolver/formatters/closure_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def format_multivalue_output(stored_func, atom, target_defn=None):
if defn not in val_defns:
continue
new_mv.add_value(offset, val)
if atom not in stored_func.constant_data:
if atom not in stored_func.constant_data or stored_func.constant_data[atom] is None or all(x is None for x in stored_func.constant_data[atom]):
constant_data = None
else:
constant_data = stored_func.constant_data[atom]
Expand Down
1 change: 1 addition & 0 deletions package/argument_resolver/handlers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .unistd import UnistdHandlers
from .network import NetworkHandlers
from .url_param import URLParamHandlers
from .win32 import WinHandlers
Loading