ASP code in page with .SHTML extension

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rmcape
    New Member
    • Jan 2007
    • 3

    ASP code in page with .SHTML extension

    I'm managing a site that I didn't create. It runs IIS-5. All of the pages have a .SHTML extension, which I understand. A number of pages have ASP code embedded in them. The ISP has configured IIS to allow the ASP code to execute even though the page extension is not .ASP. The people who set all of this up are long gone by several years.

    I have a mirror of the site on my system but I haven't been able to figure out how to configure IIS to allow that behaviour. It just displays the scripts as text in line.

    If you know how to accomplish this, I'd really appreciate your explanation.

    Thanks.

    Bob
  • jaketrimble
    New Member
    • Jan 2007
    • 14

    #2
    in IIS go to "properties " of the directory that holds the .shtml pages that have the ASP code, then on the Directory tab click on "Configuration" , then choose the "Applicatio n Mappings" tab.

    Ok, if you have got this far you are almost done.

    find the .asp extension click edit

    copy the path to the .dll file that handles the execution.

    then close the window

    now click "Add"

    Paste the path that you just copied and add the extension .shtml

    for verbs, you will add this

    GET,HEAD,POST

    thats it....

    BUT

    make sure that you copy the path to the existing .shtml .dll that handles the page configuration.

    this should work, if not let me know

    cheers!

    Comment

    • rmcape
      New Member
      • Jan 2007
      • 3

      #3
      Thanks Jake!

      I modified the entry for .shtml to read: C:\WINDOWS\Syst em32\inetsrv\as p.dll

      The VB Scripts embedded in the .shtml worked as expected.

      You mentioned:

      "BUT
      make sure that you copy the path to the existing .shtml .dll that handles the page configuration."

      I'm not sure what you mean by this.

      Before I modified the entry for .shtml, it read: C:\WINDOWS\Syst em32\inetsrv\ss inc.dll

      Should they both be there? Separated by a ";" ?

      Thanks,

      Bob

      Comment

      • jaketrimble
        New Member
        • Jan 2007
        • 14

        #4
        Originally posted by rmcape
        Thanks Jake!

        I modified the entry for .shtml to read: C:\WINDOWS\Syst em32\inetsrv\as p.dll

        The VB Scripts embedded in the .shtml worked as expected.

        You mentioned:

        "BUT
        make sure that you copy the path to the existing .shtml .dll that handles the page configuration."

        I'm not sure what you mean by this.

        Before I modified the entry for .shtml, it read: C:\WINDOWS\Syst em32\inetsrv\ss inc.dll

        Should they both be there? Separated by a ";" ?

        Thanks,

        Bob
        No, they both do not need to be in there. I just wanted to make sure you kept the path to that dll saved, just in case you needed to change it back, or it did not work for some reason.

        glad to help

        -Jake

        Comment

        • jaketrimble
          New Member
          • Jan 2007
          • 14

          #5
          also, this technique can be applied to other static pages. I first discovered this when I was trying to secure static documents and images within a .NET application. so for "static" documents like .doc, .pdf, .jpg, .gif...etc....y ou can just add these extensions and use the dll that should handle them, like you did for your shtml page.

          by doing that, if users were not logged into that directory, if they would try to access one of those static documents that resided in that specific directory, they would be redirected to the log in page...works something like this...

          request (static document)
          dll reference (i used the asp dll)
          web.config (since it handles it like my other asp pages)
          if not logged in, send to log in page, else view the "static document"

          cheers!

          Comment

          • rmcape
            New Member
            • Jan 2007
            • 3

            #6
            Thanks Jake!

            I appreciate your clarification and the info about other static pages.

            Regards,

            Bob

            Comment

            Working...