79382451

Date: 2025-01-23 20:18:53
Score: 1
Natty:
Report link

I know... 8 years later... I have a network with 70 Lantronix serial servers, various models UDS10, UDS1100, UDS2100, XportAr, EDS4100.
I know there is a Dsearch.exe commandline tool, but I would like to use PowerShell to discover Lantronix on the network.
According to Michael Lyon at Lantronix to discover old Cobos by sending hex 00 00 00 F8 to UDP 30718.
"The response from each device is exactly 120 bytes and will always start with the hex 00 00 00 F9" when the query starts with hex 00 00 00 F8. The four hex values immediately after the F9 are the responding unit's IP address in hex."

So please, is it possible to "convert" your Java script to PowerShell ?
I don't know how to adapt the idea from: Send and Recieve TCP packets in PowerShell and maybe UDPsender like Sends a UDP datagram to a port :

# Define port and target IP address  Random here!  
    $Port       = 20000 
    $IP         = "10.10.1.100"  
    $Address    = [system.net.IPAddress]::Parse( $IP ) 

# Create IP Endpoint  
    $End        = New-Object System.Net.IPEndPoint $address , $port  

# Create Socket  
    $Saddrf     = [System.Net.Sockets.AddressFamily]::InterNetwork 
    $Stype      = [System.Net.Sockets.SocketType]::Dgram 
    $Ptype      = [System.Net.Sockets.ProtocolType]::UDP 
    $Sock       = New-Object System.Net.Sockets.Socket $saddrf , $stype , $ptype  
    $Sock.TTL   = 26 

# Connect to socket  
    $sock.Connect( $end )

# Create encoded buffer  
    $Enc        = [System.Text.Encoding]::ASCII 
#   $Message    = "Jerry Garcia Rocks`n" *10 ; # This was Original Message 
    $Message    = [char]0x00 + [char]0x00 + [char]0x00 + [char]0xF6
    $Buffer     = $Enc.GetBytes( $Message ) 

# Send the buffer  
    $Sent       = $Sock.Send( $Buffer ) 
    "{0} characters sent to: {1} " -f $Sent , $IP  
    "Message is:"  
    $Message  

# End of Script
Reasons:
  • Blacklisted phrase (1): is it possible to
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Laurentiu Ioan