home *** CD-ROM | disk | FTP | other *** search
/ Hacks & Cracks / Hacks_and_Cracks.iso / hackersclub / km / library / hack / gtmhh_bs32.txt < prev    next >
Text File  |  1998-03-25  |  16KB  |  352 lines

  1. ___________________________________________________________
  2.  
  3. GUIDE TO (mostly) HARMLESS HACKING
  4.  
  5. BeginnersÆ Series #3 Part 2
  6.  
  7. How to Get a *Good* Shell Account
  8. ____________________________________________________________
  9.  
  10.  
  11. ____________________________________________________________
  12. In this section you will learn:
  13.  
  14. ╖ how to explore your shell account
  15. ╖ Ten Meinel Hall of Fame Shell Account Exploration Tools
  16. ╖ how to decide whether your shell account is any good for hacking
  17. ╖ Ten Meinel Hall of Fame LAN and Internet Exploration Tools
  18. ╖ Meinel Hall of Infamy Top Five Ways to Get Kicked out of Your Shell Account
  19. ____________________________________________________________
  20.  
  21.  
  22. How to Explore Your Shell Account
  23.  
  24.  
  25. So youÆre in your shell account. YouÆve tried the ôls -alFö command and are
  26. pretty sure this really, truly is a shell account. What do you do next?
  27.  
  28. A good place to start is to find out what kind of shell you have. There are
  29. many shells, each of which has slightly different ways of working. To do
  30. this, at your prompt give the command ôecho $SHELL.ö Be sure to type in the
  31. same lower case and upper case letters. If you were to give the command
  32. ôECHO $shell,ö for example, this command wonÆt work. 
  33.  
  34. If you get the response:
  35.  
  36.     /bin/sh
  37.  
  38. That means you have the Bourne shell.
  39.  
  40. If you get:
  41.  
  42.     /bin/bash
  43.  
  44. Then you are in the Bourne Again (bash) shell.
  45.  
  46. If you get:
  47.  
  48.     /bin/ksh 
  49.  
  50. You have the Korn shell.
  51.  
  52. If the ôecho $SHELLö command doesnÆt work, try the command ôecho $shell,ö
  53. remembering to use lower case for ôshell.ö  This will likely get you the answer:
  54.  
  55.     /bin/csh
  56.  
  57. This means you have the C shell.
  58.  
  59. Why is it important to know which shell you have? For right now, youÆll want
  60. a shell that is easy to use. For example, when you make a mistake in typing,
  61. itÆs nice to hit the backspace key and not see ^H^H^H on your screen. Later,
  62. though, for running those super hacker exploits, the C shell may be better
  63. for you. 
  64.  
  65. Fortunately, you may not be stuck with whatever shell you have when you log
  66. in. If your shell account is any good, you will have a choice of shells.
  67.  
  68. Trust me, if you are a beginner, you will find bash to be the easiest shell
  69. to use. You may be able to get the bash shell by simply typing the word
  70. ôbashö at the prompt. If this doesnÆt work, ask tech support at your ISP for
  71. a shell account set up to use bash. A great book on using the bash shell is
  72. _Learning the Bash Shell_, by Cameron Newham and Bill Rosenblatt, published
  73. by OÆReilly.
  74.  
  75. If you want to find out what other shells you have the right to use, try
  76. ôcshö to get the C shell; ôkshö to get the Korn shell, ôshö for Bourne
  77. shell, ôtcshö for the Tcsh shell, and ôzshö for the Zsh shell. If you donÆt
  78. have one of them, when you give the command to get into that shell you will
  79. get back the answer ôcommand not found.ö
  80.  
  81. Now that you have chosen your shell, the next thing is to explore. See what
  82. riches your ISP has allowed you to use. For that you will want to learn, and
  83. I mean *really learn* your most important Unix commands and auxiliary
  84. programs. Because I am supreme arbiter of what goes into these Guides, I get
  85. to decide what the most important commands are. Hmm, ôtenö sounds like a
  86. famous number. So youÆre going to get the:
  87.  
  88. Ten Meinel Hall of Fame Shell Account Exploration Tools
  89.  
  90. 1) man <command name>  
  91. This magic command brings up the online Unix manual.  Use it on each of the
  92. commands below, today! Wonder what all the man command options are? Try the
  93. "man -k" option.
  94.  
  95. 2) ls  
  96. Lists files. Jericho suggests ôGet people in the habit of using "ls -alF".
  97. This will come into play down
  98. the road for security-conscious users.ö YouÆll see a huge list of files that
  99. you canÆt see with the ôlsö command alone, and lots of details. If you see
  100. such a long list of files that they scroll off the terminal screen, one way
  101. to solve the problem is to use ôls -alF|more.ö
  102.  
  103. 3) pwd  
  104. Shows what directory you are in.
  105.  
  106. 4) cd <directory>
  107. Changes directories.  Kewl directories to check out include /usr, /bin and
  108. /etc.  For laughs, jericho suggests exploring in /tmp. 
  109.  
  110. 5) more <filename>
  111. This shows the contents of text files. Also you might be able to find ôlessö
  112. and ôcatö which are similar commands.
  113.  
  114. 6) whereis <program name>
  115. Think there might be a nifty program hidden somewhere?  Maybe a game you
  116. love? This will find it for you. Similar commands are ôfindö and ôlocate.ö
  117. Try them all for extra fun.
  118.  
  119. 7) vi  
  120. An editing program. YouÆll need it to make your own files and when you start
  121. programming while in your shell account. You can use it to write a really
  122. lurid file for people to read when they finger you. Or try ôemacs.ö ItÆs
  123. another editing program and IMHO more fun than vi. Other editing programs
  124. you may find include ôedö (an ancient editing program which I have used to
  125. write thousands of lines of Fortran 77 code), ôex,ö ôfmt,ö ôgmacs,ö
  126. ôgnuemacs,ö and ôpico.ö
  127.  
  128. 8) grep
  129. Extracts information from files, especially useful for seeing whatÆs in
  130. syslog and shell log files. Similar commands are ôegrep,ö ôfgrep,ö and ôlook.ö
  131.  
  132. 9) chmod <filename>
  133. Change file permissions. 
  134.  
  135. 10) rm <filename>
  136. Delete file. If you have this command you should also find ôcpö for copy
  137. file, and ômvö for move file.
  138.  
  139.  
  140. How to Tell Whether Your Shell Account Is any Good for Hacking
  141.  
  142.  
  143. Alas, not all shell accounts are created equal.  Your ISP may have decided
  144. to cripple your budding hacker career by  forbidding your access to
  145. important tools. But you absolutely must have access to the top ten tools
  146. listed above. In addition, you will need tools to explore both your ISPÆs
  147. local area network (LAN) and the Internet. So in the spirit of being Supreme
  148. Arbiter of Haxor Kewl, here are my: 
  149.  
  150. Ten Meinel Hall of Fame LAN and Internet Exploration Tools
  151.  
  152. 1) telnet <hostname> <port number or name>
  153. If your shell account wonÆt let you telnet into any port you want either on
  154. its LAN or the Internet, you are totally crippled as a hacker. Dump your ISP
  155. now!
  156.  
  157. 2) who
  158. Shows you who else is currently logged in on your ISPÆs LAN. Other good
  159. commands to explore the other users on your LAN are ôw,ö ôrwho, ö ôusers.ö
  160.  
  161. 3) netstat
  162. All sorts of statistics on your LAN, including all Internet connections. For
  163. real fun, try ônetstat -rö to see the kernel routing table. However, jericho
  164. warns ôBe careful. I was teaching a friend the basics of summing up a Unix
  165. system and I told her to do that and æifconfigÆ. She was booted off the system
  166. the next day for æhacker suspicionÆ even though both are legitimate commands
  167. for users.ö
  168.  
  169. 4) whois <hostname>
  170. Get lots of information on Internet hosts outside you LAN.
  171.  
  172. 5) nslookup
  173. Get a whole bunch more information on other Internet hosts.
  174.  
  175. 6) dig
  176. Even more info on other Internet hosts. Nslookup and dig are not redundant.
  177. Try to get a shell account that lets you use both.
  178.  
  179. 7) finger
  180. Not only can you use finger inside your LAN. It will sometimes get you
  181. valuable information about users on other Internet hosts.
  182.  
  183. 8) ping
  184. Find out if a distant computer is alive and run diagnostic tests -- or just
  185. plain be a meanie and clobber people with pings. (I strongly advise
  186. *against* using ping to annoy or harm others.)
  187.  
  188. 9) traceroute 
  189. Kind of like ping with attitude. Maps Internet connections, reveals routers
  190. and boxes running firewalls.
  191.  
  192. 10) ftp
  193. Use it to upload and download files to and from other computers.
  194.  
  195. If you have all these tools, youÆre in great shape to begin your hacking
  196. career. Stay with your ISP. Treat it well.
  197.  
  198. Once you get your shell account, you will probably want to supplement the
  199. ômanö command with a good Unix book . Jericho recommends _Unix in a
  200. Nutshell_ published by O'Reilly. "It is the ultimate Unix command reference,
  201. and only costs 10 bucks. O'Reilly r00lz."
  202.  
  203. How to Keep from Losing Your Shell Account
  204.  
  205. So now you have a hackerÆs dream, an account on a powerful computer running
  206. Unix. How do you keep this dream account? If you are a hacker, that is not
  207. so easy. The problem is that you have no right to keep that account. You can
  208. be kicked off for suspicion of being a bad guy, or even if you become
  209. inconvenient, at the whim of the owners. 
  210.  
  211. Meinel Hall æO Infamy 
  212. Top Five Ways to Get Kicked out of Your Shell Account
  213.  
  214. 1) Abusing Your ISP
  215. LetÆs say you are reading Bugtraq and you see some code for a new way to
  216. break into a computer. Panting with excitement, you run emacs and paste in
  217. the code. You fix up the purposely crippled stuff someone put in to keep
  218. total idiots from running it. You tweak it until it runs under your flavor
  219. of Unix. You compile and run the program against your own ISP. It works! You
  220. are looking at that ô#ö prompt and jumping up and down yelling ôI got root!
  221. I got root!ö You have lost your hacker virginity, you brilliant dude, you!
  222. Only, next time you go to log in, your password doesnÆt work. You have been
  223. booted off your ISP. NEVER, NEVER ABUSE YOUR OWN ISP! 
  224.  
  225. *********************************************************
  226. You can go to jail warning: Of course, if you want to break into another
  227. computer, you must have the permission of the owner. Otherwise you are
  228. breaking the law.
  229. *********************************************************
  230.  
  231. 2) Ping Abuse.
  232. Another temptation is to use the powerful Internet connection of your shell
  233. account (usually a T1 or T3) to ping the crap out of the people you donÆt
  234. like. This is especially common on Internet Relay Chat. Thinking of ICBMing
  235. or nuking that dork? Resist the temptation to abuse ping or any other
  236. Internet Control Message Protocol attacks. Use ping only as a diagnostic
  237. tool, OK? Please? Or else!
  238.  
  239. 3) Excessive Port Surfing
  240. Port surfing is telnetting to a specific port on another computer. Usually
  241. you are OK if you just briefly visit another computer via telnet, and donÆt
  242. go any further than what that port offers to the casual visitor. But if you
  243. keep on probing and playing with another computer, the sysadmin at the
  244. target computer will probably email your sysadmin records of your little
  245. visits. (These records of port visits are stored in ômessages,ö and
  246. sometimes in ôsyslogö depending on the configuration of your target computer
  247. -- and assuming it is a Unix system.) 
  248.  
  249. Even if no one complains about you, some sysadmins habitually check the
  250. shell log files that keep a record of everything you or any other user on
  251. the system has been doing in their shells. If your sysadmin sees a pattern
  252. of excessive attention to one or a few computers, he or she may assume you
  253. are plotting a break-in. Boom, your password is dead.
  254.  
  255. 4) Running Suspicious Programs
  256. If you run a program whose primary use is as a tool to commit computer
  257. crime, you are likely to get kicked off your ISP. For example, many ISPs
  258. have a monitoring system that detects the use of the program SATAN.  Run
  259. SATAN from your shell account and you are history.
  260.  
  261.  
  262. **********************************************************
  263. Newbie note: SATAN stands for Security Administration Tool for Analyzing
  264. Networks. It basically works by telnetting to one port after another of the
  265. victim computer. It determines what program (daemon) is running on each
  266. port, and figures out whether that daemon has a vulnerability that can be
  267. used to break into that computer. SATAN can be used by a sysadmin to figure
  268. out how to make his or her computer safe. Or it may be just as easily used
  269. by a computer criminal to break into someone elseÆs computer.
  270. ***********************************************************
  271.  
  272.  
  273. 5) Storing Suspicious Programs
  274. ItÆs nice to think that the owners of your ISP mind their own business. But
  275. they donÆt. They snoop in the directories of their users. They laugh at your
  276. email. OK, maybe they are really high-minded and resist the temptation to
  277. snoop in your email. But chances are high that they will snoop in your shell
  278. log files that record every keystroke you make while in your shell account.
  279. If they donÆt like what they see, next they will be prowling your program files.
  280.  
  281. One solution to this problem is to give your evil hacker tools innocuous
  282. names. For example, you could rename SATAN to ANGEL. But your sysdamin may
  283. try running your programs to see what they do. If any of your programs turn
  284. out to be commonly used to commit computer crimes, you are history.
  285.  
  286. Wait, wait, you are saying. Why get a shell account if I can get kicked out
  287. even for legal, innocuous hacking? After all, SATAN is legal to use. In
  288. fact, you can learn lots of neat stuff with SATAN. Most hacker tools, even
  289. if they are primarily used to commit crimes, are also educational. Certainly
  290. if you want to become a sysadmin someday you will need to learn how these
  291. programs work.
  292.  
  293. Sigh, you may as well learn the truth. Shell accounts are kind of like
  294. hacker training wheels. They are OK for beginner stuff. But to become a
  295. serious hacker, you either need to find an ISP run by hackers who will
  296. accept you and let you do all sorts of suspicious things right under their
  297. nose. Yeah, sure. Or you can install some form of Unix on your home
  298. computer. But thatÆs another Guide to (mostly)  Harmless Hacking (Vol. 2
  299. Number 2: Linux!).
  300.  
  301. If you have Unix on your home computer and use a PPP connection to get into
  302. the Internet, your ISP is much less likely to snoop on you. Or try making
  303. friends with your sysadmin and explaining what you are doing. Who knows, you
  304. may end up working for your ISP!
  305.  
  306. In the meantime, you can use your shell account to practice just about
  307. anything Unixy that wonÆt make your sysadmin go ballistic.
  308.  
  309. *************************************************************
  310. Would you like a shell account that runs industrial strength Linux -- with
  311. no commands censored? Want to be able to look at the router tables, port
  312. surf all.net, and keep SATAN in your home directory without getting kicked
  313. out for suspicion of hacking? Do you want to be able to telnet in on ssh
  314. (secure shell)so no one can sniff your password? Are you willing to pay $30
  315. per month for unlimited access to this hacker playground? How about a seven
  316. day free trial account? Email haxorshell@techbroker.com for details.
  317. *************************************************************
  318.  
  319. In case you were wondering about all the input from jericho in this Guide,
  320. yes, he was quite helpful in reviewing this and making suggestions. Jericho
  321. is a security consultant and also runs his own Internet host,
  322. obscure.sekurity.org. Thank you, jericho@dimensional.com, and happy hacking!
  323.  
  324. _________________________________________________________
  325. Want to see back issues of Guide to (mostly) Harmless Hacking? See either
  326. http://www.cs.utexas.edu/users/matt/hh.html (the official Happy Hacker
  327. archive site)
  328. http://www.geocities.com/TimesSquare/Arcade/4594 
  329. http://www.silitoad.org
  330. http://base.kinetik.org
  331. http://www.anet-chi.com/~dsweir
  332. http://www.tacd.com/zines/gtmhh/ 
  333. http://ra.nilenet.com/~mjl/hacks/codez.htm
  334. http://www.ilf.net/brotherhood/index2.html
  335.  
  336. Subscribe to our discussion list by emailing to hacker@techbroker.com with
  337. message "subscribe"
  338. Want to share some kewl stuph with the Happy Hacker list? Correct mistakes?
  339. Send your messages to hacker@techbroker.com.  To send me confidential email
  340. (please, no discussions of illegal activities) use cmeinel@techbroker.com
  341. and be sure to state in your message that you want me to keep this
  342. confidential. If you wish your message posted anonymously, please say so!
  343. Direct flames to dev/null@techbroker.com. Happy hacking! 
  344. Copyright 1997 Carolyn P. Meinel. You may forward or post this GUIDE TO
  345. (mostly) HARMLESS HACKING on your Web site as long as you leave this notice
  346. at the end.
  347. ________________________________________________________
  348. Carolyn Meinel
  349. M/B Research -- The Technology Brokers
  350.  
  351.  
  352.