07.01.2013 Views

Cortana Tutorial - Armitage

Cortana Tutorial - Armitage

Cortana Tutorial - Armitage

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Some popup menus are created with arguments. You may access these arguments through<br />

the array @_ or $1 ... $n. When a popup has arguments, its arguments propagate to any<br />

children menu and item blocks. Here's an example of a menu attached to a Meterpreter<br />

session.<br />

popup meterpreter_bottom {<br />

menu "&Annoy User" {<br />

item "&Enable Keyboard/Mouse" {<br />

m_cmd($1, "uictl enable keyboard");<br />

m_cmd($1, "uictl enable mouse");<br />

}<br />

}<br />

}<br />

item "&Disable Keyboard/Mouse" {<br />

m_cmd($1, "uictl disable keyboard");<br />

m_cmd($1, "uictl disable mouse");<br />

}<br />

The above example adds an Annoy User menu to the Meterpreter menu displayed by<br />

<strong>Armitage</strong>. Meterpreter menus propagate the session id as an argument. When the Enable<br />

Keyword/Mouse item is triggered, the session id $1 is available to it.<br />

You may use &show_menu and its variations to build a menu from popup constructs<br />

declared in any loaded scripts. When you call this function, you have the opportunity to set<br />

the arguments that are propagated to the child menus.<br />

Through <strong>Cortana</strong>, you also have the opportunity to create new menus in the top-­‐level<br />

menubar of <strong>Armitage</strong>. Use the &menubar function to set these up. By default, all new<br />

menus will go to the right of existing menus and show up to the left of the Help menu.<br />

menubar("Web Tools", "webstuff", 2);<br />

The above example creates a Web Tools menu located before the Help and Workspaces<br />

menu. Scripts may add menus to it by defining a popup for the webstuff hook.<br />

Built-­‐in Dialogs<br />

<strong>Cortana</strong> provides several functions to use dialogs already defined in <strong>Armitage</strong>. The<br />

&show_message function displays a message to the user.<br />

The &prompt_text function asks the user to answer a question. The &prompt_confirm<br />

function is like &prompt_text except the only options are yes or no.<br />

$answer = prompt_text("What is your favorite icecream?");<br />

if ($answer !is $null) {<br />

show_message("Mine too!");<br />

}<br />

&prompt_file_open is available to show a file open dialog. And &prompt_file_save is<br />

available to show a file save dialog.<br />

27

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!