-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add irb and pry commands to command shells #11554
Conversation
What do I do if I want to run |
Die inside. Same problem with any metashell command. Consider You would have to use something like I suggested implementing a metashell command prefix or escape menu, but no one listened...
Shall I take another stab at making this thing usable? |
I listened. I distinctly recall suggesting that the world needs more magic.
Nope. Perhaps a metashell prefix would be the way to go, but we'll burn that bridge when we get to it. |
I could add a I have some additional fixes to add to this PR, so I'm adding the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM @wvu-r7
sessions -i 2
[*] Starting interaction with 2...
help
Meta shell commands
===================
Command Description
------- -----------
help Help menu
background Backgrounds the current shell session
sessions Quickly switch to another session
resource Run a meta commands script stored in a local file
shell Spawn an interactive shell (*NIX Only)
download Download files (*NIX Only)
upload Upload files (*NIX Only)
source Run a shell script on remote machine (*NIX Only)
irb Open an interactive Ruby shell on the current session
pry Open the Pry debugger on the current session
irb -h
Usage: irb
Open an interactive Ruby shell on the current session.
OPTIONS:
-e <opt> Expression to evaluate.
-h Help menu.
help irb
Usage: irb
Open an interactive Ruby shell on the current session.
OPTIONS:
-e <opt> Expression to evaluate.
-h Help menu.
help pry
Usage: pry
Open the Pry debugger on the current session.
irb -e 'puts "This is a test"'
This is a test
irb
[*] Starting IRB shell...
[*] You are in the "self" (session) object
irb: warn: can't alias kill from irb_kill.
>> self
=> #<Session:shell 172.22.222.154:38778 (172.22.222.154) >
>> a = []
=> []
>> exit
pry
[*] Starting Pry shell...
[*] You are in the "self" (session) object
[1] pry(#<Msf::Sessions::CommandShell>)> self
=> #<Session:shell 172.22.222.154:38778 (172.22.222.154) >
[2] pry(#<Msf::Sessions::CommandShell>)> self.methods
=> [:pushws,
:irb_push_binding,
:irb_pushb,
:pushb,
...
[3] pry(#<Msf::Sessions::CommandShell>)> exit
uname -a
Linux ubuntu 4.18.0-16-generic #17~18.04.1-Ubuntu SMP Tue Feb 12 13:35:51 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
whoami
msfdev
Release NotesThis adds the |
#10687, #11530