BinProxy
BinProxy copied to clipboard
NoMethodError When Attempting to Forward Intercepted Packets With Custom Class
The code listing that follows is a stack trace I encountered while reverse engineering MasterTrade via the web interface. I tried to patch it myself without any luck. It looks like the exception is actually a result of the FalseClass object being received from gems further down the stack. The command line and software versions are below.
proxy.rb:160 DEBUG proxy.send_message false
NoMethodError
undefined method `forward!' for false:FalseClass
/meta/d/decal/lib/ruby/gems/2.6.0/gems/binproxy-1.0.0/lib/binproxy/proxy.rb:1
61:in `send_message'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/binproxy-1.0.0/lib/binproxy/web_consol
e.rb:129:in `onmessage'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/binproxy-1.0.0/lib/binproxy/web_consol
e.rb:105:in `block in initialize'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/em-websocket-0.3.8/lib/em-websocket/co
nnection.rb:19:in `trigger_on_message'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/em-websocket-0.3.8/lib/em-websocket/me
ssage_processor_06.rb:45:in `message'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/em-websocket-0.3.8/lib/em-websocket/fr
aming07.rb:106:in `process_data'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/em-websocket-0.3.8/lib/em-websocket/ha
ndler.rb:28:in `receive_data'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/em-websocket-0.3.8/lib/em-websocket/co
nnection.rb:71:in `receive_data'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/sinatra-websocket-0.3.1/lib/sinatra-we
bsocket/ext/thin/connection.rb:38:in `receive_data_with_websocket'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/sinatra-websocket-0.3.1/lib/sinatra-we
bsocket/ext/thin/connection.rb:65:in `receive_data_with_flash_policy_file'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/eventmachine-1.0.9.1/lib/eventmachine.
rb:193:in `run_machine'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/eventmachine-1.0.9.1/lib/eventmachine.
rb:193:in `run'
/meta/d/decal/lib/ruby/gems/2.6.0/gems/binproxy-1.0.0/bin/binproxy:126:in `<t
op (required)>'
/meta/d/decal/bin/binproxy:23:in `load'
/meta/d/decal/bin/binproxy:23:in `<main>'
I ran into this stack trace when running binproxy with a custom class file which I'm attaching:
Rename it from ncc_packet.txt to ncc_packet.rb and execute with:
binproxy -c NccPacket -D $IPADDR 6675 34.230.62.47 6675 -d
bash-4.1$ cat /etc/issue
CentOS release 6.10 (Final)
Kernel \r on an \m
bash-4.1$ ruby -v
ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]
bash-4.1$ gem -v
3.0.1
bash-4.1$ which ruby
/meta/d/decal/bin/ruby
bash-4.1$ gem list binproxy bindata
*** LOCAL GEMS ***
binproxy (1.0.0)
*** LOCAL GEMS ***
bindata (2.4.4, 2.1.0)