-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from tstromberg/main
Improve rules through laysound PyPi analysis
- Loading branch information
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
|
||
rule python_eval_or_exec { | ||
rule python_eval_or_exec : critical { | ||
strings: | ||
$exec_requests = "exec(requests.get" | ||
$eval_requests = "eval(requests.get" | ||
condition: | ||
filesize < 1048576 and any of them | ||
filesize < 16384 and any of them | ||
} | ||
|
||
|
||
rule http_open_write_system : suspicious { | ||
strings: | ||
$http = "http" | ||
$h_rget = "requests.get" | ||
$open = "open(" | ||
$write = "write(" | ||
$system = "os.system(" | ||
$sys_popen = "os.popen" | ||
condition: | ||
filesize < 16384 and any of ($h*) and $open and $write and any of ($sys*) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
rule getenv : harmless { | ||
meta: | ||
description = "Retrieve the value of an environment variable" | ||
description = "Retrieve environment variables" | ||
strings: | ||
$getenv = "getenv" fullword | ||
$go_Getenv = "Getenv" fullword | ||
$secure_getenv = "secure_getenv" fullword | ||
$python_val = "os.environ" | ||
condition: | ||
any of them | ||
} | ||
|
||
rule get_env_val { | ||
meta: | ||
description = "Retrieve environment variable values" | ||
strings: | ||
$node_val = /env\.[A-Z]{3,16}/ | ||
$python_val = /os\.environ\[[\'\"][a-zA-Z]{1,32}[\'\"]\]/ | ||
condition: | ||
any of them | ||
} |
2 changes: 1 addition & 1 deletion
2
rules/net/ip-external_address-query.yara → rules/net/public_ip.yara
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters