Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
6c922b5
Create new syn_flood.cpp
CarlosBeltranQ Oct 13, 2025
f73443a
Add instructions to check tcp packets.
CarlosBeltranQ Oct 13, 2025
5562d16
Working syn_flood.cpp file. Sends SYN packet to the Auth server.
CarlosBeltranQ Oct 15, 2025
7321940
Renamed syn_flood.cpp to send_syn.cpp and put all of its code in func…
CarlosBeltranQ Oct 16, 2025
b1d6339
Removed repeated variables from send_syn.cpp and integrated send_one_…
CarlosBeltranQ Oct 17, 2025
9412c71
client.cpp runs but gets "socket: Operation not permitted"
CarlosBeltranQ Oct 17, 2025
2df4982
Add metrics code and send_syn code.
CarlosBeltranQ Oct 23, 2025
c374769
Added metric logging to DOSC and DOSM
CarlosBeltranQ Oct 24, 2025
240c2cc
Added all the necessary changes so that the Testbed can run on the wo…
CarlosBeltranQ Oct 29, 2025
5818cc0
fixed syn_flood
CarlosBeltranQ Oct 29, 2025
6f45025
Minor fix.
Jakio815 Oct 29, 2025
cdc07d8
FIx to repeat read until desired bytes.
Jakio815 Oct 29, 2025
901427d
Merge branch 'flooding' of github.com:iotauth/sst-c-api into flooding
Jakio815 Oct 29, 2025
3705887
Remove sleep.
Jakio815 Oct 29, 2025
97918fd
Add reply to message attack.
Jakio815 Oct 29, 2025
6b31b1d
add sleep after first connect.
Jakio815 Oct 30, 2025
b1822f9
Minor fix.
Jakio815 Oct 30, 2025
6513ec6
Fix to add sudo for syn flood.
CarlosBeltranQ Oct 30, 2025
f3eeccb
Added plot python files and scenario 2 results
CarlosBeltranQ Oct 30, 2025
977b968
Added syn results and connect results.
CarlosBeltranQ Oct 30, 2025
02f1164
Fix loop behavior on session key retrieval failure in DOS Connect attack
CarlosBeltranQ Oct 30, 2025
ddd1554
connect results again
CarlosBeltranQ Oct 31, 2025
c12ed6a
connect_100mal2.csv uploaded
CarlosBeltranQ Oct 31, 2025
1725c60
fix to long long.
CarlosBeltranQ Oct 31, 2025
abde9aa
scenario3 metrics
CarlosBeltranQ Oct 31, 2025
35b8cf7
scenario1 metrics
CarlosBeltranQ Nov 1, 2025
e558d7b
Remove metric_logs/ from repo
CarlosBeltranQ Dec 10, 2025
598be2e
Fixed for SonarQubeCloud
CarlosBeltranQ Dec 10, 2025
9ce43ed
Added newline at the end of send_syn.cpp
CarlosBeltranQ Dec 10, 2025
5d288f1
Minor fixes.
CarlosBeltranQ Dec 10, 2025
f47b4b6
Merged changes from master branches.
CarlosBeltranQ Dec 10, 2025
50e80fa
Refactor client.cpp
CarlosBeltranQ Dec 11, 2025
d3934eb
Fix run_clients.sh
CarlosBeltranQ Dec 11, 2025
d1ed3b0
Minor fix.
CarlosBeltranQ Dec 11, 2025
efca9b5
Minor fix.
CarlosBeltranQ Dec 11, 2025
2cdab85
Add new plot.py
Jakio815 Dec 11, 2025
3f219ee
Fix readme and explanation.
Jakio815 Dec 11, 2025
e2cf1bb
Fix SST_Testbed/README.md and create new source client config file fo…
CarlosBeltranQ Dec 12, 2025
b7c17ec
Minor spacing fix.
CarlosBeltranQ Dec 12, 2025
f011ee9
Added README for lib/metrics
CarlosBeltranQ Dec 18, 2025
c0386f6
Added header to lib/README.md
CarlosBeltranQ Dec 18, 2025
935b1ae
Minor renaming.
CarlosBeltranQ Dec 18, 2025
7c43d28
Add empty folder placeholder
CarlosBeltranQ Dec 18, 2025
51b6156
Run formatting.
Jakio815 Dec 19, 2025
507c620
Added Directory Structure to SST_Testbed/README.md and removed namesp…
CarlosBeltranQ Dec 25, 2025
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
2 changes: 1 addition & 1 deletion examples/SST_Testbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ add_subdirectory(../../ ${CMAKE_BINARY_DIR}/sst-lib-build)
find_package(Threads REQUIRED)

add_executable(server server.cpp)
add_executable(client client.cpp)
add_executable(client client.cpp send_syn.cpp metrics.cpp)

foreach(prog server client)
target_link_libraries(${prog} sst-c-api Threads::Threads)
Expand Down
108 changes: 81 additions & 27 deletions examples/SST_Testbed/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# SST Testbed
---

Award-winning testing tool! [1st Place Winner in ESSC at ESWEEK 2025](https://2025.esweek.org/awards-2025/)

# Directory Structure

- `clients_dos_attack/`

Contains the scripts for creating the environment for launching the attacks with multiple clients.

- `csv_files/`

Contains the CSV files passed when executing the testbed that are used to specify the attack type.

- `lib/`

Contains the files used for tracking the metrics of the DDoS attacks.

- `metric_logs/`

Folder for storing the metric logs that are created.

- `plot_generators/`

Contains `plot.py` which generates plots for the attack metrics when given metric logs.

# Prerequisites
### ***Auth***
Expand Down Expand Up @@ -58,7 +81,7 @@ $ git submodule update --init

2. Run `mkdir build && cd build`

3. Run `cmake ..`.
3. Run `cmake ..`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add award winning on top of readme. @CarlosBeltranQ

- Run `cmake -DCMAKE_BUILD_TYPE=Debug ..` for debugging mode.

4. Run `make`
Expand Down Expand Up @@ -93,9 +116,9 @@ However, for convenience, DoS attacks with multiple clients have it's own script

2. *[Optional]* Customize `csv_files/basic_messages.csv` to have the client send custom messages to the server.
- The format of the input CSV file for this example should be:
- Each entry should be on its own line.
- First, is amount of time spent sleeping (in milliseconds).
- Second, is the message.
- Each entry is on its own line.
- The first value is the amount of time spent sleeping (in milliseconds).
- The second value is the message.
- The sleep time and message are always seperated by only a single comma.
```
<sleep_time1>,<message1>
Expand All @@ -116,14 +139,16 @@ However, for convenience, DoS attacks with multiple clients have it's own script

2. *[Optional]* Customize `csv_files/replay_attack.csv` to have the client send custom messages and replay attacks to the server,
- The format of the input CSV file for this attack example should be:
- First and second are same as above.
- Third, is the attack type word, "Replay" (case insensitive).
- Each entry is on its own line.
- The first value is the amount of time spent sleeping (in milliseconds).
- The second value is the message.
- The third value is the attack type, "Replay" in this example (case insensitive).
- Fourth, is the sequence number change because this attack revolves around modifying the sequence number.
- The formatting for changing the sequence number is "seq++", "seq--", or "seq=#" where # can be any integer.
```
<sleep_time1>,<message1>,Replay,seq--
<sleep_time2>,<message2>,REPLAY,seq++
<sleep_time2>,<message2>,replay,seq=12
<sleep_time3>,<message3>,replay,seq=12
...
```

Expand All @@ -138,15 +163,17 @@ However, for convenience, DoS attacks with multiple clients have it's own script

1. Go to `$ROOT/entity/c/examples/SST_Testbed/`

2. *[Optional]* Customize `csv_files/dos_attack_key.csv` to have the client send custom messages and DoS attacks to the server.
2. *[Optional]* Customize `csv_files/dos_attack_key.csv` to have the client send custom messages and a custom number of session key requests to Auth.
- The format of the input CSV file for this attack example should be:
- First and second are same as above.
- Third is "DoSK".
- Fourth, is the number of session key requests the client will make to Auth.
- Each entry is on its own line.
- The first value is the amount of time spent sleeping (in milliseconds).
- The second value is the message.
- The third value is the attack type, "DoSK" in this example (case insensitive).
- The fourth value is the number of session key requests the client will send to Auth.
```
<sleep_time1>,<message1>,DoSK,10000
<sleep_time2>,<message2>,DOSK,55555
<sleep_time2>,<message2>,dosk,123456
<sleep_time3>,<message3>,dosk,123456
...
```

Expand All @@ -156,19 +183,21 @@ However, for convenience, DoS attacks with multiple clients have it's own script

5. Run the client in another terminal with `./client ../../server_client_example/c_client.config ../csv_files/dos_attack_key.csv`

## 2.2.2 DoS attack to Server via session key requests (DoSM)
## 2.2.2 DoS attack to Server via Messages (DoSM)

1. Go to `$ROOT/entity/c/examples/SST_Testbed/`

2. *[Optional]* Customize `csv_files/dos_attack_message.csv` to have the client send custom messages and DoS attacks to the server.
2. *[Optional]* Customize `csv_files/dos_attack_message.csv` to have the client send custom messages and a custom number of messages to the server.
- The format of the input CSV file for this attack example should be:
- First and second are same as above.
- Third is "DoSM".
- Fourth, is the number of times the message will be sent to the server.
- Each entry is on its own line.
- The first value is the amount of time spent sleeping (in milliseconds).
- The second value is the message.
- The third value is the attack type, "DoSM" in this example (case insensitive).
- The fourth value is the number of times the message will be sent to the server.
```
<sleep_time1>,<message1>,DoSM,10000
<sleep_time2>,<message2>,DOSM,55555
<sleep_time2>,<message2>,dosm,123456
<sleep_time3>,<message3>,dosm,123456
...
```

Expand All @@ -182,15 +211,17 @@ However, for convenience, DoS attacks with multiple clients have it's own script

1. Go to `$ROOT/entity/c/examples/SST_Testbed/`

2. *[Optional]* Customize `csv_files/dos_attack_message.csv` to have the client send custom messages and DoS attacks to the server.
2. *[Optional]* Customize `csv_files/dos_attack_connect.csv` to have the client send custom messages and a custom number of connection attempts to the server.
- The format of the input CSV file for this attack example should be:
- First and second are same as above.
- Third is "DoSM".
- Fourth, is the number of times the client should connect to the server using Auth.
- Each entry is on its own line.
- The first value is the amount of time spent sleeping (in milliseconds).
- The second value is the message.
- The third value is the attack type, "DoSC" in this example (case insensitive).
- The fourth value is the number of connection attempts.
```
<sleep_time1>,<message1>,DoSC,10000
<sleep_time2>,<message2>,DOSC,55555
<sleep_time2>,<message2>,dosc,123456
<sleep_time3>,<message3>,dosc,123456
...
```

Expand All @@ -200,6 +231,30 @@ However, for convenience, DoS attacks with multiple clients have it's own script

5. Run the client in another terminal with `./client ../../server_client_example/c_client.config ../csv_files/dos_attack_connect.csv`

## 2.2.4 DoS attack to Auth via SYN Flooding
1. Go to `$ROOT/entity/c/examples/SST_Testbed/`

2. *[Optional]* Customize `csv_files/dos_attack_syn.csv` to have the client send custom messages and a custom number of SYN packets to Auth.
- The format of the input CSV file for this attack example should be:
- Each entry is on its own line.
- The first value is the amount of time spent sleeping (in milliseconds).
- The second value is the message.
- The third value is the attack type, "DoSSYN" in this example (case insensitive).
- The fourth value is the number SYN packets that will be sent to Auth.
```
<sleep_time1>,<message1>,DoSSYN,10000
<sleep_time2>,<message2>,DOSSYN,55555
<sleep_time3>,<message3>,dossyn,123456
...
```

3. Run `cd build`

4. Run the server with `./server ../../server_client_example/c_server.config`

5. Run the client in another terminal with `./client ../../server_client_example/c_client.config ../csv_files/dos_attack_syn.csv`


## 2.3 DoS attack with Multiple Clients (DDoS)
This attack involves using many clients to connect to the server to create the denial of service. To do that though, the Auth databases and configurations need to be modified to support this.
So, also make sure that the ***Auth*** executed before is terminated.
Expand All @@ -210,7 +265,7 @@ So, also make sure that the ***Auth*** executed before is terminated.

2. *[Optional]* `chmod +x clients_dos_setup.sh`

3. Run `./client_dos_setup.sh <number-of-clients> -p <password>`
3. Run `./clients_dos_setup.sh <number-of-clients> -p <password>`
- `<number-of-clients>` is the maximum amount of clients that Auth should be able to recognize and is defined by the parameter.
- *[Optional]* `<password>` is the password of the generated Auth.
- e.g., `./client_dos_setup.sh 3 -p asdf`
Expand All @@ -223,5 +278,4 @@ So, also make sure that the ***Auth*** executed before is terminated.
- The format of the file should match the corresponding format for each attack type given above because the attacks are the same, only that there are now multiple clients doing the attack simultaneously now.
- e.g., `./run_clients.sh 3 ../csv_files/dos_attack_connect.csv `

Each client will be launched in a unique terminal window and will simultaneously perform the attack specified in the input CSV file.

Each client will be launched in a unique terminal window and will simultaneously perform the attack specified in the input CSV file.
Loading
Loading