Remote CMD Login

2

I need a VNC/SSH/something server that will let me access command line remotely from a limited account (meaning no services or any install). Just a simple exe that I can run and have it either connect to me or listen for a connection. Preferably it would ask for a user/pass and run the cmd as the user I specify. Is there any such program?

Christopher Tarquini

Posted 2009-10-11T16:53:07.570

Reputation: 237

Answers

4

John mentions psexec as being able to run a single executable. What he doesn't mention is that that executable can be cmd.exe (or powershell or bash or whatever), which will give you a remote shell.

wfaulk

Posted 2009-10-11T16:53:07.570

Reputation: 5 692

here's a good overview of how psexec works: http://forum.sysinternals.com/forum_posts.asp?TID=9674&PID=41829#41829 .. but it doesn't mention what it uses for the connection. (SMB/CIFS? RPC?)

– quack quixote – 2009-10-11T17:36:34.377

@JohnT, psexec is billed as a telnet-replacement, but it isn't telnet, has nothing to do with port 23, and only works if microsoft networking is enabled. – quack quixote – 2009-10-11T17:40:07.303

tho it does require a temporary service on the remote machine (which it will install & remove itself). – quack quixote – 2009-10-11T17:41:15.023

I would use psexec but when I run it, it shows a GUI which freezes my console and I have to open up another one to kill it. Is there a switch to disable that GUI message? – Christopher Tarquini – 2009-10-12T17:57:50.687

A GUI?!? The only thing I can think of is that some of those Sysinternals tools require a one-time license agreement. Other than possibly that, I've never seen any GUI component of psexec. – wfaulk – 2009-10-12T22:44:02.123

The switch /accepteula avoids the EULA popup and automatically accepts it. – Stephen Jennings – 2009-11-27T10:49:48.433

0

Telnet?

alt text

For running a single command over telnet, there is psexec from Sysinternals, which is a single executable that doesn't require installation. If you'd like the extra security (recommended) there is OpenSSH for Windows, but that will require an install.

John T

Posted 2009-10-11T16:53:07.570

Reputation: 149 037

Telnet is disabled on the server. Is there a third party server that doesn't require being run as a service? – Christopher Tarquini – 2009-10-11T17:06:23.737

0

Do-it yourself corner.

There is an open-source on codeproject for two components, server & client. The server is written in java and the client in C++. The server only needs enough permissions to open a socket, as described:

It first creates a server socket so that clients can connect to it. When a client is connected to the server, it will spawn a new thread using the CommandRunner class to handle the client's request. The main thread will continue to listen for new client.

The server part is here : Executing commands on a remote machine - Part 1
The client part is here : Executing commands on a remote machine - Part 2

image

harrymc

Posted 2009-10-11T16:53:07.570

Reputation: 306 093

The client appears to be written in MFC, judging by the icon =p – John T – 2009-10-11T18:14:27.250

Fixed it. (15 chars) – harrymc – 2009-10-11T18:52:21.633

I actually coded a reverse-shell for this however I found that for many things it doesn't work (I tried running "runas.exe" from the shell but it doesn't let me enter any input and just closes – Christopher Tarquini – 2009-10-11T21:57:15.817

That's probably because as you said it's a limited account. – harrymc – 2009-10-12T06:18:52.367