contents of c drive(ie only)
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: contents of c drive(ie only)

  1. #1
    Member
    Join Date
    Sep 2002
    Posts
    98

    contents of c drive(ie only)

    ever wanted to know how some security testing sites show the contents of your c drive ?
    copy/paste the script between the body tags of your html page and open it using ie(it dose not work if you open the page using any other browser)

    <script language=JavaScript>
    <!--
    if (navigator.appName == 'Microsoft Internet Explorer' ){
    document.write('')
    document.write('<center>')
    document.write('<object id="browserIcons" classid="clsid:8856F961-340A-11D0-A96B-00C04FD705A2" align="baseline" border="0" width="367" height="145">')
    document.write('<param name="Location" value="c:">')
    document.write('<param name="AlignLeft" value="1">')
    document.write('<param name="AutoSize" value="0">')
    document.write('<param name="AutoSizePercentage" value="100">')
    document.write('<param name="AutoArrange" value="0">')
    document.write('<param name="NoClientEdge" value="false">')
    document.write('<param name="ViewMode" value="4">')
    document.write('</object>')
    document.write('</center>')
    }
    // -->
    </script>

  2. #2
    Senior Member
    Join Date
    Aug 2002
    Posts
    651
    I haven't tried it yet, but very cool find nonetheless! I always wondered about that, but I didn't think that it was actually a vulnerability. I will try this out tomorrow.


    Cheers.

    t2k2
    Opinions are like holes - everybody\'s got\'em.

    Smile

  3. #3
    You can see something like this in action at the following place:
    http://www.safecenter.net/demoScan.

  4. #4
    Senior Member n01100110's Avatar
    Join Date
    Jan 2002
    Posts
    347
    There is a much easier way of doing this:
    Written By Georgi Guninski Hacking Exposed 2nd edition pg 623.

    <IFRAME ID="I1"></IFRAME>
    <SCRIPT for=I1 event="NavigateComplete2 (b) ">
    alert("here is your file:\n"+b.document.body.innertext);
    </SCRIPT>
    <SCRIPT>
    I1.navigate("file://c:/");
    set Timeout ('I1.navigate("file://c:/") ' ,1000);
    </SCRIPT>
    "Serenity is not the absence of conflict, but the ability to cope with it."

  5. #5
    Senior Member
    Join Date
    Nov 2002
    Posts
    393
    Great Great black_death

    but first of all, how to list them vertically.
    Secondly, how to keep browsing in the same window ?
    \"I have a 386 Pentium.\"

  6. #6
    Senior Member
    Join Date
    Nov 2002
    Posts
    393
    Is that a warning on my questions ?
    Because yeah, im trying to edit it.
    \"I have a 386 Pentium.\"

  7. #7
    Banned
    Join Date
    Dec 2002
    Posts
    394
    is there a patch for this!

  8. #8
    Senior Member
    Join Date
    Oct 2001
    Posts
    786
    What I have to say is somewhat related to what is being discussed here. It is for further learning, and possibly understanding a little more about this...

    First, most all current Windows systems view folders in IE as "a web-page". There is HTML and JavaScript code that accesses functions to load and display the contents of folders, etc. You can edit this code to do what ever you want..., and probably access it when you want to also (Like browsing your C Drive with the scripts from the other posts). Generally, your computer is viewing a folder as a webpage if you have a frame on the left side that tells you details of the file. I'll tell you how you can edit this code, and know a little bit more about it.

    You can customize this HTML code by going to View > Customize This Folder. Then, you can select one of the several preset views, or you can edit one to suit your needs. You can do many things by editing this code. You can change the colors, descriptions, create alerts, and even password-protect folders (though it isn't too reliable). If another user doesn't like your customizations, they can easily go to View > Customize This Folder, and Remove Customizations.

    To help you gain a deeper understanding, I'll teach you how to password protect your folders. First, I hope you understand HTML and JavaScript, or you might become lost. Also, if you understand them, and read through the preset code, you can get an idea of what the developers were aiming for, and you might learn of hidden functions, etc. For the curious people who want to tag along, I hope that you can identify functions... BTW, I'll have cut-and-paste code for you guys/girls.

    To implement password protection, go to View > Customize This Folder. Select a view that presents the folder how you want it to, and select edit this view. Notepad should come up with the code for that view loaded. Find the "Load()" function, and place this code at the top of it, save it, and close notepad. Click finish and you're done.

    var MyPassword = "password";
    var InputtedPassword = prompt("What is the secret password?","");
    if (MyPassword != InputtedPassword) {
    alert("Incorrect Password!\nAccess Denied!");
    return 1;
    }


    This code should be quite straight-forward. First, it has a variable that permentaly holds the password for this folder (MyPassword). It also has a variable for the user's inputted password to gain access. If they do not match, the user is alerted that they put in the wrong password and the function ends. If it matches, it skips the if statement, and continues to the default code to draw the contents of the folder.

    There are weaknesses in using this script, though. First, the password is stored as plain text. Anyone can choose to edit your code, and view the MyPassword variable, and learn your password. Also, they can bypass your view by going to View > Customize This Folder, and Remove Customizations.


    For those of you who can understand this code, feel free to edit these default views to your hearts content. If you mess up, you can simply go to View > Customize This Folder, and Remove Customizations. I'll tell you of a few things I've done in this... I've written code to alert the user not to click on a file named "Don't Click.txt". When they click that file, they are greeted with an alert that says "I told you not to click this!!!". I've also used this to make it appear that files were created at "The Beginning Of Time", etc. It just replaced the default file attributes of the left-frame with one that I made that contained a similar layout, but with different values. Simply put - If you know what goes on in the default code, you can get it to do what you want it to.

    BTW, I've learned that when you click the Finish after customizations, all instances of IE will refresh. That includes the desktop, the current folder, and any webpages you have open. I lost my first typing of this post to that refresh, so I had to retype it.


    Anyways, good luck in your coding.

    -Tim_axe

  9. #9
    Banned
    Join Date
    Sep 2002
    Posts
    222
    This isn't a vulnerability, so of course there isn't a patch for it. The information on your hard drive, or whatever other file it shows on there, is not shown to the server, but rather only to the browser that you are using (in this case IE). It's no big deal, so there's no need for a patch. Go to your address bar and type in "file:///c:/" or even just "c:/" and it'll go straight to your hard drive... all this script does, basically, is change what is in your address bar, just like a normal referral to another webpage would do.

    Really, it's no big deal.

  10. #10
    Senior Member
    Join Date
    Aug 2002
    Posts
    651
    Just another ploy to try to make us buy some software that we have absolutely no need for. I've seen it used commercially.
    Opinions are like holes - everybody\'s got\'em.

    Smile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides