Bash Scanner!

Idea behind this file, i downloaded a shell script from the internet, and i don't revive the source code of the file, and run it, but the file is contains `rm -rf .` command, after running the file, my all files are deleted in current directory. :-(
patch-1
ransomsec 2022-09-14 16:06:58 +05:30 committed by GitHub
parent 4af56f0b06
commit 1d63590c93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 50 additions and 0 deletions

50
file/bash/bash.yaml Normal file
View File

@ -0,0 +1,50 @@
id: bash-scanner
info:
name: bash-scanner
author: ransomsec
severity: info
description: "Indicator for bash Dangerous Commands You Should Never Execute on Linux"
tags: bash,shell,sh
reference:
- "https://www.tecmint.com/10-most-dangerous-commands-you-should-never-execute-on-linux/"
- "https://phoenixnap.com/kb/dangerous-linux-terminal-commands"
file:
- extensions:
- sh
extractors:
- type: regex
name: fork-bomb
regex:
- ":(){:|:&};:"
- type: regex
name: rm commad found
regex:
- "rm -(f|r)"
- "rm -(fr|rf)"
- type: regex
name: code injection
regex:
- "/bin/(sh|bash) -"
- "eval"
- "echo -c"
- "/bin/(sh|bash) -c"
- "(sh|bash) -"
- "(sh|bash) -c"
- type: regex
name: file manipulation
regex:
- "cat /dev/null >"
- type: regex
name: unknown-file-download
regex:
- '(wget|curl) (https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]\.[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]$'