Skip to main content

Agent Deployment via WinRM SSH

Preparing the Machines

Debian Machines (Medulla Main and Medulla Relay)
  • Ensure that netcat is installed on the Debian machines: 
  • sudo apt update && sudo apt install netcat-openbsd
Windows Machine (Client Workstation)
  • Make sure PowerShell is configured to run scripts: 
  • Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
  • Answer [A] "Yes to all"

Listening Scripts

On Debian Machines (Medulla Main and Medulla Relay)
Use the listen_ports_debian.sh script to listen on the necessary ports.

Steps:
  1. Download thelisten_ports_debian.shscriptto the machine.
  2. Make it executable (and convert to Unix if necessary): 
chmod +x listen_ports_debian.sh
dos2unix listen_ports_debian.sh
  1. Run the script
    • ForMedulla Main
    • ./listen_ports_debian.sh --medulla
    • ForMedulla Relay
    • ./listen_ports_debian.sh --relay

On the Windows Machine (Client)
Use the listen_ports_windows.ps1 script to listen on the necessary ports.

Steps:
  1. Download thelisten_ports_windows.ps1scriptto the machine.
  2. Run the script:
.\listen_ports_windows.ps1

Connection Test Scripts

On Debian Machines (Medulla Main, Medulla Relay, and Client Station)

Use the medulla_connection_check.sh, medulla_relay_connection_check.sh, and windows_connection_check.ps1 scripts to test connections to the machines.

Steps:
  1. Download the scriptsto the three machines (Medulla Main, Relay, and Client Workstation).
  2. Make them executable
  3. chmod +x medulla_connection_check.sh
    chmod +x medulla_relay_connection_check.sh
    chmod +x listen_ports_debian.sh
  4. If necessary (error when running the Debian scripts), convert them to Unix:
  5. dos2unix medulla_connection_check.sh
    dos2unix medulla_relay_connection_check.sh
    dos2unix listen_ports_debian.sh
  6. Run the script
    • To test connections fromMedulla Mainto the Medulla Relay: 
    • ./medulla_connection_check.sh --relay <Medulla_Relay_IP>
    • To test connections fromMedulla Mainto a Client Workstation: 
    • ./medulla_connection_check.sh --client <Client_Workstation_IP>
    • To test connections fromMedulla Relayto Medulla Main: 
    • ./medulla_relay_connection_check.sh --medulla <Medulla_Main_IP>
    • To test connections fromMedulla Relayto a Client Workstation: 
    • ./medulla_relay_connection_check.sh --client <Client_Workstation_IP>
    • To test connections froma Client Station toMedulla Main and Medulla Relay:
    • .\windows_connection_check.ps1 -Target <Medulla_Main_IP> -Mode pulse
      .\windows_connection_check.ps1 -Target <Medulla_Relay_IP> -Mode relay

Complete Procedure

Port Listening

      On Medulla Main (Debian):

./listen_port_debian.sh --medulla

      On Medulla Relay (Debian):

./listen_port_debian.sh --relay

      On Client Workstation (Windows):

.\listen_ports_windows.ps1



Connection Test From Medulla Main (Debian)
:
./medulla_connection_check.sh --relay <Medulla_Relay_IP>
./medulla_connection_check.sh --client <Client_Workstation_IP>

From Medulla Relay (Debian):
./medulla_relay_connection_check.sh --medulla <Medulla_Main_IP>
./medulla_relay_connection_check.sh --client <Client_Workstation_IP>

From the Client Workstation (Windows):
.\windows_connection_check.ps1 -Target <Medulla_Main_IP> -Mode pulse
.\windows_connection_check.ps1 -Target <Medulla_Relay_IP> -Mode relay

Troubleshooting

Connection Issues
  • Check IP addresses: Make sure the IP addresses used are correct.
  • Check firewalls: Make sure that the firewalls on the machines allow connections on the necessary ports.
  • Check services: Make sure the necessary services are running.
Listening Issues
  • Check listening ports: Use `netstat -ano` on Windows or `ss -tulnp` on Debian to verify that the ports are listening.
  • Check for errors: Review the error messages in the scripts to identify any issues.