Skip to content

Commit 4a78b24

Browse files
authored
Merge pull request #82 from tstromberg/xz_incident
Increasingly paranoid rules based on xz analysis
2 parents e2f5223 + 39746d7 commit 4a78b24

File tree

7 files changed

+62
-2
lines changed

7 files changed

+62
-2
lines changed

rules/env/LD_DEBUG.yara

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rule env_LD_DEBUG : suspicious {
2+
meta:
3+
description = "Checks if dynamic linker debugging is enabled"
4+
strings:
5+
$val = "LD_DEBUG" fullword
6+
condition:
7+
all of them
8+
}

rules/env/LD_PROFILE.yara

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rule env_LD_PROFILE : suspicious {
2+
meta:
3+
description = "Checks if dynamic linker profiling is enabled"
4+
strings:
5+
$val = "LD_PROFILE" fullword
6+
condition:
7+
all of them
8+
}

rules/env/TERM.yara

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rule TERM : harmless {
1+
rule TERM {
22
meta:
33
description = "Look up or override terminal settings"
44
strings:

rules/ref/program/sshd.yara

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ rule sshd : notable {
88
$ref
99
}
1010

11+
rule sshd_path_value : suspicious {
12+
meta:
13+
description = "Mentions the SSH daemon by path"
14+
strings:
15+
$ref = "/usr/bin/sshd" fullword
16+
condition:
17+
$ref
18+
}
1119

1220
rule sshd_net : suspicious {
1321
meta:

rules/shell/byte_offsets.yara

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
rule tail_byte_offsets : notable {
2+
meta:
3+
description = "uses the tail command with exotic offset values"
4+
strings:
5+
$val = /tail -c \+\d{3,8}/
6+
condition:
7+
any of them
8+
}
9+
10+
rule head_byte_offsets : notable {
11+
meta:
12+
description = "uses the head command with exotic offset values"
13+
strings:
14+
$val = /head -c \+\d{3,8}/
15+
condition:
16+
any of them
17+
}

rules/shell/pipe_sh.yara

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
rule pipe_to_shell : notable {
2+
meta:
3+
description = "pipes to shell"
4+
strings:
5+
$val_sh = "| sh"
6+
$val_bin_sh = "| /bin/sh"
7+
$val_bash = "| bash"
8+
$val_bin_bash = "| /bin/bash"
9+
condition:
10+
any of them
11+
}

rules/techniques/code_eval.yara

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ rule eval : suspicious {
88
$ref and not $empty
99
}
1010

11-
1211
rule python_exec : suspicious {
1312
meta:
1413
description = "evaluate code dynamically using exec()"
@@ -18,3 +17,12 @@ rule python_exec : suspicious {
1817
condition:
1918
$ref and not $empty
2019
}
20+
21+
rule shell_eval : suspicious {
22+
meta:
23+
description = "evaluate code dynamically using eval"
24+
strings:
25+
$val = /eval \$\w{0,64}/ fullword
26+
condition:
27+
$val
28+
}

0 commit comments

Comments
 (0)