-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Tullio Sebastiani <[email protected]>
- Loading branch information
1 parent
f48dfe6
commit d4e6a59
Showing
3 changed files
with
39 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM fedora:40 | ||
|
||
env TARGET $TARGET | ||
env DURATION $DURATION | ||
env TARGET_PORT $TARGET_PORT | ||
env PACKET_SIZE $PACKET_SIZE | ||
env WINDOW_SIZE $WINDOW_SIZE | ||
USER root | ||
RUN dnf update -y && dnf install --setopt=install_weak_deps=False -y hping3 && dnf clean all | ||
WORKDIR /syn-flood | ||
COPY run.sh run.sh | ||
RUN chmod +x ./run.sh | ||
#ENTRYPOINT ["/bin/bash", "run.sh", $TARGET, $DURATION, $TARGET_PORT, $PACKET_SIZE, $WINDOW_SIZE] | ||
ENTRYPOINT ["/bin/bash", "run.sh"] |
Empty file.
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,25 @@ | ||
#!/bin/bash | ||
|
||
_TARGET=$TARGET | ||
_DURATION=$DURATION | ||
_TARGET_PORT=$TARGET_PORT | ||
_PACKET_SIZE=${PACKET_SIZE:-120} | ||
_WINDOW_SIZE=${WINDOW_SIZE:-64} | ||
|
||
|
||
[ -z $_TARGET ] && echo "\$TARGET env var missing: Target host must be set" && exit 1 | ||
[ -z $_DURATION ] && echo "\$DURATION env var missing: Flood duration must be set" && exit 1 | ||
[ -z $_TARGET_PORT ] && echo "\$TARGET_PORT env var missing: Target port must be set" && exit 1 | ||
|
||
echo "TARGET: $_TARGET" | ||
echo "FLOOD DURATION: $_DURATION" | ||
echo "PACKET SIZE: $_PACKET_SIZE" | ||
echo "TCP WINDOW SIZE: $_WINDOW_SIZE" | ||
echo "FLOOD TARGET PORT: $_TARGET_PORT" | ||
|
||
hping3 -d $_PACKET_SIZE -S -w $_WINDOW_SIZE -p $_TARGET_PORT --flood --rand-source $_TARGET& | ||
|
||
HPING_PID=$! | ||
sleep $_DURATION | ||
kill -9 $HPING_PID | ||
exit 0 |