?
Solved

DOS Shell through TCP/IP, File Sharing

Posted on 2002-07-12
12
Medium Priority
?
797 Views
Last Modified: 2013-11-29
I Have two PCs, connected through a 100 MBs hub.
One of them is running Windows XP, another is MS-DOS 6.2
on the dos machine i have installed Microsoft network Client 3.0 with TCP/IP and currently have access to my windows XP shared files

How can I run command.com with a tcp (not udp, but i guess that is not the issue) socket set to stdio.
I would also like to be able to start other programs which could inherit stdio from that copy of command interpreter.

There is a similar thing when you run command.com on a serial port, only here I need it through a LAN. One connection would be fine (considering the DOS's ability to multitask) and the machine could remain locked while expecting the connection. It wouldn't be a permanent connection.

Once again I stress that the use of file-sharing "at the same time" with dos-shell is crucial.
0
Comment
Question by:srsrki
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +5
12 Comments
 
LVL 63

Expert Comment

by:SysExpert
ID: 7150162
I don't think that DOS has the redirect option for a network of any kind.
It simply is beyond the design specifications.
You want to take what is essentially a TTY functionality and make it network compatible.

If you can code in C or assembly, you might be able to try writing some code for this, but it would be time consuming.
You would probably need to hook into something like a packet driver.

I would check out something like
Freedos.org, and linux as alternatives.

I hope this helps !


0
 
LVL 1

Author Comment

by:srsrki
ID: 7152165
Ok. a little help from what I found in the meantime

First of all I need a name of a good DOS C or C++ compiler preferably one that supports popen or a workaround so I could read input and output to a buffer from which i'd send/recieve to/from a tcp socket by using an interrupt procedure hooked to a timer to check the buffer states and send packets.

Also I need a way to use the tcp
I found something called PC/TCP that uses int 61 or int 60. So I guess that there's something similar with microsoft. probably on the same ints

any suggestions, ideas or code are welcome.
(any normal pascal based,c based assembly Basic,QB,VB etc programming language is OK even pseudo drawings).

any partial solutions will be taken under consideration and rewarded.
0
 
LVL 63

Accepted Solution

by:
SysExpert earned 1000 total points
ID: 7152918
Linux has plenty of compilers, some should work in straight DOS.

Check Ralf Brown's Interrupt list and look for a packet driver. It comes with source code. A google.com search will bring it up.

I hope this helps !
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 8

Expert Comment

by:scraig84
ID: 7154763
Maybe I am misunderstanding the request.  However, doesn't XP offer a command prompt through the use of the telnet server option just like Windows 2000?  I would assume so but I don't have an XP box in front of me.  This is the only way I know of currently to run a remote DOS prompt.  
0
 
LVL 24

Expert Comment

by:SunBow
ID: 7158435
I too am misunderstanding.

DOS does real poorly at unixy features such as stdio. But it does redirects ok. And the more recent versions enable that across network, through either name or more commonly through mapped drives.

So the Dos box could, say, have a batch file (or program)

RunSTDIO   <L:\MyXPinput.file    > M:\MyXPoutput.file

Noting, there is stdin, stdout, and stderr, each of which must be addressed to achieve success

> There is a similar thing when you run command.com on a serial port,

I've no idea what you mean by that. Command.com is CLI, runs in ram, not on port. Old dos and OEMs had extra commands, such as mode, to enable similar features for port management. On XP we run Cmd.exe, not command.com

NT family permits remote access to command prompt, by adding additional services, but that has little to do with stdio

Why not Run Visual Studio on the XP, assuming it is a power_unit, then you can choose between c++ and VB? There are common samples for passing messages back and forth for either udp or tcp, up to primitive mailers, telnet, etc.

> something called PC/TCP

Sounds like from origins of dos and 3.1 that became known as OnNet (32b for win9x)
0
 
LVL 1

Author Comment

by:srsrki
ID: 7158807
Just to make things clearer.
--!--!--!--!--!--!--!--!
I need a ms-dos shell (command.com) dropped to a tcp socket in ms-dos environment.
--!--!--!--!--!--!--!--!

I've managed so far to install tcp/ip on ms-dos machine (ping works, I can access files which are shared in my workgroup and are located on my xp pro machine) and I need the utility (or I have to write one if it doesn't exist) to take all command.com outputs and send them through a tcp connection and take everything that arrives through a connection and send it to command.com

Have some of you ever tried to connect two machines with a serial cable and on one of it start let's say " command.com COM1 " and then on another machine ie. windows you open let's say hyperterminal and voila you have a prompt. The MS-DOS machine command.com is piped to a COM1. Now I need the same functionality but with a network instead of COM1 to make the tcp socket my CONsole on a DOS Machine.

note. if anyone wants to try the above with the serial ports you have to set the baud rate,parity etc. with MODE.

OK, so presuming I have to write my own prog i'd need two things
1) pipes in DOS
2) microsoft's tcp packet driver programming interface specification or in a nutshell how to send and receive data through a tcp socket

Now is this a networking question or a programming question since it requires some network programming.

and please don't tell me that it can't be done cause i've seen pop3 mail servers for DOS.

so the DOS (but not the DOS box in a win or lin or BSD) could say for example.

myprog.exe set the port to 23
Command.com | myprog.exe

and an nt cmd.exe box would say for example
telnet my.msdos.machine.local.net
and in telnet i'd get some sort of msdos prompt

The reason I need it is that I have to control a pc real-mode environment program remotely from a network.
The Alternative is to make a frankenstein of two pc's to do the work of a smart software.
0
 
LVL 1

Author Comment

by:srsrki
ID: 7158815
sorry I've just remembered I can't use command.com | myprog.exe but I could use something like myprog.exe DoYourThingWith command.com
0
 
LVL 1

Assisted Solution

by:jluster
jluster earned 1000 total points
ID: 7158899
Well, there is a way - but it's highly insecure (as almost all telnet based communication usually is, but that one does not verify usernames or passwords, either. You might be able to add those things (encryption, login) by simply using cygwin's (thats Unix tools for DOS) ssh server, but if you don't want to do that, here's how to get a command.com shell per TCP:

The program you are looking for is called 'netcat'. It can be used as a server or as a client, we're using the server portion here.

Once you downloaded netcat and installed it (link below), start it with:

nc -l -p1234 -d -e command.com –L

the -L puts it in "Listen" mode, at the port specified with -p (1234 in this example) and will execute command.com when you connect.

Now, from the client machine telnet to the server machine on port 1234 and you'll have your shell. To connect it to the "standard" telnet port, so all you have to type is "telnet dest", use -p 23

Make _absolutely_ sure, you are the only one to be able to connect there. Otherwise you'll be in a world of hurt as soon as the first telnet scanner comes past you IP block.

NetCat download URL: http://pintday.org/downloads/nc11nt.zip
0
 
LVL 3

Expert Comment

by:Comply
ID: 7167296
Man thats asking for big trouble! If one person finds that open port your hash.
0
 
LVL 1

Expert Comment

by:jluster
ID: 7167326
That's what traffic filters are generally for. But, yes, that's what I say in my posting.
0
 

Expert Comment

by:CleanupPing
ID: 9155530
srsrki:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 18

Expert Comment

by:John Gates, CISSP
ID: 9356810
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd Split points between sysexpert and jluster

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Dimante
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Make the most of your online learning experience.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Suggested Courses
Course of the Month9 days, 16 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question