cover-2.txt 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. ------------------------------------------------------------------------------
  2. ################################################
  3. # #
  4. # HOW TO COVER YOUR TRACKS #
  5. # #
  6. ################################################
  7. PART TWO : PRACTICE
  8. I. THE FIRST COMMAND
  9. The first command you should enter after logging in with a hacked account
  10. is a shell different from the one you are currently running as login shell.
  11. The purpose is to disable history saving of the commands you'll type in
  12. while hacking. A history check by the real user or sysadmin reveils your
  13. presence and what you did!!
  14. If you are running a CSH then execute a SH and vice versa.
  15. $ <- this is a SH prompt
  16. % <- this is a CSH prompt
  17. If it does not look like the standard prompts above then execute SH.
  18. If the prompt stays the same, type "exit" and execute the CSH ...
  19. The reason for using these two shells and not bash, ksh, zsh etc. is
  20. that these two are simple with no extra options enabled by default
  21. (like history saving).
  22. II. LASTLOG WORKAROUND
  23. If you saw a text like "Last successful login from alpha.master.mil"
  24. when you logged on with the hacked account and you can't hack root or
  25. don't want to disrupt the system logs with deleting data then execute
  26. the following : "rlogin <the_host_you_are_on>" and provide again the
  27. password of the hacked account if necessary. After seeing the shell
  28. prompt type exit to be back again. This will change the header
  29. "Last login from ..." etc. to the <current host> or "localhost"
  30. which is much more unsuspicious than "site.real.user.never.saw.com"
  31. Of course you only need to do this if your origin host might attract
  32. attention to user and/or sysadmin.
  33. III. WHO WORKAROUND
  34. After completing step 1 + 2 type "w" ... you'll see all currently
  35. online users ... with the adress they logged on from. Once again
  36. something like your origin host in the netherlands will be very
  37. suspicious to users and/or root if the site is in the usa.
  38. If you can't hack root or once again don't want to tamper with the
  39. log files you can try a bug which works still for many up2date
  40. unix distributions: just execute "login" with the same login+password.
  41. Type "w" again and if it worked, your origin will be changed to
  42. something like "tty05".
  43. Of course you only need to do this if your origin host might attract
  44. attention by other users and/or sysadmin.
  45. V. EXECUTING PROGRAMS
  46. Don't execute programs with suspicous names ... ISS and YPX are for
  47. example very suspicous, and a skilled admin knows what's going on if
  48. he sees a user running "loadmodule SandraBullok" on his Sun ... ;-)
  49. Either you copy & rename the commands or you use those sources around
  50. which exchanges the command name in the process list.
  51. Btw. the process list can be checked by "ps -ef" or "ps -auxwww" and
  52. the current command every user is executing with "w" and the most CPU
  53. consuming processes with "top" ... so it's really easy to monitor
  54. the programs the user(s) are running.
  55. VI. EXECUTING TELNET
  56. There are only two things which should be said about about using telnet
  57. for hacking purpose (e.g. doing a telnet to the next target).
  58. First NEVER just type "telnet target.host.com". Type "telnet" and then
  59. "open target.host.com" which will not show up as parameter in the process
  60. list. The seconds is that some telnet clients do export enviroment
  61. variables. And if your hack is detected and they could trace the
  62. connection back to your origin host they could also have got the account
  63. you used on the origin host. So redefine (to anything you want) the
  64. following environement variables before starting telnet, rlogin or similar:
  65. USER, LOGNAME, UID, HOME, MAIL - maybe you should do a "cd /tmp" too
  66. to change the PWD variable too ...
  67. To change those variables ->
  68. SH : <variable>=<new_value>;export <variable>
  69. example : USER=nobody;export USER
  70. CSH: setenv <variable> <new_value>
  71. example : setenv USER nobody
  72. and don't forget to reset the variables after your telnet if you want to
  73. do something with the account before you log out.
  74. VII. REMOVE YOUR FILES
  75. When you tried exploits - successful or not - delete them immedeantely
  76. after trying them - especially if you try them in /tmp !
  77. Nothing is more interesting than snooping in the /tmp directory to see
  78. what other users are doing ... If you really need to work in the temp
  79. directory (because suid is squashed in your home dir) then create a
  80. usual directory like ".X11", and give it 711 permissions.
  81. Remember, if someone snoops in the directories while you are hacking or
  82. your loose connection and can't relogin or you forget about them you
  83. are in deep trouble.
  84. --> ! The following 2 points are only possible with root access ! <--
  85. VI. MODIFYING THE LOGS
  86. The important log files are LASTLOG, WTMP and UTMP.
  87. If you were successful in hacking root then you should modify them.
  88. They can usually be found in /etc, /var/adm or /var/log ... it differs,
  89. just check the man pages.
  90. Which tools should you use? ZAP (or ZAP2) is nice, but it does NOT delete
  91. you from the logs but overwrite the entries with zeros. CERT already
  92. published tools which easily check the logs for those overwritten entries.
  93. And nothing shouts more "Hey there's a hacker on the system with root
  94. access!" into the sysadmin's face than that.
  95. Important for ZAP : Check the paths defined in the sources for the logs!
  96. Try CLOAK2 which can change the data of the important data fields ;) But
  97. it doesn't compile on all unix OS types.
  98. You can also try CLEAR, included in this magazine, which REALLY deletes
  99. the entries ... ;)
  100. VII. SYSLOG & LASTCOMM
  101. You should also check the syslog messages logfile if maybe entries with
  102. your hacked account or your origin host are in it. It's usually located
  103. in /var/adm or /var/log ... most time it's called "messages" but again
  104. can differ - and also check other logfiles there which are generated by
  105. auth.* and authpriv.* messages (and of course xferlog etc.).
  106. Check the file /etc/syslog.conf to see the correct file and check out what
  107. is logged to which file/program/mail/user.
  108. If you see something like "@loghost" and you find your origin host in
  109. the messages file than you've got a problem. It's also logged at another
  110. site which is most time not accessible from remote. But try to install
  111. a sniffer, (see section VIII. !) and check if a root does a successful
  112. login to the loghost - and then you've got also the password for that
  113. host and are in to handle the problem ;)
  114. To remove f.e. your hostname from the "messages" logfile execute :
  115. "grep -v evil.host.com messages > /tmp/tmpfile; mv /tmp/tmpfile messages"
  116. LASTCOMM (from accton etc.) is a tool to log all executed commands, with
  117. a flag if the file executed had the SUID flag set and if a command was
  118. executed by root. You can find this logfile in the same directory as the
  119. syslog file. That's a really evil tool against hackers but - luck! -
  120. most times it is not installed. But now you don't have to fear that
  121. anymore :) Get Zhart's excellent ACCT Cleaner and feel the freedom ;-)
  122. VIII. INSTALLING TROJANS
  123. When you install a sniffer, remember that anyone can execute "ifconfig -a"
  124. to check if the card is in promiscious mode. Get a rootkit for your unix
  125. OS and replace it. Run fixer.c on it for the correct checksum and date/time
  126. but check the root account first if maybe tripwire or other binary checker
  127. are installed! Remember this for every binary you replace. If the binary
  128. is in a directory which is NFS mounted and can't be remounted in write mode
  129. then you must first hack the NFS host - life isn't easy sometimes ;)
  130. X. THE END
  131. I hope you had fun and learned alot from these two textfiles, the
  132. theory/background and the practice one.
  133. For updates, tips, tricks etc. just email me at -> mc@thc.net
  134. Remember : Never get lazy. Every work must be done 100% -
  135. or face the consequences!
  136. van Hauser
  137. Type Bits/KeyID Date User ID
  138. pub 1024/3B188C7D 1995/10/10 van Hauser/THC of LORE BBS
  139. -----BEGIN PGP PUBLIC KEY BLOCK-----
  140. Version: 2.6.3i
  141. mQCNAzB6PNQAAAEEALx5p2jI/2rNF9tYandxctI6jP+ZJUcGPTs7QTFtF2c+zK9H
  142. ElFfvsC0QkaaUJjyTq7TyII18Na1IuGj2duIHTtG1DTDOnbnZzIRsXndfjCIz5p+
  143. Dt6UYhotbJhCQKkxuIT5F8EZpLTAL88WqaMZJ155uvSTb9uk58pv3AI7GIx9AAUT
  144. tBp2YW4gSGF1c2VyL1RIQyBvZiBMT1JFIEJCU4kAlQMFEDJ2gzNAf3b9d/IP1QEB
  145. 5DwD+gJRh6m4h0fVgpQJkOiuQD68lV5w8C0F5R3jk/o6Pollaf7gtVhG8BGGo5/7
  146. /yiH40gujc82rJdmihwcKuZQtwt8X28VN8uy56SCpXD5wjjOZpq0t0qSXmhgunZ0
  147. m7xv7R4mWRzFclsgQCMwXNgp4sXgw64bVm8FhEdkrVSO8iTyiQCVAwUQMkMhCspv
  148. 3AI7GIx9AQFstAP+Jrg7V06FGV/sTzegFNoaSyOItkvXjctzFsXuBfta2M7EzPX3
  149. UR3kM4/W4xE70H4XmMOJ9RmTzs+MuhSq8BtGQtYaJqGjxe/ldbvGOXRxR1rBJAKS
  150. yDQYu0VJ/Ae8yuJcMS312jqwg8OLgYnQaqEoaRM4HEiB+hgDRqnFKpDxkhSJAJUD
  151. BRAyQx8E5y7IvlL6xvEBAQ+bA/9baK7f3M9F5n4aASy04WHOreUNpGQ8DXgtMVq7
  152. KVdXMIWjURsboR+wt5eJTPeL00lHS5eqmZlNzGV9hWtzAr20qrKLmvE20Ke4VPB0
  153. a/tWXNUdvLnk4ENbTBFfMMdnlDo3hSThSMQ7yZ9UEYgighKu6l2fG5UG6D+kXFLy
  154. iIvvlA==
  155. =nX2w
  156. -----END PGP PUBLIC KEY BLOCK-----
  157. ------------------------------------------------------------------------------
  158.