Skip to content

Commit 398e6cb

Browse files
committed
Merge branch 'rsmudge-armitage'
2 parents 0ae473b + 596b62b commit 398e6cb

28 files changed

+766
-167
lines changed

data/armitage/armitage.jar

11.5 KB
Binary file not shown.

data/armitage/cortana.jar

11.5 KB
Binary file not shown.

data/armitage/whatsnew.txt

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

4+
12 Feb 13 (tested against msf 16438)
5+
---------
6+
- Fixed a corner case preventing the display of removed host labels
7+
when connected to a team server.
8+
- Fixed RPC call cache corruption in team server mode. This bug could
9+
lead to some exploits defaulting to a shell payload when meterpreter
10+
was a possibility.
11+
- Slight optimization to some DB queries. I no longer pull unused
12+
fields making the query marginally faster. Team server is more
13+
efficient too as changes to unused fields won't force data (re)sync.
14+
- Hosts -> Clear Database now clears host labels too.
15+
- Added the ability to manage multiple team server instances through
16+
Armitage. Go to Armitage -> New Connection to connect to another
17+
server. A button bar will appear that allows you to switch active
18+
Armitage connections.
19+
- Credentials available across instances are pooled when using
20+
the [host] -> Login menu and the credential helper.
21+
- Rewrote the event log management code in the team server
22+
- Added nickname tab completion to event log. I feel like I'm writing
23+
an IRC client again.
24+
- Hosts -> Clear Database now asks you to confirm the action.
25+
- Hosts -> Import Hosts announces successful import to event log again.
26+
427
23 Jan 13 (tested against msf 16351)
528
---------
629
- Added helpers to set EXE::Custom and EXE::Template options.

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: 23 Jan 13</p>
6+
<br />Release: 12 Feb 13</p>
77
<br />
88
<p>Developed by:</p>
99

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ import msf.*;
99

1010
# setg("varname", "value")
1111
sub setg {
12+
if ($1 eq "LHOST") {
13+
call_async("armitage.set_ip", $2);
14+
}
1215
cmd_safe("setg $1 $2");
1316
}
1417

external/source/armitage/scripts/armitage.sl

Lines changed: 12 additions & 12 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');
18+
global('$frame $tabs $menubar $msfrpc_handle $REMOTE $cortana $MY_ADDRESS $DESCRIBE @CLOSEME');
1919

2020
sub describeHost {
2121
local('$desc');
@@ -165,13 +165,19 @@ sub _connectToMetasploit {
165165
$aclient = [new RpcAsync: $client];
166166
$mclient = $client;
167167
initConsolePool();
168+
$DESCRIBE = "localhost";
168169
}
169170
# we have a team server... connect and authenticate to it.
170171
else {
171172
$client = c_client($1, $2);
172173
setField(^msf.MeterpreterSession, DEFAULT_WAIT => 20000L);
173174
$mclient = setup_collaboration($3, $4, $1, $2);
174175
$aclient = $mclient;
176+
177+
if ($mclient is $null) {
178+
[$progress close];
179+
return;
180+
}
175181
}
176182
$flag = $null;
177183
}
@@ -319,28 +325,23 @@ sub postSetup {
319325
}
320326

321327
sub main {
322-
local('$console $panel $dir');
328+
local('$console $panel $dir $app');
323329

324-
$frame = [new ArmitageApplication];
330+
$frame = [new ArmitageApplication: $__frame__, $DESCRIBE, $mclient];
325331
[$frame setTitle: $TITLE];
326-
[$frame setSize: 800, 600];
327-
332+
[$frame setIconImage: [ImageIO read: resource("resources/armitage-icon.gif")]];
328333
init_menus($frame);
329334
initLogSystem();
330335

331-
[$frame setIconImage: [ImageIO read: resource("resources/armitage-icon.gif")]];
332-
[$frame show];
333-
[$frame setExtendedState: [JFrame MAXIMIZED_BOTH]];
334-
335336
# this window listener is dead-lock waiting to happen. That's why we're adding it in a
336337
# separate thread (Sleep threads don't share data/locks).
337338
fork({
338-
[$frame addWindowListener: {
339+
[$__frame__ addWindowListener: {
339340
if ($0 eq "windowClosing" && $msfrpc_handle !is $null) {
340341
closef($msfrpc_handle);
341342
}
342343
}];
343-
}, \$msfrpc_handle, \$frame);
344+
}, \$msfrpc_handle, \$__frame__);
344345

345346
dispatchEvent({
346347
if ($client !is $mclient) {
@@ -371,7 +372,6 @@ sub checkDir {
371372
}
372373
}
373374

374-
setLookAndFeel();
375375
checkDir();
376376

377377
if ($CLIENT_CONFIG !is $null && -exists $CLIENT_CONFIG) {

external/source/armitage/scripts/collaborate.sl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ sub createEventLogTab {
2323
$client = [$cortana getEventLog: $console];
2424
[$client setEcho: $null];
2525
[$console updatePrompt: "> "];
26+
[new EventLogTabCompletion: $console, $mclient];
2627
}
2728
else {
2829
[$console updateProperties: $preferences];
@@ -63,6 +64,7 @@ sub c_client {
6364
# run this thing in its own thread to avoid really stupid deadlock situations
6465
local('$handle');
6566
$handle = [[new SecureSocket: $1, int($2), &verify_server] client];
67+
push(@CLOSEME, $handle);
6668
return wait(fork({
6769
local('$client');
6870
$client = newInstance(^RpcConnection, lambda({
@@ -91,9 +93,11 @@ sub setup_collaboration {
9193
%r = call($mclient, "armitage.validate", $1, $2, $nick, "armitage", 120326);
9294
if (%r["error"] eq "1") {
9395
showErrorAndQuit(%r["message"]);
96+
return $null;
9497
}
9598

9699
%r = call($client, "armitage.validate", $1, $2, $null, "armitage", 120326);
100+
$DESCRIBE = "$nick $+ @ $+ $3";
97101
return $mclient;
98102
}
99103

external/source/armitage/scripts/gui.sl

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ sub dispatchEvent {
9595

9696
sub showError {
9797
dispatchEvent(lambda({
98-
[JOptionPane showMessageDialog: $frame, $message];
98+
[JOptionPane showMessageDialog: $__frame__, $message];
9999
}, $message => $1));
100100
}
101101

102102
sub showErrorAndQuit {
103-
[JOptionPane showMessageDialog: $frame, $1];
104-
[System exit: 0];
103+
[JOptionPane showMessageDialog: $__frame__, $1];
104+
[$__frame__ closeConnect];
105105
}
106106

107107
sub ask {
@@ -155,7 +155,7 @@ sub chooseFile {
155155
[$fc setFileSelectionMode: [JFileChooser DIRECTORIES_ONLY]];
156156
}
157157

158-
[$fc showOpenDialog: $frame];
158+
[$fc showOpenDialog: $__frame__];
159159

160160
if ($multi) {
161161
return [$fc getSelectedFiles];
@@ -179,17 +179,18 @@ sub saveFile2 {
179179
[$fc setSelectedFile: [new java.io.File: $sel]];
180180
}
181181

182-
[$fc showSaveDialog: $frame];
183-
$file = [$fc getSelectedFile];
184-
if ($file !is $null) {
185-
return $file;
182+
if ([$fc showSaveDialog: $__frame__] == 0) {
183+
$file = [$fc getSelectedFile];
184+
if ($file !is $null) {
185+
return $file;
186+
}
186187
}
187188
}
188189

189190
sub saveFile {
190191
local('$fc $file');
191192
$fc = [new JFileChooser];
192-
[$fc showSaveDialog: $frame];
193+
[$fc showSaveDialog: $__frame__];
193194
$file = [$fc getSelectedFile];
194195
if ($file !is $null) {
195196
local('$ihandle $data $ohandle');
@@ -250,18 +251,26 @@ sub left {
250251

251252
sub dialog {
252253
local('$dialog $4');
253-
$dialog = [new JDialog: $frame, $1];
254+
$dialog = [new JDialog: $__frame__, $1];
254255
[$dialog setSize: $2, $3];
255256
[$dialog setLayout: [new BorderLayout]];
256-
[$dialog setLocationRelativeTo: $frame];
257+
[$dialog setLocationRelativeTo: $__frame__];
257258
return $dialog;
258259
}
259260

260261
sub window {
261262
local('$dialog $4');
262263
$dialog = [new JFrame: $1];
263264
[$dialog setIconImage: [ImageIO read: resource("resources/armitage-icon.gif")]];
264-
[$dialog setDefaultCloseOperation: [JFrame EXIT_ON_CLOSE]];
265+
266+
fork({
267+
[$dialog addWindowListener: {
268+
if ($0 eq "windowClosing") {
269+
[$__frame__ closeConnect];
270+
}
271+
}];
272+
}, \$__frame__, \$dialog);
273+
265274
[$dialog setSize: $2, $3];
266275
[$dialog setLayout: [new BorderLayout]];
267276
return $dialog;
@@ -277,12 +286,14 @@ sub overlay_images {
277286
return %cache[join(';', $1)];
278287
}
279288

280-
local('$file $image $buffered $graphics');
289+
local('$file $image $buffered $graphics $resource');
281290

282291
$buffered = [new BufferedImage: 1000, 776, [BufferedImage TYPE_INT_ARGB]];
283292
$graphics = [$buffered createGraphics];
284293
foreach $file ($1) {
285-
$image = [ImageIO read: resource($file)];
294+
$resource = resource($file);
295+
$image = [ImageIO read: $resource];
296+
closef($resource);
286297
[$graphics drawImage: $image, 0, 0, 1000, 776, $null];
287298
}
288299

@@ -371,15 +382,6 @@ sub wrapComponent {
371382
return $panel;
372383
}
373384

374-
sub setLookAndFeel {
375-
local('$laf');
376-
foreach $laf ([UIManager getInstalledLookAndFeels]) {
377-
if ([$laf getName] eq [$preferences getProperty: "application.skin.skin", "Nimbus"]) {
378-
[UIManager setLookAndFeel: [$laf getClassName]];
379-
}
380-
}
381-
}
382-
383385
sub thread {
384386
local('$thread');
385387
$thread = [new ArmitageThread: $1];
@@ -467,6 +469,13 @@ sub quickListDialog {
467469
[$dialog setVisible: 1];
468470
}
469471

472+
sub setTableColumnWidths {
473+
local('$col $width $temp');
474+
foreach $col => $width ($2) {
475+
[[$1 getColumn: $col] setPreferredWidth: $width];
476+
}
477+
}
478+
470479
sub tableRenderer {
471480
return [ATable getDefaultTableRenderer: $1, $2];
472481
}

external/source/armitage/scripts/hosts.sl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import java.awt.event.*;
88

99
sub addHostDialog {
1010
local('$dialog $label $text $finish $button');
11-
$dialog = [new JDialog: $frame, "Add Hosts", 0];
11+
$dialog = [new JDialog: $__frame__, "Add Hosts", 0];
1212
[$dialog setSize: 320, 240];
1313
[$dialog setLayout: [new BorderLayout]];
14-
[$dialog setLocationRelativeTo: $frame];
14+
[$dialog setLocationRelativeTo: $__frame__];
1515

1616
$label = [new JLabel: "Enter one host/line:"];
1717
$text = [new JTextArea];

external/source/armitage/scripts/log.sl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ sub logNow {
1515
if ([$preferences getProperty: "armitage.log_everything.boolean", "true"] eq "true") {
1616
local('$today $stream');
1717
$today = formatDate("yyMMdd");
18-
mkdir(getFileProper(dataDirectory(), $today, $2));
19-
$stream = %logs[ getFileProper(dataDirectory(), $today, $2, "$1 $+ .log") ];
18+
mkdir(getFileProper(dataDirectory(), $today, $DESCRIBE, $2));
19+
$stream = %logs[ getFileProper(dataDirectory(), $today, $DESCRIBE, $2, "$1 $+ .log") ];
2020
[$stream println: $3];
2121
}
2222
}
@@ -26,8 +26,8 @@ sub logCheck {
2626
local('$today');
2727
$today = formatDate("yyMMdd");
2828
if ($2 ne "") {
29-
mkdir(getFileProper(dataDirectory(), $today, $2));
30-
[$1 writeToLog: %logs[ getFileProper(dataDirectory(), $today, $2, "$3 $+ .log") ]];
29+
mkdir(getFileProper(dataDirectory(), $today, $DESCRIBE, $2));
30+
[$1 writeToLog: %logs[ getFileProper(dataDirectory(), $today, $DESCRIBE, $2, "$3 $+ .log") ]];
3131
}
3232
}
3333
}
@@ -38,15 +38,15 @@ sub logFile {
3838
local('$today $handle $data $out');
3939
$today = formatDate("yyMMdd");
4040
if (-exists $1 && -canread $1) {
41-
mkdir(getFileProper(dataDirectory(), $today, $2, $3));
41+
mkdir(getFileProper(dataDirectory(), $today, $DESCRIBE, $2, $3));
4242

4343
# read in the file
4444
$handle = openf($1);
4545
$data = readb($handle, -1);
4646
closef($handle);
4747

4848
# write it out.
49-
$out = getFileProper(dataDirectory(), $today, $2, $3, getFileName($1));
49+
$out = getFileProper(dataDirectory(), $today, $DESCRIBE, $2, $3, getFileName($1));
5050
$handle = openf("> $+ $out");
5151
writeb($handle, $data);
5252
closef($handle);
@@ -70,7 +70,7 @@ sub initLogSystem {
7070
logFile([$file getAbsolutePath], "screenshots", ".");
7171
deleteFile([$file getAbsolutePath]);
7272

73-
showError("Saved " . getFileName($file) . "\nGo to View -> Reporting -> Activity Logs\n\nThe file is in:\n[today's date]/screenshots");
73+
showError("Saved " . getFileName($file) . "\nGo to View -> Reporting -> Activity Logs\n\nThe file is in:\n[today's date]/ $+ $DESCRIBE $+ /screenshots");
7474
}, \$image, \$title));
7575
}];
7676
}

0 commit comments

Comments
 (0)