Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8 KiB

  1. <%@ LANGUAGE = PerlScript%>
  2. <HTML>
  3. <HEAD>
  4. <!--
  5. Copyright (c) 1996, Microsoft Corporation. All rights reserved.
  6. Developed by ActiveState Internet Corp., http://www.ActiveState.com
  7. -->
  8. <!-- This PerlScript file enable you to read the source code on your brower directly -->
  9. <TITLE> PerlScript utility to view source code</TITLE>
  10. <BODY>
  11. <BODY BGCOLOR=#FFFFFF>
  12. <!--
  13. ActiveState PerlScript sample
  14. PerlScript: The coolest way to program custom web solutions.
  15. -->
  16. <!-- Masthead -->
  17. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  18. <TR VALIGN=TOP ><TD WIDTH=400>
  19. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  20. </TD></TR></TABLE>
  21. <H2> A PerlScript utility to view Server Side Source</H2>
  22. <%
  23. $filename = $Request->querystring('filename')->item;
  24. $URL= $Request->querystring('URL')->item;
  25. %>
  26. <hr>
  27. <h3>HTML Source for: <b> <%=$URL%> </b></h3>
  28. <pre>
  29. <%
  30. # make sure filename does not contain any path info
  31. $_ = $filename;
  32. if (/[\/\\]/) {
  33. %> Error in filename <%= $filename %> <%
  34. }
  35. else {
  36. # get path of this file
  37. $path = $Request->ServerVariables('PATH_TRANSLATED')->item;
  38. $path =~ s/[\/\\](\w*\.asp\Z)//m;
  39. # make path to look at
  40. $filename = substr $path.'\\'.$filename, 0, 100;
  41. open(SOURCE, $filename);
  42. while(<SOURCE>) {
  43. s/</&lt;/g;
  44. s/>/&gt;/g;
  45. s/&lt;%/&lt;%<b>/g;
  46. s/%&gt;/<\/b>%&gt;/g;
  47. $Response->write($_);
  48. }
  49. close(SOURCE);
  50. } # else valid filename
  51. %>
  52. </pre>
  53. <HR><A HREF="index.htm"> Return </A>
  54. <P><P><P>
  55. <%
  56. $url = $Request->ServerVariables('PATH_INFO')->item;
  57. $params = 'filename=showsource.asp&URL='."$url";
  58. $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  59. %>
  60. <A HREF="showsource.asp?<%=$params%>">
  61. <h4><i>view showsource.asp itself</i></h4></A>
  62. </BODY>
  63. </HTML>