Skip to content

Commit 6697513

Browse files
authored
improve TCP/UDP socket creation matching #964 (#993)
* improve TCP/UDP socket creation matching #964 * Adding references * adding IPPROTO_UDP * relax rule * function -> basic block * adding bytes for indirect(0) * adding bytes for indirect(0) * back to default changes * moved to nursery * final change * resolving comment * indentation error
1 parent 740d473 commit 6697513

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

communication/socket/tcp/create-tcp-socket.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ rule:
1212
dynamic: call
1313
mbc:
1414
- Communication::Socket Communication::Create TCP Socket [C0001.011]
15+
references:
16+
- https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket
17+
- https://man7.org/linux/man-pages/man2/socket.2.html
1518
examples:
1619
- Practical Malware Analysis Lab 01-01.dll_:0x10001010
1720
features:
1821
- or:
1922
- and:
20-
- number: 6 = IPPROTO_TCP
23+
- or:
24+
- number: 0 = protocol (default)
25+
- number: 6 = IPPROTO_TCP
2126
- number: 1 = SOCK_STREAM
2227
- number: 2 = AF_INET
2328
- or:

communication/socket/udp/send/create-udp-socket.yml renamed to nursery/create-udp-socket.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ rule:
1111
dynamic: call
1212
mbc:
1313
- Communication::Socket Communication::Create UDP Socket [C0001.010]
14-
examples:
15-
- 203BD48BCC18434314AD60F4C8BC21E3D3422EB0624B22B827410F9BC63B4082:0x401240
14+
references:
15+
- https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-socket
16+
- https://man7.org/linux/man-pages/man2/socket.2.html
1617
features:
1718
- or:
1819
- and:
19-
- count(number(2 = AF_INET/SOCK_DGRAM)): 2 or more
20+
- number: 2 = AF_INET
21+
- number: 2 = SOCK_DGRAM
22+
- or:
23+
- number: 0 = protocol (default)
24+
- number: 17 = IPPROTO_UDP
2025
- or:
2126
- api: socket
2227
- api: ws2_32.socket

0 commit comments

Comments
 (0)