-
Notifications
You must be signed in to change notification settings - Fork 0
/
reavetard.js
108 lines (94 loc) · 3.32 KB
/
reavetard.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
(function() {
var cli, config, db, reaver, rtard, startReaver, targetReview, wash, washSurvey;
var _this = this;
rtard = require('commander');
cli = require('./cli');
db = require('./db');
wash = require('./wash');
reaver = require('./reaver');
config = require('./config');
washSurvey = function(scan) {
var rdb, stations, w;
if (scan == null) scan = true;
stations = {
complete: [],
inProgress: [],
noHistory: []
};
rdb = new db();
w = new wash({
interface: 'mon0',
scan: scan,
ignoreFCS: true
});
process.on('exit', function() {
return w.stop();
});
cli._c.on('^C', function() {
w.stop();
cli._c.display('reset');
return process.exit();
});
w.on('ap', function(station) {
return rdb.checkSurvey(station.bssid, function(err, rows) {
var device, k, v;
if (!err && rows.length > 0) {
device = {
name: rows[0].device_name,
manufacturer: rows[0].manufacturer,
model: rows[0].model_name,
number: rows[0].model_number
};
for (k in device) {
v = device[k];
if (v !== '') station.device = device;
}
}
return rdb.checkHistory(station.bssid, function(err, rows) {
var k, v, _ref, _ref2;
if (err) console.error(errd);
if (rows.length > 0) {
_ref = rows[0];
for (k in _ref) {
v = _ref[k];
if ((_ref2 = station[k]) == null) station[k] = v;
}
station.session = rdb.loadSession(station.bssid);
if (station.attempts >= 11000 || station.session.phase === 2) {
stations.complete.push(station);
return cli.washHit(station, 'C');
} else {
stations.inProgress.push(station);
return cli.washHit(station, 'W');
}
} else {
stations.noHistory.push(station);
return cli.washHit(station, 'N');
}
});
});
});
w.on('exit', function() {
console.log('wash process ended, beginning review');
return targetReview(stations);
});
w.on('error', function() {
return console.error("ERROR: " + arguments);
});
w.start();
cli.cwrite('magenta', ' Wash scan now in progress, waiting for AP data...\n').cwrite('blue', ' (Press enter when satisfied with results to continue)');
return rtard.prompt('\n', function(res) {
w.stop();
return console.log(res);
});
};
targetReview = function(stations) {};
startReaver = function(bssids) {};
rtard.version('0.0.1').option('-i, --interface <iface>', 'Choose WLAN interface [mon0]', 'mon0').option('-r, --reaver-path [path]', 'Set path to your reaver.db and session files', '/usr/local/etc/reaver/').option('-d, --rdb-file [filename]', 'Set the filename of your reaver database', 'reaver.db');
rtard.command('scan').description('Initiate an annotated wash survey').action(function() {
cli.clear().title().cwrite('blue', ' Scan command chosen. Initializing wash survey...\n');
return washSurvey();
});
rtard.command('crack <bssids>').description('Initiate reaver cracking session on one or more targets').action(startReaver);
rtard.parse(process.argv);
}).call(this);