Skip to content

Instantly share code, notes, and snippets.

@kronos
Created October 25, 2010 00:10
Show Gist options
  • Save kronos/644192 to your computer and use it in GitHub Desktop.
Save kronos/644192 to your computer and use it in GitHub Desktop.
def execute(domain)
Rails.logger.info "Esteblishing ssh connection to #{domain}"
Net::SSH.start(domain, DDOS_USER) {|ssh| yield DdosmeSSH.new(ssh)}
end
irb(main):065:1* ssh.execute("echo 'П' > 1")
irb(main):066:1> end
OpenSSL::Cipher::CipherError: data not multiple of block length
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/transport/state.rb:85:in `final'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/transport/state.rb:85:in `final_cipher'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/transport/packet_stream.rb:142:in `enqueue_packet'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/transport/session.rb:223:in `enqueue_message'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:368:in `send_message'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/channel.rb:468:in `send_channel_request'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/channel.rb:159:in `exec'
from /opt/ddosme/releases/20101021101212/lib/ddosme_ssh.rb:23:in `block in execute'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/channel.rb:508:in `call'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/channel.rb:508:in `do_open_confirmation'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:535:in `channel_open_confirmation'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:456:in `dispatch_incoming_packets'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:213:in `preprocess'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:197:in `process'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:161:in `block in loop'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:161:in `loop'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/session.rb:161:in `loop'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh/connection/channel.rb:269:in `wait'
from /opt/ddosme/releases/20101021101212/lib/ddosme_ssh.rb:52:in `execute'
from (irb):65:in `block in irb_binding'
from (irb):34:in `block in execute'
from /opt/ddosme/shared/bundle/ruby/1.9.1/gems/net-ssh-2.0.19/lib/net/ssh.rb:186:in `start'
from (irb):34:in `execute'
from (irb):64
from /opt/ddosme/shared/bundle/ruby/1.9.1/bundler/gems/rails-96e8e97e78dd/railties/lib/rails/commands/console.rb:44:in `start'
from /opt/ddosme/shared/bundle/ruby/1.9.1/bundler/gems/rails-96e8e97e78dd/railties/lib/rails/commands/console.rb:8:in `start'
from /opt/ddosme/shared/bundle/ruby/1.9.1/bundler/gems/rails-96e8e97e78dd/railties/lib/rails/commands.rb:33:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'irb(main):067:0>
@will
Copy link

will commented Jun 23, 2011

irb(main):065:1* ssh.execute("echo 'П' > 1".force_encoding('binary')) or whatever encoding you have. My problem was with binary

@kronos
Copy link
Author

kronos commented Jun 23, 2011

Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment