File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
modules/auxiliary/admin/scada Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -71,10 +71,20 @@ def send_recv_once(data)
71
71
72
72
def get_info ( rhost , rport )
73
73
connect ( true , 'RHOST' => rhost , 'RPORT' => rport )
74
- code = send_recv_once ( "\x01 \x01 \x00 \x1a \x00 ^\x00 \x00 \x00 \x00 \x00 \x03 \x00 \x0c IBETH01N0_M\x00 " ) [ 34 ..35 ]
74
+ data = send_recv_once ( "\x01 \x01 \x00 \x1a \x00 ^\x00 \x00 \x00 \x00 \x00 \x03 \x00 \x0c IBETH01N0_M\x00 " )
75
+ if data . nil? || data . length < 36
76
+ print_error ( "Could not obtain information on this device" )
77
+ disconnect
78
+ return "UNKNOWN"
79
+ end
80
+ code = data [ 34 ..35 ]
75
81
send_recv_once ( "\x01 \x05 \x00 \x16 \x00 \x5f \x00 \x00 \x08 \xef \x00 " + hex_to_bin ( code ) + "\x00 \x00 \x00 \x22 \x00 \x04 \x02 \x95 \x00 \x00 " )
76
82
data = send_recv_once ( "\x01 \x06 \x00 \x0e \x00 \x61 \x00 \x00 \x88 \x11 \x00 " + hex_to_bin ( code ) + "\x04 \x00 " )
77
83
disconnect
84
+ if data . nil? || data . length < 200
85
+ print_error ( "Could not obtain information on this device" )
86
+ return "UNKNOWN"
87
+ end
78
88
plctype = hex_to_bin ( data [ 60 ..99 ] )
79
89
print_status ( "PLC Type = " + plctype )
80
90
print_status ( "Firmware = " + hex_to_bin ( data [ 132 ..139 ] ) )
You can’t perform that action at this time.
0 commit comments