Skip to content

Commit 1b8371e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into bug/web-vuln-logging
2 parents c3b3da4 + e1859ae commit 1b8371e

File tree

20 files changed

+405
-42
lines changed

20 files changed

+405
-42
lines changed

data/armitage/armitage.jar

7.57 KB
Binary file not shown.

data/armitage/cortana.jar

7.57 KB
Binary file not shown.

data/armitage/whatsnew.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
Armitage Changelog
22
==================
33

4+
6 Mar 13 (tested against msf ca43900a7)
5+
--------
6+
- Active console now gets higher priority when polling msf for output
7+
- Improved team server responsiveness in high latency situations by
8+
creating additional connections to server to balance messages over
9+
- Preferences are now shared among each Armitage connection.
10+
11+
6 Mar 13 (2000h)
12+
--------
13+
- Fixed issue with additional team server connections reporting wrong
14+
application and receiving a summary rejection by the team server.
15+
16+
Cortana Updates (for scripters)
17+
--------
18+
- Added a &publish, &query, &subscribe API to allow inter-script
19+
communication across the team server.
20+
- Added &table_update to set the contents of a table tab without
21+
disturbing the highlighted rows.
22+
- Added an exec_error event. Fired when &m_exec or &m_exec_local fail
23+
due to an error reported by meterpreter.
24+
- Fixed a bug that sometimes caused session_sync to fire twice (boo!)
25+
- Added a 60s timeout to &s_cmd commands. Cortana will give a shell
26+
command 60s to execute. If it doesn't finish in that time, Cortana
27+
will release the lock on the shell so the user can control it.
28+
(ideally, this shouldn't happen... this is a safety mechanism)
29+
- Changed Meterpreter command timeout to 2m from 12s. This is because
30+
https meterpreter might not checkin for up to 60s, if it's been
31+
idle for a long time. This will make &m_cmd less likely to timeout
32+
433
12 Feb 13 (tested against msf 16438)
534
---------
635
- Fixed a corner case preventing the display of removed host labels

external/source/armitage/resources/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<center><h1>Armitage 1.45</h1></center>
44

55
<p>An attack management tool for Metasploit&reg;
6-
<br />Release: 12 Feb 13</p>
6+
<br />Release: 6 Mar 13</p>
77
<br />
88
<p>Developed by:</p>
99

external/source/armitage/scripts-cortana/internal-ui.sl

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,24 @@ sub table_selected_single {
188188

189189
# table_set($table, @rows)
190190
sub table_set {
191-
local('$model $row');
192-
$model = [$1 getModel];
193-
[$model clear: size($2) * 2];
194-
foreach $row ($2) {
195-
[$model addEntry: $row];
196-
}
197-
[$model fireListeners];
191+
later(lambda({
192+
local('$model $row');
193+
$model = [$a getModel];
194+
[$model clear: size($b) * 2];
195+
foreach $row ($b) {
196+
[$model addEntry: $row];
197+
}
198+
[$model fireListeners];
199+
}, $a => $1, $b => $2));
200+
}
201+
202+
# table_set($table, @rows)
203+
sub table_update {
204+
later(lambda({
205+
[$a markSelections];
206+
table_set($a, $b);
207+
[$a restoreSelections];
208+
}, $a => $1, $b => $2));
198209
}
199210

200211
# table_sorter($table, index, &function);

external/source/armitage/scripts-cortana/internal.sl

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,6 +583,39 @@ sub data_add {
583583
call("db.key_add", $1, $data);
584584
}
585585

586+
#
587+
# a publish/query/subscribe API
588+
#
589+
590+
# publish("key", $object)
591+
sub publish {
592+
local('$data');
593+
$data = [msf.Base64 encode: cast(pack("o", $2, 1), 'b')];
594+
call_async("armitage.publish", $1, "$data $+ \n");
595+
}
596+
597+
# query("key", "index")
598+
sub query {
599+
local('$r @r $result');
600+
$r = call("armitage.query", $1, $2)['data'];
601+
if ($r ne "") {
602+
foreach $result (split("\n", $r)) {
603+
push(@r, unpack("o", [msf.Base64 decode: $result])[0]);
604+
}
605+
}
606+
return @r;
607+
}
608+
609+
# subscribe("key", "index", "1s/5s/10s/15s/30s/1m/5m/10m/15m/20m/30m/60m")
610+
sub subscribe {
611+
on("heartbeat_ $+ $3", lambda({
612+
local('$result');
613+
foreach $result (query($key, $index)) {
614+
fire_event_local($key, $result, $index);
615+
}
616+
}, $key => $1, $index => $2));
617+
}
618+
586619
#
587620
# Shell shock?
588621
#
@@ -834,7 +867,7 @@ sub m_exec {
834867
}, \$command, \$channel, \$buffer));
835868
}
836869
else {
837-
# this is probably ok...
870+
fire_event_local("exec_error", $1, $command, ["$3" trim]);
838871
}
839872
}, \$command));
840873
}

external/source/armitage/scripts/armitage.sl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import graph.*;
1515

1616
import java.awt.image.*;
1717

18-
global('$frame $tabs $menubar $msfrpc_handle $REMOTE $cortana $MY_ADDRESS $DESCRIBE @CLOSEME');
18+
global('$frame $tabs $menubar $msfrpc_handle $REMOTE $cortana $MY_ADDRESS $DESCRIBE @CLOSEME @POOL');
1919

2020
sub describeHost {
2121
local('$desc');
@@ -164,20 +164,32 @@ sub _connectToMetasploit {
164164
$client = [new MsgRpcImpl: $3, $4, $1, long($2), $null, $debug];
165165
$aclient = [new RpcAsync: $client];
166166
$mclient = $client;
167+
push(@POOL, $aclient);
167168
initConsolePool();
168169
$DESCRIBE = "localhost";
169170
}
170171
# we have a team server... connect and authenticate to it.
171172
else {
173+
[$progress setNote: "Connected: logging in"];
172174
$client = c_client($1, $2);
173-
setField(^msf.MeterpreterSession, DEFAULT_WAIT => 20000L);
174175
$mclient = setup_collaboration($3, $4, $1, $2);
175176
$aclient = $mclient;
176177

177178
if ($mclient is $null) {
178179
[$progress close];
179180
return;
180181
}
182+
else {
183+
[$progress setNote: "Connected: authenticated"];
184+
}
185+
186+
# create six additional connections to team server... for balancing consoles.
187+
local('$x $cc');
188+
for ($x = 0; $x < 6; $x++) {
189+
$cc = c_client($1, $2);
190+
call($cc, "armitage.validate", $3, $4, $null, "armitage", 120326);
191+
push(@POOL, $cc);
192+
}
181193
}
182194
$flag = $null;
183195
}

external/source/armitage/scripts/preferences.sl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,21 @@ sub parseYaml {
5757
sub loadPreferences {
5858
local('$file $prefs');
5959
$file = getFileProper(systemProperties()["user.home"], ".armitage.prop");
60-
$prefs = [new Properties];
61-
if (-exists $file) {
62-
[$prefs load: [new java.io.FileInputStream: $file]];
60+
if ($__frame__ !is $null && [$__frame__ getPreferences] !is $null) {
61+
$prefs = [$__frame__ getPreferences];
6362
}
6463
else {
65-
[$prefs load: resource("resources/armitage.prop")];
64+
$prefs = [new Properties];
65+
if (-exists $file) {
66+
[$prefs load: [new java.io.FileInputStream: $file]];
67+
}
68+
else {
69+
[$prefs load: resource("resources/armitage.prop")];
70+
}
71+
72+
if ($__frame__ !is $null) {
73+
[$__frame__ setPreferences: $prefs];
74+
}
6675
}
6776

6877
# parse command line options here.

external/source/armitage/scripts/shell.sl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ sub createShellSessionTab {
290290
return;
291291
}
292292

293-
$thread = [new ConsoleClient: $console, $client, "session.shell_read", "session.shell_write", $null, $sid, 0];
293+
$thread = [new ConsoleClient: $console, rand(@POOL), "session.shell_read", "session.shell_write", $null, $sid, 0];
294294
[$frame addTab: "Shell $sid", $console, lambda({
295295
call_async($mclient, "armitage.unlock", $sid);
296296
[$thread kill];

external/source/armitage/scripts/util.sl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ sub setupEventStyle {
7878

7979
sub createDisplayTab {
8080
local('$console $host $queue $file');
81-
$queue = [new ConsoleQueue: $client];
81+
$queue = [new ConsoleQueue: rand(@POOL)];
8282
if ($1 eq "Log Keystrokes") {
8383
$console = [new ActivityConsole: $preferences];
8484
}
@@ -100,7 +100,7 @@ sub createConsolePanel {
100100
setupConsoleStyle($console);
101101

102102
$result = call($client, "console.create");
103-
$thread = [new ConsoleClient: $console, $aclient, "console.read", "console.write", "console.destroy", $result['id'], $1];
103+
$thread = [new ConsoleClient: $console, rand(@POOL), "console.read", "console.write", "console.destroy", $result['id'], $1];
104104
[$thread setMetasploitConsole];
105105

106106
[$thread setSessionListener: {

0 commit comments

Comments
 (0)