home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / general / gtmhh3_2.txt < prev    next >
Encoding:
Text File  |  2003-06-11  |  31.8 KB  |  670 lines

  1. _____________________________________________________________
  2.  
  3. GUIDE TO (mostly) HARMLESS HACKING
  4.  
  5. Vol. 3 Number 2
  6.  
  7. How to map the Internet. Dig! Whois! Nslookup! Traceroute! Netstat port is getting hard to use anymore, 
  8. however...
  9. ______________________________________________________________
  10.  
  11. Why map the Internet?
  12.  
  13. * Because it's fun -- like exploring unknown continents. The Internet is so huge, and it changes so fast, no 
  14. one has a complete map.
  15.  
  16. * Because when you can't make contact with someone in a distant place, you can help your ISP trouble 
  17. shoot broken links in the Internet. Yes, I did that once that when email failed to a friend in Northern 
  18. Ireland. How will your ISP know that their communications provider is lying down on the job unless 
  19. someone advises them of trouble?
  20.  
  21. * Because if you want to be a computer criminal, your map of the connections to your intended victim 
  22. gives you valuable information.
  23.  
  24. Now since this is a lesson on *legal* hacking, we're not going to help you out with how to determine the 
  25. best box in which to install a sniffer or how to tell what IP address to spoof to get past a packet filter. 
  26. We're just going to explore some of the best tools available for mapping the uncharted realms of the 
  27. Internet. 
  28.  
  29. For this lesson, you can get some benefit even if all you have is Windows. But to take full advantage of 
  30. this lesson, you should either have some sort of  Unix on your personal computer, or a shell account! 
  31. SHELL ACCOUNT! If you don't have one, you may find an ISP that will give you a shell account at 
  32. http://www.celestin.com/pocia/.
  33.  
  34. ****************************
  35. Newbie note: A shell account is an account with your ISP that allows you to give commands on a 
  36. computer running Unix. The "shell" is the program that translates your keystrokes into Unix commands. 
  37. Trust me, if you are a beginner, you will find bash (for Bourne again shell) to be easiest to use. Ask tech 
  38. support at your ISP for a shell account set up to use bash. Or, you may be able to get the bash shell by 
  39. simply typing the word "bash" at the prompt. If your ISP doesn't offer shell accounts, get a new ISP that 
  40. does offer it. A great book on using the bash shell is _Learning the Bash Shell_, by Cameron Newham 
  41. and Bill Rosenblatt, published by O'Reilly.
  42. ****************************
  43.  
  44. So for our mapping expedition, let's start by visiting the Internet in Botswana! Wow, is Botswana even on 
  45. the Internet? It's a lovely landlocked nation in the southern region of Africa, famous for cattle ranching, 
  46. diamonds and abundant wildlife. The language of commerce in Botswana is English, so there's a good 
  47. chance that we could understand messages from their computers.
  48.  
  49. Our first step in learning about Botswana's Internet hosts is to use the Unix program nslookup. 
  50.  
  51. ****************************
  52. Evil genius tip: Nslookup is one of the most powerful Internet mapping tools in existence. We can hardly 
  53. do it justice here. If you want to learn how to explore to the max, get the book _DNS and BIND_ by Paul 
  54. Albitz and Cricket Liu, published by O'Reilly, 1997 edition.
  55. ***************************
  56.  
  57. The first step may be to find where your ISP has hidden the program by using the command "whereis 
  58. nslookup." (Or your computer may use the "find" command.)  Aha -- there it is! I give the command:
  59.  
  60. ->/usr/etc/nslookup
  61. Default Server:  swcp.com
  62. Address:  198.59.115.2
  63. >
  64.  
  65. These two lines and the slightly different prompt (it isn't an arrow any more) tell me that my local ISP is 
  66. running this program for me. (It is possible to run nslookup on another computer from yours.) Now we are 
  67. in the program, so I have to remember that my bash commands don't work any more. Our next step is to 
  68. tell the program that we would like to know what computers handle any given domain name.
  69.  
  70. > set type=ns 
  71.  
  72. Next we need to know the domain name for Botswana. To do that I look up the list of top level domain 
  73. names on page 379 of the 1997 edition of  _DNS and BIND_. For Botswana it's bw. So I enter it at the 
  74. prompt, remembering -- this is VERY important -- to put a period after the domain name:
  75.  
  76. > bw. 
  77. Server:  swcp.com
  78. Address:  198.59.115.2
  79.  
  80. Non-authoritative answer:
  81.  
  82. This "non-authoritative answer" stuff tells me that this information has been stored for awhile, so it is 
  83. possible, but unlikely, that the information below has changed.
  84.  
  85. bw      nameserver = DAISY.EE.UND.AC.ZA
  86. bw      nameserver = RAIN.PSG.COM
  87. bw      nameserver = NS.UU.NET
  88. bw      nameserver = HIPPO.RU.AC.ZA
  89. Authoritative answers can be found from:
  90. DAISY.EE.UND.AC.ZA      inet address = 146.230.192.18
  91. RAIN.PSG.COM    inet address = 147.28.0.34
  92. NS.UU.NET       inet address = 137.39.1.3
  93. HIPPO.RU.AC.ZA  inet address = 146.231.128.1
  94.  
  95. I look up the domain name "za" and discover it stands for South Africa. This tells me that the Internet is 
  96. in its infancy in Botswana -- no nameservers there --  but must be well along in South Africa. Look at all 
  97. those nameservers! 
  98.  
  99. ***********************
  100. Newbie note: a nameserver is a computer program that stores data on the Domain Name System. The 
  101. Domain Name System makes sure that no two computers have the same name. It also stores information 
  102. on how to find other computers. When various nameservers get to talking with each other, they 
  103. eventually, usually within seconds, can figure out the routes to any one of the millions of computers on the 
  104. Internet.
  105. ***********************
  106.  
  107. Well, what this tells me is that people who want to set up Internet host computers in Botswana usually 
  108. rely on computers in South Africa to connect them. Let's learn more about South Africa. Since we are still 
  109. in the nslookup program, I command it to tell me what computers are nameservers for South Africa:
  110.  
  111. > za.
  112. Server:  swcp.com
  113. Address:  198.59.115.2
  114.  
  115. Non-authoritative answer:
  116. za      nameserver = DAISY.EE.UND.AC.za
  117. za      nameserver = UCTHPX.UCT.AC.za
  118. za      nameserver = HIPPO.RU.AC.za
  119. za      nameserver = RAIN.PSG.COM
  120. za      nameserver = MUNNARI.OZ.AU
  121. za      nameserver = NS.EU.NET
  122. za      nameserver = NS.UU.NET
  123. za      nameserver = UUCP-GW-1.PA.DEC.COM
  124. za      nameserver = APIES.FRD.AC.za
  125. Authoritative answers can be found from:
  126. DAISY.EE.UND.AC.za      inet address = 146.230.192.18
  127. UCTHPX.UCT.AC.za        inet address = 137.158.128.1
  128. HIPPO.RU.AC.za  inet address = 146.231.128.1
  129. RAIN.PSG.COM    inet address = 147.28.0.34
  130. MUNNARI.OZ.AU   inet address = 128.250.22.2
  131. MUNNARI.OZ.AU   inet address = 128.250.1.21
  132. NS.EU.NET       inet address = 192.16.202.11
  133. UUCP-GW-1.PA.DEC.COM    inet address = 204.123.2.18
  134. UUCP-GW-1.PA.DEC.COM    inet address = 16.1.0.18
  135. APIES.FRD.AC.za inet address = 137.214.80.1
  136.  
  137. ***********************
  138. Newbie note: What is inet address = 137.214.80.1 supposed to mean? That's the name of a computer on 
  139. the Internet (inet) -- in this case APIES.FRD.AC -- in octal. Octal is like regular numbers except in base 8 
  140. rather than base 10. All computer names on the Internet must be changed into numbers so that other 
  141. computers can understand them.
  142. **********************
  143.  
  144. Aha! Some of those nameservers are located outside South Africa. We see computers in Australia (au) and 
  145. the US (com domain). Next, we exit the nslookup program with the command ^D. That's made by 
  146. holding down the control key while hitting the small "d" key. It is VERY IMPORTANT to exit nslookup 
  147. this way and not with ^C.
  148.  
  149. Next, we take one of the nameservers in South Africa and ask:
  150.  
  151. ->whois HIPPO.RU.AC.ZA
  152. [No name] (HIPPO)
  153.  
  154.    Hostname: HIPPO.RU.AC.ZA
  155.    Address: 146.231.128.1
  156.    System: SUN running SUNOS
  157.  
  158.    Domain Server
  159.  
  160.    Record last updated on 24-Feb-92.
  161.  
  162.    To see this host record with registered users, repeat the command with
  163.    a star ('*') before the name; or, use '%' to show JUST the registered users.
  164.  
  165.    The InterNIC Registration Services Host contains ONLY Internet Information
  166.    (Networks, ASN's, Domains, and POC's).
  167.    Please use the whois server at nic.ddn.mil for MILNET Information.
  168.  
  169. Kewl! This tells us what kind of computer it is -- a Sun -- and the operating system, Sun OS.
  170.  
  171. Now, just for variety, I use the whois command with the numerical address of one of the nameservers. 
  172. This doesn't always give back the text name, but sometimes it works. And, voila, we get:
  173.  
  174. ->whois 146.230.192.18
  175. [No name] (DAISY1)
  176.  
  177.    Hostname: DAISY.EE.UND.AC.ZA
  178.    Address: 146.230.192.18
  179.    System: HP-9000 running HP-UX
  180.  
  181.    Domain Server
  182.  
  183.    Record last updated on 14-Sep-94.
  184.  
  185. Ah, but all this is doing so far is just telling us info about who is a nameserver for whom. Now how about 
  186. directly mapping a route from my computer to South Africa? For that we will use the traceroute 
  187. command.
  188.  
  189. ************************
  190. Netiquette tip: The traceroute program is intended for use in network testing, measurement  and  
  191. management. It  should be used primarily for manual fault isolation, like the time I couldn't email my 
  192. friend in Northern Ireland.  Because of the load it could impose on the network, it is unwise to use 
  193. traceroute from automated scripts which could cause that program to send out huge numbers of queries. 
  194. Use it too much and your ISP may start asking you some sharp questions.
  195. ************************
  196.  
  197. ************************
  198. YOU COULD GO TO JAIL WARNING: If you just got an idea of how to use traceroute for a denial of 
  199. service attack, don't call your favorite journalist and tell him or her that you are plotting a denial of 
  200. service attack against the ISPs that serve famous people like Bill Clinton and Carolyn Meinel!:-) Don't 
  201. write that script. Don't use it. If you do, I'll give another interview to PC World magazine 
  202. (http://www.pcworld.com/news/newsradio/meinel/index.html) about how a three-year-old could run the 
  203. attack. And if you get caught we'll all laugh at you as you get hustled off in chains while your journalist 
  204. friend gets a $250K advance on his or her book deal about you.
  205. ************************
  206.  
  207. I give the command:
  208.  
  209.  ->whereis traceroute
  210. traceroute: /usr/local/bin/traceroute
  211.  
  212. OK, now we're ready to map in earnest. I give the command:
  213.  
  214.  ->/usr/local/bin/traceroute DAISY.EE.UND.AC.ZA
  215.  
  216. And the answer is:
  217.  
  218. traceroute to DAISY.EE.UND.AC.ZA (146.230.192.18), 30 hops max, 40 byte packets
  219.  1  sisko (198.59.115.1)  3 ms  4 ms  4 ms
  220.  2  glory-cyberport.nm.westnet.net (204.134.78.33)  47 ms  8 ms  4 ms
  221.  3  ENSS365.NM.ORG (129.121.1.3)  5 ms  10 ms  7 ms
  222.  4  h4-0.cnss116.Albuquerque.t3.ans.net (192.103.74.45)  17 ms  41 ms  28 ms
  223.  5  f2.t112-0.Albuquerque.t3.ans.net (140.222.112.221)  7 ms  6 ms  5 ms
  224.  6  h14.t16-0.Los-Angeles.t3.ans.net (140.223.17.9)  31 ms  39 ms  84 ms
  225.  7  h14.t8-0.San-Francisco.t3.ans.net (140.223.9.13)  67 ms  43 ms  68 ms
  226.  8  enss220.t3.ans.net (140.223.9.22)  73 ms  58 ms  54 ms
  227.  9  sl-mae-w-F0/0.sprintlink.net (198.32.136.11)  97 ms  319 ms  110 ms
  228. 10  sl-stk-1-H11/0-T3.sprintlink.net (144.228.10.109)  313 ms  479 ms  473 ms
  229. 11  sl-stk-2-F/T.sprintlink.net (198.67.6.2)  179 ms * *
  230. 12  sl-dc-7-H4/0-T3.sprintlink.net (144.228.10.106)  164 ms *  176 ms
  231. 13  sl-dc-7-F/T.sprintlink.net (198.67.0.1)  143 ms  129 ms  134 ms
  232. 14  gsl-dc-3-Fddi0/0.gsl.net (204.59.144.197)  135 ms  152 ms  130 ms
  233. 15  204.59.225.66 (204.59.225.66)  583 ms  545 ms  565 ms
  234. 16  * * *
  235. 17  e0.csir00.uni.net.za (155.232.249.1)  516 ms  436 ms  400 ms
  236. 18  s1.und00.uni.net.za (155.232.70.1)  424 ms  485 ms  492 ms
  237. 19  e0.und01.uni.net.za (155.232.190.2)  509 ms  530 ms  459 ms
  238. 20  s0.und02.uni.net.za (155.232.82.2)  650 ms *  548 ms
  239. 21  Gw-Uninet1.CC.und.ac.za (146.230.196.1)  881 ms  517 ms  478 ms
  240. 22  cisco-unp.und.ac.za (146.230.128.8)  498 ms  545 ms *
  241. 23  IN.ee.und.ac.za (146.230.192.18)  573 ms  585 ms  493 ms
  242.  
  243. So what does all this stuff mean?
  244.  
  245. The number in front of each line is the number of hops since leaving the computer that has the shell 
  246. account I am using.
  247.  
  248. The second entry is the name of the computer through which this route passes, first in text, and then in 
  249. parentheses its numerical representation.
  250.  
  251. The numbers after that are the time in milliseconds it takes for each of three probe packets in a row to 
  252. make that hop. When an * appears, the time for the hop timed out. In the case of this traceroute 
  253. command, any time greater than 3 seconds causes an * to be printed out. 
  254.  
  255. How about hop 16? It gave us no info whatsoever. That silent gateway may be the result of a bug in the  
  256. 4.1, 4.2 or 4.3BSD Unix network code. A computer running one of these operating systems sends an 
  257. "unreachable" message.  Or it could be something else. Sorry, I'm not enough of a genius yet to figure out 
  258. this one for sure. Are we having phun yet?
  259.  
  260. ************************
  261. Evil genius tip: If you want to get really, truly excruciating detail on the traceroute command, while in 
  262. your shell account type in the command:
  263.  
  264. ->man traceroute
  265.  
  266. I promise, on-line manual stuff is often written in a witty, entertaining fashion. Especially the Sun OS 
  267. manual. Honest!
  268. ************************
  269.  
  270. ************************
  271. Note for the shell-account-challenged: If you have Windows 95, you can get the same results -- I mean, for 
  272. mapping the Internet, not going to jail -- using the "tracert" command. Here's how it works:
  273.  
  274. 1. Open a PPP connection. For example, if you use Compuserve or AOL, make a connection, then 
  275. minimize your on-line access program.
  276. 2. Click on the Start menu. 
  277. 3. Open a DOS window.
  278. 4. At the DOS prompt type in "tracert <distant.computer.com> where "distant.computer.com" is replaced 
  279. by the name of the computer to which you want to trace a route. Press the Enter key.
  280. 5. Be patient. Especially if your are tracing a route to a distant computer, it takes awhile to make all the 
  281. connections. Every time your computer connects to another computer on the Internet, it first has to trace a 
  282. route to the other computer. That's why it sometimes take a long while for your browser to start 
  283. downloading a Web page.
  284. 6. If you decide to use Windows for this hacking lesson, Damien Sorder has a message for us: "DON'T 
  285. ENCOURAGE THEM TO USE WIN95!@#$!@#!" He's right, but since most of you reading this are 
  286. consenting adults, I figure it's your funeral if you stoop to Windows hacking on an AOL PPP connection!
  287. ***********************
  288.  
  289. Now this is getting interesting. We know that Daisy is directly connected to at least one other computer, 
  290. and that computer in turn is connected to cisco-unp.und.ac.za. Let's learn a little something about this 
  291. cisco-unp.und.ac.za, OK? 
  292.  
  293. First, we can guess from the name that is it a Cisco router. In fact, the first hop in this route is to a 
  294. computer named "sisco," which is also probably a Cisco router. Since 85% of the routers in the world are 
  295. Ciscos, that's a pretty safe bet. But we are going to not only make sure cisco-unp.und.ac.za is a Cisco. We 
  296. are also going to find out the model number, and a few other goodies.
  297.  
  298. First we try out whois:
  299.  
  300. ->whois cisco-unp.und.ac.za
  301. No match for "CISCO-UNP.UND.AC.ZA".
  302.  
  303. The InterNIC Registration Services Host contains ONLY Internet Information
  304. (Networks, ASN's, Domains, and POC's).
  305. Please use the whois server at nic.ddn.mil for MILNET Information.
  306.  
  307. Huh? Traceroute tells us cisco-unp.und.ac.za exists, but whois can't find it! Actually this is a common 
  308. problem, especially trying to use whois on distant computers. What do we do next? Well, if you are lucky, 
  309. the whereis command will turn up another incredibly cool program: dig! 
  310.  
  311. **********************
  312. Newbie note: Dig stands for "domain information groper." It does a lot of the same things as nslookup. 
  313. But dig is a much older program, in many ways harder to use than nslookup. For details on dig, use the 
  314. command from your shell account "man dig."
  315. **********************
  316.  
  317. In fact, on my shell account I found I could run dig straight from my bash prompt:
  318.  
  319. ->dig CISCO-UNP.UND.AC.ZA
  320.  
  321. ; <<>> DiG 2.0 <<>> CISCO-UNP.UND.AC.ZA
  322. ;; res options: init recurs defnam dnsrch
  323. ;; got answer:
  324. ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6
  325. ;; flags: qr aa rd ra; Ques: 1, Ans: 4, Auth: 5, Addit: 5
  326. ;; QUESTIONS:
  327. ;;      CISCO-UNP.UND.AC.ZA, type = A, class = IN
  328.  
  329. ;; ANSWERS:
  330. CISCO-UNP.UND.AC.ZA.    86400   A       146.230.248.1
  331. CISCO-UNP.UND.AC.ZA.    86400   A       146.230.12.1
  332. CISCO-UNP.UND.AC.ZA.    86400   A       146.230.60.1
  333. CISCO-UNP.UND.AC.ZA.    86400   A       146.230.128.8
  334.  
  335. ;; AUTHORITY RECORDS:
  336. und.ac.za.      86400   NS      Eagle.und.ac.za.
  337. und.ac.za.      86400   NS      Shrike.und.ac.za.
  338. und.ac.za.      86400   NS      ucthpx.uct.ac.za.
  339. und.ac.za.      86400   NS      hiPPo.ru.ac.za.
  340. und.ac.za.      86400   NS      Rain.psg.com.
  341.  
  342. ;; ADDITIONAL RECORDS:
  343. Eagle.und.ac.za.        86400   A       146.230.128.15
  344. Shrike.und.ac.za.       86400   A       146.230.128.13
  345. ucthpx.uct.ac.za.       86400   A       137.158.128.1
  346. hiPPo.ru.ac.za. 86400   A       146.231.128.1
  347. Rain.psg.com.   14400   A       147.28.0.34
  348.  
  349. ;; Total query time: 516 msec
  350. ;; FROM: llama to SERVER: default -- 198.59.115.2
  351. ;; WHEN: Fri Jan 17 13:03:49 1997
  352. ;; MSG SIZE  sent: 37  rcvd: 305
  353.  
  354. Ahhh, nice. The first few lines, the ones preceded by the ;; marks, mostly tell what the default settings of 
  355. the command are and what we asked it. The line "Ques: 1, Ans: 4, Auth: 5, Addit: 5" tells us how many 
  356. items we'll get under each topic of questions, answers, authority records, and additional records.  (You 
  357. will get different numbers on that line with different queries.) This "records" stuff refers to information 
  358. stored under the domain name system.
  359.  
  360. We learn from dig is that CLASS=IN, meaning CISCO-UNP.UND.AC.ZA is a domain name within the 
  361. Internet. But we already knew that . The first really *new* thing we learn is that four routers all share the 
  362. same domain name. We can tell that because their numerical Internet numbers are different. The reverse 
  363. can also happen: several domain names can all belong to the same numerical address. If you use the dig 
  364. command on each link in the route to DAISY.EE.UND.AC.ZA, you'll find a tremendous variation in 
  365. whether the routers map to same or different domain names. As hackers, we want to get wise to all these 
  366. variations in how domain names are associated with boxes.
  367.  
  368. But we can still learn even more about that Cisco router named CISCO-UNP.UND.AC.ZA. We go back to 
  369. nslookup and run it in interactive mode:
  370.  
  371. ->/usr/etc/nslookup
  372. Default Server:  swcp.com
  373. Address:  198.59.115.2
  374. >
  375.  
  376. Now let's do something new with nslookup. This is a command that comes in really, really handy when 
  377. we're playing vigilante and need to persecute a spammer or bust a child porn Web site or two.  Here's 
  378. how we can get the email address for the sysadmin of an Internet host computer.
  379.  
  380. > set type=soa
  381.  
  382. Then I enter the name of the computer about which I am curious. Note that I put a period after the end of 
  383. the host name. It often helps to do this with nslookup:
  384.  
  385. > CISCO-UNP.UND.AC.ZA.
  386. Server:  swcp.com
  387. Address:  198.59.115.2
  388.  
  389. *** No start of authority zone information is available for CISCO-UNP.UND.AC.ZA.
  390.  
  391. Now what do I do? Give up? No, I'm a hacker wannabe, right? So I try entering just part of the domain 
  392. name, again remembering to put a period at the end:
  393.  
  394. > und.ac.za.
  395. Server:  swcp.com
  396. Address:  198.59.115.2
  397. und.ac.za       origin = Eagle.und.ac.za
  398.         mail addr = postmaster.und.ac.za
  399.         serial=199610255, refresh=10800, retry=3600, expire=3000000, min=86400
  400. Eagle.und.ac.za inet address = 146.230.128.15
  401. Shrike.und.ac.za        inet address = 146.230.128.13
  402. ucthpx.uct.ac.za        inet address = 137.158.128.1
  403. hiPPo.ru.ac.za  inet address = 146.231.128.1
  404. Rain.psg.com    inet address = 147.28.0.34
  405.  
  406. Bingo!!! I got the email address of a sysadmin whose domain includes that Cisco router, AND the IP 
  407. addresses of some other boxes he or she administers.  But notice it doesn't list any of those routers which 
  408. the sysadmin undoubtedly knows a thing or two about.
  409.  
  410. But we aren't done yet with cisco-unp.und.ac.za (146.230.128.8). Of course we have a pretty good guess 
  411. that it is a Cisco router. But why stop with a mere guess when we can port surf? So we fall back on our 
  412. friend the telnet program and head for port 2001:
  413.  
  414. ->telnet 146.230.128.8 2001
  415. Trying 146.230.128.8 ...
  416. Connected to 146.230.128.8.
  417. Escape character is '^]'.
  418. C
  419. ****************************************************
  420. ***  Welcome to the University of Natal                               ***
  421. ***                                                                   ***
  422. *** Model : Cisco 4500 with ATM and 8 BRI ports              ***
  423. ***                                                                   ***
  424. *** Dimension Data Durban - 031-838333                           ***
  425. ***                                                                   ***
  426. ***************************************************
  427.  
  428. Hey, we know now that  this is a Cisco model 4500 owned by the University of Natal, and we even got a 
  429. phone number for the sysadmin. From this we also can infer that this router handles a subnet which serves 
  430. the U of Natal and includes daisy.
  431.  
  432. But why did I telnet to port 2001? It's in common use among routers as the administrative port. How do I 
  433. know that? From the RFC (request for comments) that covers all commonly used port assignments. You 
  434. can find a copy of this RFC at http://ds2.internic.net/rfc/rfc1700.txt. Read it and you'll be in for some 
  435. happy port surfing!
  436.  
  437. ************************
  438. Evil Genius tip: there are a bunch of ports used by Cisco routers:
  439. cisco-fna       130/tcp    cisco FNATIVE
  440. cisco-tna       131/tcp    cisco TNATIVE
  441. cisco-sys       132/tcp    cisco SYSMAINT
  442. licensedaemon   1986/tcp   cisco license management
  443. tr-rsrb-p1      1987/tcp   cisco RSRB Priority 1 port
  444. tr-rsrb-p2      1988/tcp   cisco RSRB Priority 2 port
  445. tr-rsrb-p3      1989/tcp   cisco RSRB Priority 3 port
  446. stun-p1         1990/tcp   cisco STUN Priority 1 port
  447. stun-p2         1991/tcp   cisco STUN Priority 2 port
  448. stun-p3         1992/tcp   cisco STUN Priority 3 port
  449. snmp-tcp-port   1993/tcp   cisco SNMP TCP port
  450. stun-port       1994/tcp   cisco serial tunnel port
  451. perf-port       1995/tcp   cisco perf port
  452. tr-rsrb-port    1996/tcp   cisco Remote SRB port
  453. gdp-port        1997/tcp   cisco Gateway Discovery Protocol
  454. x25-svc-port    1998/tcp   cisco X.25 service (XOT)
  455. tcp-id-port     1999/tcp   cisco identification port
  456. ************************
  457.  
  458. But what about the "normal" telnet port, which is 23? Since it is the "normal" port, the one you usually go 
  459. to when you want to log in, we don't need to put the 23 after the host name:
  460.  
  461. ->telnet 146.230.128.8
  462. Trying 146.230.128.8 ...
  463. Connected to 146.230.128.8.
  464. Escape character is '^]'.
  465. C
  466. *************************************************************************
  467. ***  Welcome to the University of Natal                               ***
  468. ***                                                                   ***
  469. *** Model : Cisco 4500 with ATM and 8 BRI ports                       ***
  470. ***                                                                   ***
  471. *** Dimension Data Durban - 031-838333                                ***
  472. ***                                                                   ***
  473. *************************************************************************
  474.  
  475. User Access Verification
  476.  
  477. Password:
  478.  
  479. Hey, this is interesting, no username requested, just a password. If I were the sysadmin, I'd make it a little 
  480. harder to log in. Hmmm, what happens if I try to port surf finger that site? That means telnet to the finger 
  481. port, which is 79:
  482.  
  483. ->telnet 146.230.128.8 79
  484. Trying 146.230.128.8 ...
  485. Connected to 146.230.128.8.
  486. Escape character is '^]'.
  487. C
  488. *************************************************************************
  489. ***  Welcome to the University of Natal                               ***
  490. ***                                                                   ***
  491. *** Model : Cisco 4500 with ATM and 8 BRI ports                       ***
  492. ***                                                                   ***
  493. *** Dimension Data Durban - 031-838333                                ***
  494. ***                                                                   ***
  495. *************************************************************************
  496.     Line     User      Host(s)               Idle Location
  497. *  2 vty 0             idle                     0 kitsune.swcp.com
  498.   BR0:2                Sync PPP             00:00:00
  499.   BR0:1                Sync PPP             00:00:00
  500.   BR1:2                Sync PPP             00:00:00
  501.   BR1:1                Sync PPP             00:00:00
  502.   BR2:2                Sync PPP             00:00:01
  503.   BR2:1                Sync PPP             00:00:00
  504.   BR5:1                Sync PPP             00:00:00
  505. Connection closed by foreign host.
  506.  
  507. Notice that finger lists the connection to the computer I was port surfing from: kitsune. But no one else 
  508. seems to be on line just now. Please remember, when you port surf, unless you know how to do IP 
  509. spoofing, your target computer knows where you came from. Of course I will be a polite guest.
  510.  
  511. Now let's try the obvious. Let's telnet to the login port of daisy. I use the numerical address just for the 
  512. heck of it:
  513.  
  514. ->telnet 146.230.192.18
  515. Trying 146.230.192.18 ...
  516. Connected to 146.230.192.18.
  517. Escape character is '^]'.
  518.  
  519. NetBSD/i386 (daisy.ee.und.ac.za) (ttyp0)
  520.  
  521. login:
  522.  
  523. Hey, this is interesting. Since we now know this is a university, that's probably the electrical engineering 
  524. (EE) department. And NetBSD is a freeware Unix that runs on a PC! Probably a 80386 box. 
  525.  
  526. Getting this info makes me almost feel like I've been hanging out at the University of Natal EE computer 
  527. lab. It sounds like a friendly place. Judging from their router, security is somewhat lax, they use cheap 
  528. computers, and messages are friendly. Let's finger and see who's logged in just now:
  529.  
  530. Since I am already in the telnet program (I can tell by the prompt "telnet>"), I go to daisy using the 
  531. "open" command:
  532.  
  533. telnet> open daisy.ee.und.ac.za 79
  534. Trying 146.230.192.18 ...
  535. telnet: connect: Connection refused
  536. telnet> quit
  537.  
  538. Well, that didn't work, so I exit telnet and try the finger program on my shell account computer:
  539.  
  540. ->finger @daisy.ee.und.ac.za
  541. [daisy.ee.und.ac.za]
  542. finger: daisy.ee.und.ac.za: Connection refused
  543.  
  544. Sigh. It's hard to find open finger ports any more. But it's a good security practice to close finger. Damien 
  545. Sorder points out, "If you install the new Linux distributions, it comes with Cfingerd. Why would I (and 
  546. others) want to shut it down? Not because of hackers and abuse or some STUPID S*** like that. Because 
  547. it gives out way too much information when you finger a single user. You get machine load and all the 
  548. user information."
  549.  
  550. I manage to pull up a little more info on how to map the interconnections of  University of Natal 
  551. computers with an search of the Web using http://digital.altavista.com. It links me to the site 
  552. http://www.frd.ac.za/uninet/sprint.html, which is titled "Traffic on the UNINET-SPRINTLINK Link." 
  553. However, all the links to netwrok traffic statistics from that site are dead.
  554.  
  555. Next, let's look into number 20 on that traceroute that led us to the University of Natal. You can pretty 
  556. much expect that links in the middle of a long traceroute will be big computers owned by the bigger 
  557. companies that form the backbone of the Internet.
  558.  
  559. ->telnet 155.232.82.2 2001
  560. Trying 155.232.82.2 ...
  561. Connected to 155.232.82.2.
  562. Escape character is '^]'.
  563.  
  564.                               Id: und02
  565.                         Authorised Users Only!
  566.                        ------------------------
  567.  
  568.  
  569. User Access Verification
  570.  
  571. Username:
  572.  
  573. Yup, we're out of friendly territory now. And since port 2001 works, it may be a router. Just for laughs, 
  574. though, let's go back to the default telnet port:
  575.  
  576. ->telnet 155.232.82.2
  577. Trying 155.232.82.2 ...
  578. Connected to 155.232.82.2.
  579. Escape character is '^]'.
  580.  
  581.                               Id: und02
  582.                         Authorised Users Only!
  583.                        ------------------------
  584.  
  585.  
  586. User Access Verification
  587.  
  588. Username:
  589.  
  590. Now just maybe this backbone-type computer will tell us gobs of stuff about all the computers it is 
  591. connected to.  We try telneting to the netstat port, 15. This, if it happens to be open to the public, will tell 
  592. us all about the computers that connect through it:
  593.  
  594. ->telnet 155.232.82.2 15
  595. Trying 155.232.82.2 ...
  596. telnet: connect: Connection refused
  597.  
  598. Sigh. I gave an example of the incredible wealth of information you can get from netstat on the GTMHH 
  599. on port surfing. But every day it is harder to find a public netstat port. That's because the information 
  600. netstat gives is so useful to computer criminals. In fact, port 15 is no longer reserved as the netstat port (as 
  601. of 1994, according to the RFC). So you will find few boxes using it. 
  602.  
  603. ******************************
  604. Newbie note: want to know what port assignments your ISP uses? Sorder points out " /etc/services on most 
  605. machines will [tell you this]."
  606.  
  607. How can you can read that information? Try this:
  608.  
  609. First, change to the /etc/ directory:
  610.  
  611. ->cd /etc
  612.  
  613. Then command it to print it out to your screen with:
  614.  
  615.  ->more services
  616. #
  617. # @(#)services 1.16 90/01/03 SMI
  618. #
  619. # Network services, Internet style
  620. # This file is never consulted when the NIS are running
  621. #
  622. tcpmux          1/tcp                           # rfc-1078
  623. echo            7/tcp
  624.  
  625. ... and so on...
  626.  
  627. Alas, just because your shell account has a list of port assignments doesn't mean they are actually in use. 
  628. It also probably won't list specialized services like all those Cisco router port assignments.
  629. *************************
  630.  
  631. In fact, after surfing about two dozen somewhat randomly chosen netstat ports, the only answer I get other 
  632. than "Connection refused" is:
  633.  
  634. ->telnet ns.nmia.com 15
  635. Trying 198.59.166.10 ...
  636. Connected to ns.nmia.com.
  637. Escape character is '^]'.
  638. Yes, but will I see the EASTER BUNNY in skintight leather
  639.  at an IRON MAIDEN concert?
  640.  
  641. Now what about all those Sprintlink routers in that traceroute? That's a major Internet backbone based in 
  642. the US provided by Sprint. You can get some information on the topology of the Sprintlink backbone at 
  643. http://www.sprintlink.net/SPLK/HB21.html#2.2. Alas, Sprintlink used to give out much more information 
  644. than they do today. All I can pick up on their Web site today is pretty vague. 
  645.  
  646. Sigh. The Internet is getting less friendly, but more secure. Some day when we're really ancient, say five 
  647. years from now, we'll be telling people, "Why, I remember when we could port surf! Why, there used to 
  648. be zillions of open ports and people could choose ANY password they wanted. Hmph! Today it's just 
  649. firewalls everywhere you look!" Adds Sorder, "Gee. How do you think people like me feel.. port surfing 
  650. over 6 years ago."
  651.  
  652. Our thanks to Damien Sorder (jericho@dimensional.com) for assistance in reviewing and contributing to 
  653. this GTMHH.
  654. _________________________________________________________
  655. Want to see back issues of Guide to (mostly) Harmless Hacking? See either 
  656. http://www.tacd.com/zines/gtmhh/ or 
  657. http://ra.nilenet.com/~mjl/hacks/codez.htm or
  658. http://www3.ns.sympatico.ca/loukas.halo8/HappyHacker/
  659. Subscribe to our email list by emailing to hacker@techbroker.com with message "subscribe" or join our 
  660. Hacker forum at http://www.infowar.com/cgi-shl/login.exe.
  661. Want to share some kewl stuph with the Happy Hacker list? Correct mistakes? Send your messages to 
  662. hacker@techbroker.com.  To send me confidential email (please, no discussions of illegal activities) use 
  663. cmeinel@techbroker.com and be sure to state in your message that you want me to keep this confidential. 
  664. If you wish your message posted anonymously, please say so! Please direct flames to 
  665. dev/null@techbroker.com. Happy hacking! 
  666. Copyright 1997 Carolyn P. Meinel. You may forward  or post on your Web site this GUIDE TO (mostly) 
  667. HARMLESS HACKING as long as you leave this notice at the end..
  668. ________________________________________________________
  669.  
  670.