home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Mammon_ / project5.txt < prev    next >
Text File  |  2000-05-25  |  13KB  |  397 lines

  1.  
  2.  
  3. More Work On Project5
  4.  
  5. by Mammon_
  6.  
  7.  
  8.  
  9.  
  10.  
  11. Target File: Netscape.exe version 3.01 Gold, 3.02 MB (42.4 MB Decompiled)<P>
  12.  
  13.  
  14.  
  15.  
  16.  
  17. It is now, as I write, 1997. The internet has become a combination library, 
  18. software warehouse, and television: more than ever before, a cracker's Web 
  19. Browser is as vital as his debugger, his disassembler, even his hex editor. 
  20. It is necessary, then, to trim these browsers so they do not hinder our 
  21. progress, and to tailor them to a style that suits us. ACP and  YOSHi have 
  22. both done well with Netscape Navigator's windowing annoyances; I will here 
  23. demonstrate how to customize the application's user interface.<P>
  24.  
  25.  
  26.  
  27.  
  28.  
  29. <B>1. The Location Bar</B><P>
  30.  
  31. The best way to start out is with a string data search, as our targets are 
  32. going to be menus and buttons. As I was planning to do some extra work in the 
  33. .exe, I opened up Netscape in W32Dasm and got coffee while it was disassembling. 
  34. I exported the String Data Reference list into WordPad (Notepad being, alas, 
  35. not up to the task) and did a quick search for "http://", finding the string 
  36. values relating to the items we will be changing along (e.g., "http://guide.
  37. netscape.com/guide/what'snew.html"). For the record, I found a number of strings 
  38. using BRW that were not in the W32Dasm disassembly.<P>
  39.  
  40.  
  41.  
  42. Here is where it gets interesting: I was scrolling through the string data 
  43. listing, waiting for my eyes to glaze over, when I cam across a command I knew--
  44. "about:global", which when typed in the location bar causes the Netscape.hst 
  45. file to be dumped onscreen. The first thought that flashed through my mind was 
  46. "Undocumented commands!", and after many minutes of sifting through meaningless 
  47. strings I came up with the following list of location-bar commands:<P>
  48.  
  49.  
  50.  
  51. about:xxxx     xxxx text appears on blank page (1.43K limit)
  52.  
  53. about:         Displays the Netscape "About Box"
  54.  
  55. about:blank     Displays a blank page
  56.  
  57. about:cache     Dumps the contents of the URL cache
  58.  
  59. about:document     The same as View->Document Info
  60.  
  61. about:editfilenew Opens a blank document called file:///Untitiled
  62.  
  63. about:global     Shows the URL history from the Netscape.hst file
  64.  
  65. about:image-cache Dumps the contents of the image cache
  66.  
  67. about:license     Displays the Netscape product license (snore)
  68.  
  69. about:memory-cache Displays the contents of the memory cache
  70.  
  71. about:plugins    Displays stats on all of the plug-ins
  72.  
  73. File:///        Opens a file in the browser; .,.., drive letters are all valid
  74.  
  75. Javascript:     Opens a Javascript console (OK, we knew this one...)
  76.  
  77. Mailto:        Opens the send-mail dialogue box (OK, we knew this one too)
  78.  
  79. view-source:    Same as View->Document Source<P>
  80.  
  81.  
  82.  
  83. It gets even better. First of all, remember that these go in the location bar, 
  84. and therefore one can place them in the href= parameter of an <a> tag--instantly, 
  85. lots of new web-page tricks. I experimented a bit with the about: command and 
  86. quickly learned that anything you type after "about:" will show up on a blank 
  87. document. I typed "about:When in danger or in doubt, run in circles, scream and 
  88. shout." There it was, in black, on a black page.<P>
  89.  
  90. So I experimented some more, typing "about:<center>When in <font color="ff0000">danger</font> or in doubt,<P> Run in circles, scream and shout.</center>", and sure enough it appeared in its full HTML-formatted glory. As good as document.writeln() without javascript!<P>
  91.  
  92. Of course the next thing I tried was dumping the entire source code of my tools 
  93. page (after changing the double quotes to singles, and vice versa) into the 
  94. href= parameter of an <a> tag that read, originally enough, TEST. I clicked it, 
  95. a new page loaded with maybe a tenth of my tools page displayed (due, of course,
  96. to the limitation of a Windows edit control...effectively, the location bar can 
  97. take up to a 1.43K text file, as I found by testing).<P>
  98.  
  99. Now what are we left with? An undocumented "document.writeln()"-ish feature that
  100. allows you to enter up to 1400 characters of HTML code (sans <HTML> and <BODY> 
  101. tags) directly from an <a> tag! And who says Netscape has no surprises.....<P>
  102.  
  103.  
  104.  
  105.  
  106.  
  107. <B>2. The Buttons</B><P>
  108.  
  109. The first thing to change is going to be the buttons--you know the ones, those 
  110. useless "Directory Buttons" that you always turn off because have horrible titles 
  111. like "What's New", "What's Cool", and "People". If you look in BRW you will find 
  112. the labels for thse buttons and the URLs that match them in strings 621-635. 
  113. Needless to say, you can edit the strings to reflect your six most-visited web 
  114. pages. I chose to remap them as follows:<P>
  115.  
  116.  
  117.  
  118. <LI>621 (What's New): from ...whats-new.html to http://207.30.50.126/fravia/academy.htm (New Title:  HCU)
  119.  
  120. <LI>622 (What's Cool): from ...whats-cool.html to http://kryten.eng.monash.edu.au/gspamt.html (New Title: Net
  121.  
  122. Tools) 
  123.  
  124. <LI>623 (Destinations): from ...index.html to http://www.hotmail.com (New Title: HotMail) 
  125.  
  126. <LI>624 (Net Search): from ...search.html to http://cuiwww.unige.ch/eao/www/Internet/Nedashkovsky.html (New
  127.  
  128. Title: Search Engines) 
  129.  
  130. <LI>625 (People): from ...white-pages.html to http://www.anonymizer.com/open.html (New Title: Anonymizer) 
  131.  
  132. <LI>626 (Software): from ...upgrades.html to about:<applet  codebase="file:///F|/Jdk/" code="AppletKiller.class" width=100 height=100>Applet Killer</applet> (New Title:
  133.  
  134. Applet Killer)<P>
  135.  
  136.  
  137.  
  138. Notice this last one: an application of the above principle, basically a one-
  139. line web page that calls the compiled AppletKiller.class (watch it, this thing 
  140. makes your system very unstable) from the hard-drive. The rest of them are pretty 
  141. standard, your typical useful web pages...<P>
  142.  
  143.  
  144.  
  145. <B>3. The Menus</B><P>
  146.  
  147. But we are not done yet; there are still a couple of useless menus lurking 
  148. around here ("Directories" once again and also "Help", both of which use URLs 
  149. to define their actions)...you'll find their strings between 65000-65399, though 
  150. I would suggest editting only the URLs and changing the menus directly by editting 
  151. the Menu2 resource.
  152.  
  153. The menus originally look as follows:<P>
  154.  
  155. Directory:
  156.  
  157. <LI>"Netscape's Home" <I>http://homenetscape.com</i>
  158.  
  159. <LI>"What's New" <I>http://guide.netscape.com/guide/what'snew.html</i>
  160.  
  161. <LI>"Whats Cool" <I>http://guide.netscape.com/guide/what'scool.html</i>
  162.  
  163. <LI><SEPARATOR>
  164.  
  165. <LI>"Customer Showcase" <I>http://home.netscape.com/home/netscape-galleria.html</i>
  166.  
  167. <LI>"Netscape Destinations" <I>http://netscape.yahoo.com/guide</i>
  168.  
  169. <LI>"Internet Search" <I>http://home.netscape.com/escapes/search/ntsrchrnd-2.html</i>
  170.  
  171. <LI>"People" <I>http://guide.netscape.com/guide/people.html</i>
  172.  
  173. <LI>"About the Internet" <I>http://home.netscape.com/home/about-the-internet.html</i>
  174.  
  175.  
  176.  
  177. Help: 
  178.  
  179. <LI>"About Netscape" <I>about:</i>   ;Note the use of the about: tag!
  180.  
  181. <LI>"About plugins" <I>about:plugins</i>
  182.  
  183. <LI>"Registration" Information <I>http://home.netscape.com/netcenter/prodreg/start.html</i>
  184.  
  185. <LI>"Software" <I>http://home.netscape.com/comprod/upgrades/index.html</i>
  186.  
  187. <LI>"Web Page Starter" <I>http://home.netscape.com/home/starter.html</i>
  188.  
  189. <LI><SEPARATOR>
  190.  
  191. <LI>"Handbook" <I>http://home.netscape.com/eng/mozilla/3.0/handbook</i>
  192.  
  193. <LI>"Release Notes" <I>http://home.netscape.com/eng/mozilla/3.0/relnotes/windows-3.0Gold.html</i>
  194.  
  195. <LI>"Frequently Asked Questions" <I>http://help.netscape.com/faqs.html</i>
  196.  
  197. <LI>"On Security" <I>http://home.netscape.com/info/security-doc.html</i>
  198.  
  199. <LI><SEPARATOR>
  200.  
  201. <LI>"How to Give Feedback" <I>http://cgi.netscape.com/cgi-bin/autobug.cgi</i>
  202.  
  203. <LI>"How to Get Support" <I>http://help.netscape.com</i>
  204.  
  205. <LI>"How to Create Web Services" <I>http://http://home.netscape.com/home/how-to-create-web-services.html</i><P>
  206.  
  207.  
  208.  
  209. These will never do. I opted to keep the layour of the separators, though by all 
  210. means I could have added or removed a few, and went with the following layout:<P>
  211.  
  212.  
  213.  
  214. Cracking:
  215.  
  216. <LI>Mammon_ (Home) <I>I'll avoid the obvious free plug...</I>
  217.  
  218. <LI>Mammon_ (Links)
  219.  
  220. <LI>Mammon_ (Tools) 
  221.  
  222. <LI><SEPARATOR>
  223.  
  224. <LI>Fravia <I>http://207.30.50.126/fravia/</I>
  225.  
  226. <LI>Greythorne <I>http://www.cracking.net/gthorne/ </I>
  227.  
  228. <LI>Hacker's Layer <I>http://www.lordsomer.com/ </I>
  229.  
  230. <LI>L0pht <I>http://www3.l0pht.com/ </I>
  231.  
  232. <LI>Silicon Toad <I>http://www.silitoad.org/ </I><P>
  233.  
  234.  
  235.  
  236. Resources:
  237.  
  238. <LI>AngelFire <I>http://www.angelfire.com </I>
  239.  
  240. <LI>FortuneCity <I>http://www.fortunecity.com </I>
  241.  
  242. <LI>Geocities <I>http://www.geocities.com </I>
  243.  
  244. <LI>Send Fax <I>http://www-usa.tpc.int/sendfax.html </I>
  245.  
  246. <LI>Supernews <I>http://supernews.com </I>
  247.  
  248. <LI><SEPARATOR>
  249.  
  250. <LI>FTP Search <I>http://ftpsearch.ntnu.no/ftpsearch/ </I>
  251.  
  252. <LI>SwiftSearch <I>file:///C|/Tools/SwiftSearch/SwiftSearch.exe</I>
  253.  
  254. <LI>NetInfo <I>file:///C|/Tools/NetInfo.exe </I>
  255.  
  256. <LI>JPadPro <I>file:///F|/Jdk/JPadPro/JPadPro.exe </I>
  257.  
  258.  
  259.  
  260. <LI><SEPARATOR>
  261.  
  262. <LI>Webside Story <I>http://www.hitbox.com/wc/MAKElists/Top100HackingPhreaking.html</I>
  263.  
  264. <LI>HTML Reference <I>http://sdcc8.ucsd.edu/~m1wilson/htmlref.html </I>
  265.  
  266. <LI>Javascript Reference <I> http://home.netscape.com/eng/mozilla/3.0/handbook/javascript/index.html </I><P>
  267.  
  268.  
  269.  
  270. Ah, much better. Once again, theory into practice by using the file:/// tags to 
  271. access files on my hard drive. To get this to work right, you have to set the 
  272. Netscape action for ".exe" to "Launch this application:" with the application 
  273. field left blank. This will give you a SaveAs... box when you click on one of 
  274. the "file:///" menu items (i.e., NetInfo); if you press OK, the .exe will save, 
  275. and if you press CANCEL, the .exe will run (we could disable the box, but then 
  276. you could never save .exe's that you downloaded...).<P>
  277.  
  278. To top it all off, I shuffled around the main items in Menu2 so that my menu bar 
  279. now reads File...Edit...View...Go...Cracking...Resources...Bookmarks...Options...Window:
  280. perfecto! Now to change the title bar to Crackscape....<P>
  281.  
  282.  
  283.  
  284. <B>4. Notes about the Registry</B><P>
  285.  
  286. The obvious place to look for the URLs linked to each button and menu item would 
  287. have been the Registry, and this was in fact the first place I checked. As shown 
  288. above, however, the string values are hard-coded in the executable itself. 
  289. Netscape does keep a number of interesting values in the Registry, all of them 
  290. in HKey_Current_User\Software\Netscape\Navigator (the HKey_Local_Machine\SOFTWARE 
  291. key simply stores the version number of the program), which has the following 
  292. subkeys:
  293.  
  294. <LI>Address Book (where it is located)
  295.  
  296. <LI>Automation Protocols
  297.  
  298. <LI>Automation Shutdown
  299.  
  300. <LI>Automation Startup
  301.  
  302. <LI>Automation Viewers
  303.  
  304. <LI>Bookmark List (where it is stored)
  305.  
  306. <LI>Bookmark Window (schematics)
  307.  
  308. <LI>Cache (where it is stored)
  309.  
  310. <LI>Compose Window (schematics)
  311.  
  312. <LI>Cookies (where they are stored)
  313.  
  314. <LI>Default Plugin (name)
  315.  
  316. <LI>Editor (preferences)
  317.  
  318. <LI>History (URLs that drop down from Location Bar)
  319.  
  320. <LI>Images (settings)
  321.  
  322. <LI>INTL (settings)
  323.  
  324. <LI>Java (on or off)
  325.  
  326. <LI>Mail (settings/account info)
  327.  
  328. <LI>Mail Window (schematics)
  329.  
  330. <LI>Main (preferences)
  331.  
  332. <LI>Main Window (schematics)
  333.  
  334. <LI>Network (preferences)
  335.  
  336. <LI>News (preferences)
  337.  
  338. <LI>News Window (schematics)
  339.  
  340. <LI>Page Setup (schematics)
  341.  
  342. <LI>Proxy Information (proxy servers/IPs)
  343.  
  344. <LI>Publish (settings/account info)
  345.  
  346. <LI>Security (settings)
  347.  
  348. <LI>Services (servers for POP3, etc)
  349.  
  350. <LI>Settings (preferences)
  351.  
  352. <LI>Suffixes (file extensions)
  353.  
  354. <LI>Temporary File URL Resolution (file location)
  355.  
  356. <LI>Tool Bar (settings)
  357.  
  358. <LI>User (identity from Mail/News prefs)
  359.  
  360. <LI>User Trusted External Applications (file loactions)
  361.  
  362. <LI>Viewers (file locations)<P>
  363.  
  364.  
  365.  
  366. It is generally a good idea to locate things like URL history and Cache in a 
  367. temp directory that gets deleted at bootup; these files will all re-create 
  368. themselves. Cookies.txt, however, cannot be replaced with a nonexistent file; 
  369. the last time I tried that I went to microsoft.com to test it and my computer 
  370. GPF'd so hard that soft-ice only showed a column of "FFFFFF: INVALID" opcodes 
  371. when I tried to pull out of it....<P>
  372.  
  373. <BR>
  374.  
  375.  
  376.  
  377. There's not much to sum up in this essay, unless it is to point out how simple 
  378. it is to customize these programs with a resource editor. Strings are by all 
  379. means a good starting point in reverse-engineering or cracking a program; if you 
  380. follow any one of the "http:" strings in W32Dasm, you'll find that the first or 
  381. second call following leads to the "URL Parsing" routine, which is referenced by 
  382. about a hundred different lines of code. <P>
  383.  
  384. As a note of interest, I did the work on this project twice, once with BRW, once 
  385. with Symantec Resource Studio; both were equal until I juggled the menus, which 
  386. then did not link to the URLs in the Symantec version. This is not to put down 
  387. Resource Studio as an editor: in fact, it allows me to edit at least some of 
  388. explorer.exe while BRW flat-out crashes. But it is more food for thought; some 
  389. day we may have to "repair" these tools....
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.