The Ruby (
anastm.rb) code sample contains the following function:
# attempt to 'discover MSS' by observing the SYN-ACK-ACK
def find_mss (hand2)
layer_tcp = hand2.FindLayer("TCP")
f_o = layer_tcp.FindField("MSS")
print "the mss is #{f_o.value}\n"
f_o.
value.to_i
end
When I execute the script, I get:
in `find_mss': undefined method `value' for nil:NilClass (NoMethodError)
I tried this with an upper case “V” on “.value”, but I get the same error.
I printed the value of “f_o” and it comes out as empty.
I tried passing “mss”, “"Max Segment Size”, "Maximum Segment Size”, etc. into the FindField function…. Bu no luck.
If I remove the “.value”, then I get:
the mss is 0
But that is only because:
C:\ruby193>irb
irb(main):001:0> "".to_i
=> 0
Why am I not getting a value for “MSS” ?
Thanks,
Andy