-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7df0db
commit 8243710
Showing
13 changed files
with
81 additions
and
7 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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
*.pyc | ||
|
||
CC2540_connection_req_crash.pcap | ||
|
||
release/ |
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 @@ | ||
{ | ||
"cmake.configureOnOpen": false | ||
} |
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,17 @@ | ||
FROM python:2.7.17-slim-buster | ||
# Default script to execute | ||
ENV test dhcheck_skip.py | ||
ENV port /dev/ttyACM0 | ||
ENV addr "" | ||
WORKDIR / | ||
# Add main python scripts and folders | ||
ADD *.py / | ||
ADD drivers /drivers/ | ||
ADD libs /libs/ | ||
ADD extras /extras/ | ||
ADD captures /captures/ | ||
# Add helper files | ||
ADD nRF52_driver_firmware.zip requirements.txt install_sweyntooth.sh flash_nRF52_driver_firmware.sh / | ||
|
||
RUN mkdir -p /logs && apt update && chmod +x install_sweyntooth.sh && ./install_sweyntooth.sh && apt-get autoremove && apt-get clean | ||
CMD [ "sh", "-c", "python ${test} ${port} ${addr} && find ./ -maxdepth 1 -name '*.pcap' -exec cp {} logs \\; && find ./extras -maxdepth 1 -name '*.pcap' -exec cp '{}' logs \\;" ] |
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
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ "$1" == "build" ] | ||
then | ||
docker build -t sweyntooth:latest . | ||
if [ "$2" == "release" ] | ||
then | ||
mkdir -p release | ||
docker image save sweyntooth | gzip -9 -c > release/sweyntooth.tar.gz | ||
chmod a+rw release/sweyntooth.tar.gz | ||
echo "Image release/sweyntooth.tar.gz created!" | ||
fi | ||
|
||
elif [ "$1" == "run" ] | ||
then | ||
if [ -z $2 ] | ||
then | ||
echo "Insert python script name to start" | ||
exit | ||
fi | ||
|
||
docker run --privileged --rm -e test="$2" -e port=$3 -e addr=$4 -ti --mount type=bind,source="$(pwd)"/logs,target=/logs sweyntooth # Start sweyntooth container | ||
|
||
elif [ "$1" == "shell" ] | ||
then | ||
docker run --rm --entrypoint bash --mount type=bind,source="$(pwd)"/logs,target=/logs -ti sweyntooth # Start container with bash and mount files | ||
|
||
else | ||
echo "--------- HELP -------------" | ||
echo "sudo ./docker run <script_name> <serial_port> <ble_target_address> - Start any sweyntooth script by its name (<script_name>)" | ||
echo "sudo ./docker build - Build docker container" | ||
echo "sudo ./docker build release - Build docker container and create compressed image for release" | ||
echo "sudo ./docker shell - Start docker container shell" | ||
echo "---------- EXAMPLE ----------" | ||
echo "./docker.sh run extras/Microchip_and_others_non_compliant_connection.py /dev/ttyACM0 f0:f8:f2:da:09:63" | ||
fi |
Empty file.
Empty file.
Empty file.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#!/usr/bin/env bash | ||
sudo apt install python-dev gcc g++ make -y | ||
apt install python-dev gcc g++ make -y | ||
python -m pip install -r requirements.txt | ||
cd ./libs/smp_server/ | ||
make build | ||
sudo make install | ||
cd ../ | ||
make install | ||
cd ../../ |