Skip to content

Correct buffer data retrieval logic in etherhiding C2 - #595

Merged
kevoreilly merged 1 commit into
CAPESandbox:masterfrom
kevross33:patch-169562
Jul 31, 2026
Merged

Correct buffer data retrieval logic in etherhiding C2#595
kevoreilly merged 1 commit into
CAPESandbox:masterfrom
kevross33:patch-169562

Conversation

@kevross33

@kevross33 kevross33 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Refactor buffer data retrieval to include 'PostData'.

7c98950ce2ec028b5d653e699ca4cb12b09aa84a732be3a8ae9321378cfa5c67
image

Refactor buffer data retrieval to include 'PostData'.
@kevross33 kevross33 changed the title Update buffer data retrieval logic Correct buffer data retrieval logic in etherhiding C2 Jul 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the payload extraction logic in the network_c2_etherhiding signature by removing the lpBuffer and lpOptional arguments and adding Optional. However, removing lpBuffer and lpOptional will cause the signature to miss payloads from key APIs such as InternetWriteFile and HttpSendRequestA, leading to false negatives. It is recommended to retain these arguments alongside the newly added ones to ensure comprehensive coverage.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 51 to 56
buffer_data = (
self.get_argument(call, "buffer")
or self.get_argument(call, "lpBuffer")
or self.get_argument(call, "lpOptional")
or self.get_argument(call, "Buffer")
or self.get_argument(call, "Optional")
or self.get_argument(call, "PostData")
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Removing lpBuffer and lpOptional will cause the signature to miss payloads transmitted via several key APIs listed in filter_apinames:\n\n* InternetWriteFile and WinHttpWriteData pass their payload buffer in the lpBuffer argument.\n* HttpSendRequestA/HttpSendRequestW and WinHttpSendRequest pass their POST/optional data in the lpOptional argument.\n\nBy removing these arguments, the signature will fail to retrieve the buffer data for these APIs, leading to false negatives. We should retain both lpBuffer and lpOptional alongside the newly added Optional and PostData to ensure comprehensive coverage across different API hooks and monitor versions.

        buffer_data = (\n            self.get_argument(call, "buffer")\n            or self.get_argument(call, "Buffer")\n            or self.get_argument(call, "lpBuffer")\n            or self.get_argument(call, "lpOptional")\n            or self.get_argument(call, "Optional")\n            or self.get_argument(call, "PostData")\n        )

@kevoreilly
kevoreilly merged commit a736ff6 into CAPESandbox:master Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants