Module: Msf::EvasiveTCP
- Defined in:
- lib/msf/core/exploit/tcp.rb
Instance Attribute Summary collapse
-
#_send_delay ⇒ Object
Returns the value of attribute _send_delay.
-
#_send_size ⇒ Object
Returns the value of attribute _send_size.
-
#evasive ⇒ Object
Returns the value of attribute evasive.
Instance Method Summary collapse
Instance Attribute Details
#_send_delay ⇒ Object
Returns the value of attribute _send_delay
7 8 9 |
# File 'lib/msf/core/exploit/tcp.rb', line 7 def _send_delay @_send_delay end |
#_send_size ⇒ Object
Returns the value of attribute _send_size
7 8 9 |
# File 'lib/msf/core/exploit/tcp.rb', line 7 def _send_size @_send_size end |
#evasive ⇒ Object
Returns the value of attribute evasive
7 8 9 |
# File 'lib/msf/core/exploit/tcp.rb', line 7 def evasive @evasive end |
Instance Method Details
#denagle ⇒ Object
9 10 11 12 13 14 |
# File 'lib/msf/core/exploit/tcp.rb', line 9 def denagle begin setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1) rescue ::Exception end end |
#write(buf, opts = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/msf/core/exploit/tcp.rb', line 16 def write(buf, opts={}) return super(buf, opts) if not @evasive ret = 0 idx = 0 len = @_send_size || buf.length while(idx < buf.length) if(@_send_delay and idx > 0) ::IO.select(nil, nil, nil, @_send_delay) end pkt = buf[idx, len] res = super(pkt, opts) flush() idx += len ret += res if res end ret end |