Mostly working setdesktop code, removed grabdesktop

git-svn-id: file:///home/svn/framework3/trunk@6393 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-03-25 23:14:14 +00:00
parent aae66a4cb3
commit 89ecdd9ac8
4 changed files with 42 additions and 5 deletions

View File

@ -132,6 +132,7 @@ TLV_TYPE_REGISTER = TLV_META_TYPE_GROUP | 2550
##
TLV_TYPE_IDLE_TIME = TLV_META_TYPE_UINT | 3000
TLV_TYPE_KEYS_DUMP = TLV_META_TYPE_STRING | 3001
TLV_TYPE_DESKTOP = TLV_META_TYPE_STRING | 3002
##
#

View File

@ -117,11 +117,22 @@ class UI < Rex::Post::UI
#
def set_desktop(name="WinSta0\\Default")
request = Packet.create_request('stdapi_ui_set_desktop')
request.add_tlv(TLV_TYPE_STRING, name)
request.add_tlv(TLV_TYPE_DESKTOP, name)
response = client.send_request(request)
return true
end
#
# Unlock or lock the desktop
#
def unlock_desktop(unlock=true)
request = Packet.create_request('stdapi_ui_unlock_desktop')
request.add_tlv(TLV_TYPE_BOOL, unlock)
response = client.send_request(request)
return true
end
#
# Start the keyboard sniffer
#

View File

@ -23,12 +23,17 @@ class Console::CommandDispatcher::Stdapi::Ui
{
"idletime" => "Returns the number of seconds the remote user has been idle",
"uictl" => "Control some of the user interface components",
"grabinputdesktop" => "Take over the active input desktop",
"enumdesktops" => "List all accessible desktops and window stations",
"setdesktop" => "Move to a different workstation and desktop",
"keyscan_start" => "Start capturing keystrokes",
"keyscan_stop" => "Stop capturing keystrokes",
"keyscan_dump" => "Dump they keystroke buffer"
"keyscan_dump" => "Dump they keystroke buffer",
# no longer needed with setdesktop
# "grabinputdesktop" => "Take over the active input desktop",
# not working yet
# "unlockdesktop" => "Unlock or lock the workstation (must be inside winlogon.exe)",
}
end
@ -120,11 +125,31 @@ class Console::CommandDispatcher::Stdapi::Ui
return
end
print_line("Changing to desktop #{args[0]})")
print_line("Changing to desktop #{args[0]}")
client.ui.set_desktop(*args)
return true
end
#
# Unlock or lock the desktop
#
def cmd_unlockdesktop(*args)
mode = 0
if(args.length > 0)
mode = args[0].to_i
end
if(mode == 0)
print_line("Unlocking the workstation...")
client.ui.unlock_desktop(true)
else
print_line("Locking the workstation...")
client.ui.unlock_desktop(false)
end
return true
end
#
# Start the keyboard sniffer
#