Kod: Zaznacz cały
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
~/script.sh
exit 0
Kod: Zaznacz cały
#!/bin/bash
re='^[0-9]+$'
# do celow testowych tworzymy na pulpicie plik z datą
touch /home/piotr/Pulpit/$(date +"%s")
cd ~/hashcat-0.47/
param=$(cat ~/hashcat-0.47/file.txt)
# jeśli odczytany parametr jest pusty lub nie jest liczbą
if [[ -z "$param" || ! "$param" =~ $re ]]; then
param=400000
echo $param > ~/hashcat-0.47/file.txt
fi
echo $param
# this script is ivoked with paramaters and its output is redirected to be written to a file called file.txt
./hashcat-cli32.bin -m 400 -a 3 --pw-min=12 --pw-max=12 -o rockyou.txt --remove hashfile.all -s $param ?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d?l?u?d > ~/hashcat-0.47/file.txt 2>&1
var=$(grep -o "[0-9]\{5,\}" ~/hashcat-0.47/file.txt)
echo $var > ~/hashcat-0.47/file.txt
Kod: Zaznacz cały
ps -aux | grep "script"