Skip to content

Commit 7372b16

Browse files
authored
Merge pull request #153 from manuelbua/detect-linkerd-service
Initial Linkerd service detection rules
2 parents 2d56871 + 4104238 commit 7372b16

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
id: linkerd-badrule-detect
2+
3+
# Detect the Linkerd service by overriding the delegation table with an invalid
4+
# rule, the presence of the service is indicated by either:
5+
# - a "Via: .. linkerd .."
6+
# - a "l5d-err" and/or a "l5d-success" header
7+
# - a literal error in the body
8+
9+
info:
10+
name: Linkerd detection via bad rule
11+
author: dudez
12+
severity: low
13+
14+
requests:
15+
- method: GET
16+
path:
17+
- "{{BaseURL}}/"
18+
headers:
19+
l5d-dtab: /svc/*
20+
21+
matchers-condition: or
22+
matchers:
23+
- type: regex
24+
name: via-linkerd-present
25+
regex:
26+
- '(?mi)^Via\s*?:.*?linkerd.*$'
27+
part: header
28+
29+
- type: regex
30+
name: l5d-err-present
31+
regex:
32+
- '(?mi)^l5d-err:.*$'
33+
part: header
34+
35+
- type: regex
36+
name: l5d-success-class-present
37+
regex:
38+
- '(?mi)^l5d-success-class: 0.*$'
39+
part: header
40+
41+
- type: word
42+
name: body-error-present
43+
words:
44+
- 'expected but end of input found at'
45+
part: body
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
id: linkerd-ssrf-detect
2+
3+
# Detect the Linkerd service by overriding the delegation table and
4+
# inspect the response for:
5+
# - a "Via: .. linkerd .."
6+
# - a "l5d-err" and/or a "l5d-success" header
7+
# - a verbose timeout error (binding timeout)
8+
# - a full response
9+
# The full-response case indicates a possible SSRF condition, the others
10+
# only indicates the service presence.
11+
#
12+
# If a full-response is returned you should really manually probe requests with
13+
# the following header values:
14+
#
15+
# - "l5d-dtab: /svc/* => /$/inet/yourserver.com/80", to get to other external hosts
16+
# - "l5d-dtab: /svc/* => /$/inet/169.254.169.254/80", to get to cloud metadata
17+
18+
info:
19+
name: Linkerd SSRF detection
20+
author: dudez
21+
severity: medium
22+
23+
requests:
24+
- method: GET
25+
path:
26+
- "{{BaseURL}}/"
27+
headers:
28+
l5d-dtab: /svc/* => /$/inet/example.com/443
29+
30+
matchers-condition: or
31+
matchers:
32+
- type: regex
33+
name: via-linkerd-present
34+
regex:
35+
- '(?mi)^Via\s*?:.*?linkerd.*$'
36+
part: header
37+
38+
- type: regex
39+
name: l5d-err-present
40+
regex:
41+
- '(?mi)^l5d-err:.*$'
42+
part: header
43+
44+
- type: regex
45+
name: l5d-success-class-present
46+
regex:
47+
- '(?mi)^l5d-success-class: 0.*$'
48+
part: header
49+
50+
- type: word
51+
name: ssrf-response-body
52+
words:
53+
- '<p>This domain is for use in illustrative examples in documents.'
54+
part: body
55+
56+
- type: regex
57+
name: resolve-timeout-error-present
58+
regex:
59+
- '(?mi)Exceeded .*? binding timeout while resolving name'
60+
part: body
61+
62+
- type: regex
63+
name: dynbind-error-present
64+
regex:
65+
- '(?mi)exceeded .*? to unspecified while dyn binding'
66+
part: body

0 commit comments

Comments
 (0)