473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DOS Prompt in I.E.

I came up with this the other day while playing. Basically it puts an
I.E. wrapper around a DOS prompt. There are a few things to note:

1. It cannot handle any programs that require input, or any programs
that require a CTRL-C to exit. If you do this, you'll have to run an
IISRESET.
2. It cannot handle any programs that trigger a window. Again, if you
do you'll have to run IISRESET.
3. It doesn't do commands (e.g. DIR, MD, CD) but it will run programs
(IPCONFIG, PING, NETSTAT)
4. This app EXPOSES YOUR COMPUTER and as such is a potential back-door
for malicious entry, if somebody happened to stumble across the page and
run the right programs. As a result, you should take the highest
possible precautions to secure the page if you plan to keep it on a live
box. I personally have NT Auth set up for the page.
5. This page won't even come close to working in Netscape, so don't even
try.
6. Either name it HyperDOS.asp, or change the references to the name in
the page.

I'm interested in any feedback you can provide, as well as any
suggestions to fix or lessen notes 1-3.

==========

<%
Option Explicit

Select Case Request("Action")
Case ""
%>
<html>
<head>
<title>HyperDOS</title>
</head>

<frameset rows="10%, 90%" border=0>
<frame id=StdIn name=StdIn scrolling="no">
<frame id=StdOut name=StdOut src="?
Action=Main">
</frameset>
</html>
<%
Case "Main"
%>
<html>
<head>
<script language="VBScript">
Function Main()
Print "<b>HyperDOS v0.01a</b>"
Print "Designed 2003 by Scott
McNair"
Print "Type 'DISCLAIMER' for
legal information."

Input.focus()
End Function

Function ParseData()
txtInput = Input.value
Input.value = ""
Path.style.display="none"
Input.style.display="none"

Print "&gt; " & txtInput
txtInput = lcase(txtInput)

If LCase(txtInput)
="disclaimer" Then
Print "<b>HyperDOS</b>
provides a front-end to Windows command prompt. If you put this page on
your web server, please " &_
"keep in mind that
you're providing a potential back door for people to come in and
delete/create/modify files " &_
"on your computer.
Please make sure to take appropriate precautions."

document.location.href="#bottom"
txtLastInput =
txtInput

Path.style.display="inline"

Input.style.display="block"
Input.focus()
Exit Function
End If
parent.StdIn.location.href="HyperDOS.asp?Action=Dr ill&Command=" &
txtInput
End Function

Function Print(MyText)
txtOutput.innerHTML =
txtOutput.innerHTML & "<div style='border:solid black
1px;color:white'>" & MyText & "</div>"
End Function
</script>
</head>

<body onload="Main()" style="font-
family:courier;background-color:black;color:white">
<div name=txtOutput id=txtOutput></div>
<span name=Path id=Path>&gt;&nbsp;</span>
<input type=text name=Input id=Input
style="width:500px;border:none;font-
family:courier;height:20px;color:White;background-color:black;"
onkeypress="If window.event.keyCode = 13 Then ParseData()">
<a name="bottom"></a>
</body>
</html>
<%
Case "Drill"
Dim Command : Command=Request("Command")
Dim objShell, objWshScriptExec, objStdOut, strLine
Set objShell = Server.CreateObject("WScript.Shell")

On Error Resume Next
Set objWshScriptExec = objShell.Exec (Command)
'The command line
Set objStdOut = objWshScriptExec.StdOut 'Reads
the output from the command
%>
<html>
<head></head>
<body>
<%
If objStdOut Then
While Not objStdOut.AtEndOfStream
strLine = objStdOut.ReadLine
strLine = Left(strLine,Len
(strLine)-1) & "<br>"
strLine = Replace
(strLine,"""","&quot;")
Response.Write "<script
language=VBScript>" & vbcrlf
%>

parent.StdOut.txtOutput.innerHTML =
parent.stdOut.txtOutput.innerHTML & "<div style='border:solid black
1px;color:white'><%=strLine%></div>"

parent.StdOut.document.body.doScroll(down)
<%
' Response.Write "Print """ &
strLine & """" & vbcrlf
Response.Write "</script>" &
vbcrlf
Response.Flush
Wend
End If
On Error Goto 0
%>
<script language="VBScript">
Print "&nbsp;"
parent.StdOut.Path.style.display="inline"
parent.StdOut.Input.style.display="inline"
parent.StdOut.Input.focus()
'
parent.StdOut.location.href=parent.StdOut.location .href &
"#bottom"
</script>
</body>
<%
End Select
%>
Jul 19 '05 #1
1 4274
Another ASP based command toy:
http://www.dalun.com/ftp/cmdconsole.zip
"Scott McNair" <scott.mcnair@sfmco.[takethispartout].com> wrote in message
news:Xn************************@207.46.248.16...
I came up with this the other day while playing. Basically it puts an
I.E. wrapper around a DOS prompt. There are a few things to note:

1. It cannot handle any programs that require input, or any programs
that require a CTRL-C to exit. If you do this, you'll have to run an
IISRESET.
2. It cannot handle any programs that trigger a window. Again, if you
do you'll have to run IISRESET.
3. It doesn't do commands (e.g. DIR, MD, CD) but it will run programs
(IPCONFIG, PING, NETSTAT)
4. This app EXPOSES YOUR COMPUTER and as such is a potential back-door
for malicious entry, if somebody happened to stumble across the page and
run the right programs. As a result, you should take the highest
possible precautions to secure the page if you plan to keep it on a live
box. I personally have NT Auth set up for the page.
5. This page won't even come close to working in Netscape, so don't even
try.
6. Either name it HyperDOS.asp, or change the references to the name in
the page.

I'm interested in any feedback you can provide, as well as any
suggestions to fix or lessen notes 1-3.

==========

<%
Option Explicit

Select Case Request("Action")
Case ""
%>
<html>
<head>
<title>HyperDOS</title>
</head>

<frameset rows="10%, 90%" border=0>
<frame id=StdIn name=StdIn scrolling="no">
<frame id=StdOut name=StdOut src="?
Action=Main">
</frameset>
</html>
<%
Case "Main"
%>
<html>
<head>
<script language="VBScript">
Function Main()
Print "<b>HyperDOS v0.01a</b>"
Print "Designed 2003 by Scott
McNair"
Print "Type 'DISCLAIMER' for
legal information."

Input.focus()
End Function

Function ParseData()
txtInput = Input.value
Input.value = ""
Path.style.display="none"
Input.style.display="none"

Print "&gt; " & txtInput
txtInput = lcase(txtInput)

If LCase(txtInput)
="disclaimer" Then
Print "<b>HyperDOS</b>
provides a front-end to Windows command prompt. If you put this page on
your web server, please " &_
"keep in mind that
you're providing a potential back door for people to come in and
delete/create/modify files " &_
"on your computer.
Please make sure to take appropriate precautions."

document.location.href="#bottom"
txtLastInput =
txtInput

Path.style.display="inline"

Input.style.display="block"
Input.focus()
Exit Function
End If
parent.StdIn.location.href="HyperDOS.asp?Action=Dr ill&Command=" &
txtInput
End Function

Function Print(MyText)
txtOutput.innerHTML =
txtOutput.innerHTML & "<div style='border:solid black
1px;color:white'>" & MyText & "</div>"
End Function
</script>
</head>

<body onload="Main()" style="font-
family:courier;background-color:black;color:white">
<div name=txtOutput id=txtOutput></div>
<span name=Path id=Path>&gt;&nbsp;</span>
<input type=text name=Input id=Input
style="width:500px;border:none;font-
family:courier;height:20px;color:White;background-color:black;"
onkeypress="If window.event.keyCode = 13 Then ParseData()">
<a name="bottom"></a>
</body>
</html>
<%
Case "Drill"
Dim Command : Command=Request("Command")
Dim objShell, objWshScriptExec, objStdOut, strLine
Set objShell = Server.CreateObject("WScript.Shell")

On Error Resume Next
Set objWshScriptExec = objShell.Exec (Command)
'The command line
Set objStdOut = objWshScriptExec.StdOut 'Reads
the output from the command
%>
<html>
<head></head>
<body>
<%
If objStdOut Then
While Not objStdOut.AtEndOfStream
strLine = objStdOut.ReadLine
strLine = Left(strLine,Len
(strLine)-1) & "<br>"
strLine = Replace
(strLine,"""","&quot;")
Response.Write "<script
language=VBScript>" & vbcrlf
%>

parent.StdOut.txtOutput.innerHTML =
parent.stdOut.txtOutput.innerHTML & "<div style='border:solid black
1px;color:white'><%=strLine%></div>"

parent.StdOut.document.body.doScroll(down)
<%
' Response.Write "Print """ &
strLine & """" & vbcrlf
Response.Write "</script>" &
vbcrlf
Response.Flush
Wend
End If
On Error Goto 0
%>
<script language="VBScript">
Print "&nbsp;"
parent.StdOut.Path.style.display="inline"
parent.StdOut.Input.style.display="inline"
parent.StdOut.Input.focus()
'
parent.StdOut.location.href=parent.StdOut.location .href &
"#bottom"
</script>
</body>
<%
End Select
%>

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Hank | last post by:
Hi, does anyone know how to change the foreground color of the command prompt through python? For example if i was printing out an error message, I would like it to be red where the normal...
12
by: zhi | last post by:
Really confused, when I use keyword style argument as following: >>> input(prompt="hello") Traceback (most recent call last): File "<pyshell#52>", line 1, in -toplevel- input(prompt="hello")...
13
by: JSE | last post by:
Hello everyone. here's what we have in an html file. <form ..... <input type=button name="comment" onclick=" prompt('enter comment',' ' )" > Is there anyway to get the value...
2
by: WStoreyII | last post by:
how do i change the default directory and prompt fo the the .net command prompt for example when i load it i wish the directory to already be desktop and the prompt to be Cmd: thanks ...
7
by: Petesman | last post by:
I am trying to make a prompt that will ask the user for some input... If I just use var input = prompt("dafa") everything works fine but the box is put in the top left corner of the window. I need...
4
by: glenn | last post by:
I keep reading all sorts of books on VS that keep telling me to click on Tools/Visual Studio Command prompt to run this program or that program. However, I do not have such a menu choice. Where is...
3
by: J.P. Cummins | last post by:
In my ASP.NET application, I wish to have a page for administrators to edit items in a list. Preferably, I would like to use the javascript prompt for the 'rename' function, and a javascript alert...
5
by: hcross | last post by:
This project is a web based html and Javascript site. I am working on mac at the moment. This script works except for attempting to open new window once complete. As you can see, i am new to...
4
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it...
4
by: ARC | last post by:
Hello all, I didn't use to have this problem in Access 97, but in 2007 (and maybe other versions of access after 97), if you have a form that has a subform, and you click the close button, you...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.