Solved

DOS Shell through TCP/IP, File Sharing

Posted on 2002-07-12
12
789 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
  • 3
  • 2
  • 2
  • +5
12 Comments
 
LVL 63

Expert Comment

by:SysExpert
Comment Utility
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
Comment Utility
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 250 total points
Comment Utility
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
 
LVL 8

Expert Comment

by:scraig84
Comment Utility
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
Comment Utility
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
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Author Comment

by:srsrki
Comment Utility
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 250 total points
Comment Utility
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
Comment Utility
Man thats asking for big trouble! If one person finds that open port your hash.
0
 
LVL 1

Expert Comment

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

Expert Comment

by:CleanupPing
Comment Utility
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 17

Expert Comment

by:John Gates
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is the first one of a series of articles I’ll be writing to address technical issues that are always referred to as network problems. The network boundaries have changed, therefore having an understanding of how each piece in the network  puzzl…
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now