-
-
Save abriening/1208374 to your computer and use it in GitHub Desktop.
Hijack a running nack_worker ( Pow server )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install hijack | |
ps aux | grep ruby | |
# andrew 10879 0.0 2.4 2538948 100668 ?? S 10:30AM 0:03.09 ruby .../node_modules/nack/bin/nack_worker .../config.ru /tmp/nack.56823.5122799426.sock | |
hijack 10879 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paste this into the running hijack session | |
class AppLogger | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
$last_env = env | |
puts env.inspect | |
@app.call(env) | |
end | |
end | |
ActionController::Dispatcher.middleware.use AppLogger | |
# you will now see the rack env in the hijack session | |
# and have access to $last_env for inspection |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment