Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP socks #2195

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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 not shown.
33 changes: 33 additions & 0 deletions tests/socks/bug-4965-socks-http-01/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
requires:
min-version: 8

args:
- --set app-layer.protocols.socks.tcp.detection-ports.dp=9200

checks:
- filter:
count: 1
match:
event_type: socks
socks.auth_methods.request[0]: "No authentication"
socks.auth_methods.request[1]: "No authentication"
socks.auth_methods.response: "No authentication"
- filter:
count: 1
match:
event_type: socks
socks.connect.domain: "eternityms33k74r7iuuxfda4sqsiei3o3lbtr5cpalf6f4skszpruad.onion"
socks.connect.port: 80
socks.connect.response: "Success"
- filter:
count: 1
match:
event_type: http
http.url: "/stld/2ed742b9631a445a90864552c8b213a9?u=YWRtaW4%3D&p=VVNFUi1QQw%3D%3D&i=ODQuMTcuNDguMTgy&co=R2VybWFueSAoREUp&ci=RnJhbmtmdXJ0IGFtIE1haW4%3D&t=Y2hyaWJvdHM%3D"
http.status: 200
- filter:
count: 1
match:
event_type: flow
app_proto: http
app_proto_orig: socks
384 changes: 384 additions & 0 deletions tests/socks/bug-4965-socks-http-03-frames/suricata.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tests/socks/bug-4965-socks-http-03-frames/test.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
alert socks any any -> any any (frame:pdu; content:"|05|"; startswith; sid:1;)
alert socks any any -> any any (frame:connect.domain; content:"eternityms33k74r7iuuxfda4sqsiei3o3lbtr5cpalf6f4skszpruad.onion"; startswith; endswith; sid:2;)
41 changes: 41 additions & 0 deletions tests/socks/bug-4965-socks-http-03-frames/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
requires:
min-version: 8

pcap: ../bug-4965-socks-http-01/aa391f05-780d-4a98-a520-eff3a436b3cf_SOCKS_only.pcap

args:
- --set app-layer.protocols.socks.tcp.detection-ports.dp=9200

checks:
- filter:
count: 1
match:
event_type: socks
socks.auth_methods.request[0]: "No authentication"
socks.auth_methods.request[1]: "No authentication"
socks.auth_methods.response: "No authentication"
- filter:
count: 1
match:
event_type: socks
socks.connect.domain: "eternityms33k74r7iuuxfda4sqsiei3o3lbtr5cpalf6f4skszpruad.onion"
socks.connect.port: 80
socks.connect.response: "Success"
- filter:
count: 1
match:
event_type: frame
frame.type: connect.domain
frame.payload_printable: "eternityms33k74r7iuuxfda4sqsiei3o3lbtr5cpalf6f4skszpruad.onion"
- filter:
count: 1
match:
event_type: http
http.url: "/stld/2ed742b9631a445a90864552c8b213a9?u=YWRtaW4%3D&p=VVNFUi1QQw%3D%3D&i=ODQuMTcuNDguMTgy&co=R2VybWFueSAoREUp&ci=RnJhbmtmdXJ0IGFtIE1haW4%3D&t=Y2hyaWJvdHM%3D"
http.status: 200
- filter:
count: 1
match:
event_type: flow
app_proto: http
app_proto_orig: socks
Binary file not shown.
40 changes: 40 additions & 0 deletions tests/socks/bug-4965-socks-tls-02/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
requires:
min-version: 8

args:
- -k none

checks:
- filter:
count: 1
match:
event_type: socks
socks.auth_methods.request[0]: "No authentication"
socks.auth_methods.request[1]: "GSSAPI"
socks.auth_methods.request[2]: "Username/Password"
socks.auth_methods.response: "Username/Password"
- filter:
count: 1
match:
event_type: socks
socks.auth_userpass.user: proxyuser
socks.auth_userpass.pass: securepassword
socks.auth_userpass.response: "Success"
- filter:
count: 1
match:
event_type: socks
socks.connect.ipv4: 35.212.0.44
socks.connect.port: 443
socks.connect.response: "Success"
- filter:
count: 1
match:
event_type: tls
tls.sni: suricata.io
- filter:
count: 1
match:
event_type: flow
app_proto: tls
app_proto_orig: socks
Loading