daily pastebin goal
31%
SHARE
TWEET

Untitled

a guest Sep 4th, 2018 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. classic ASP one page security
  2. domainUsername = Request.ServerVariables("AUTH_USER")
  3. if domainUsername = "domainusera" or domainUsername = "domainuserb" then
  4.     'show numbers
  5. else
  6.     'show error
  7. end if
  8.    
  9. <%
  10.      Function Login(username,password)
  11.         Login = False
  12.         If Trim(LCase(username)) = "somebodywhocanseethepage" And Trim(LCase(password)) = "opensaysame" Then
  13.                Login = True
  14.         End If
  15.      End Function
  16.  
  17.      Sub WriteLoginForm()
  18.      %>
  19.      <form action="<%= Request.ServerVariables("SCRIPT_NAME") %>" method="post">
  20.           <input type="hidden" name="_TRIGGER" id="_TRIGGER" value="LOGIN" />
  21.           Username: <input type="text" name="username" id="username"  /><br />
  22.           Password: <input type="password" name="password" id="password" /><br />
  23.           <input type="submit" value="Login" />
  24.      </form>
  25.      <%
  26.      End Sub
  27.  
  28.      Sub WritePageContent()
  29.      %>
  30.      <h1>Phone Numbers</h1>
  31.      <ul>
  32.        <li>867-5309</li>
  33.        <li>911</li>
  34.        <li>2 8 1, 3 3 oh, eight zero zero fo'</li>
  35.      </ul>
  36.      <%
  37.      End Sub
  38.  
  39.      If Request.Form("_TRIGGER") = "LOGIN"
  40.          If Login(Request.Form("username"),Request.Form("password"))
  41.              WritePageContent
  42.          Else
  43.              Response.Write "Login failed.<br />"
  44.              WriteLoginForm
  45.          End If
  46.      Else
  47.          WriteLoginForm
  48.      End If
  49. %>
  50.    
  51. <%
  52.     if request.querystring("mysecretquery") = "mypassword" then
  53. %>
  54. <html>
  55. <body>
  56.     My data.
  57. </body>
  58. </html>
  59. <%
  60.     else
  61.         response.write("Error")
  62.     end if
  63. %>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top