-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsmtp.js
59 lines (47 loc) · 1002 Bytes
/
smtp.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
#!/usr/bin/env node
// by @sha0coder
(function(args) {
var smtp = {
host: '',
port: 25,
nodes: 2,
queue: [],
net: require('net')
};
smtp.start = function(n) {
this.nodes = n;
for (i=0; i<n; i++) {
smtp.node(i);
}
}
smtp.node = function(n) {
var client = smtp.net.connect({host:smtp.host, port:smtp.port}, function() {
console.log('%d connected.',n);
});
client.on('data', function(data) {
console.log('data: %s',data.toString());
if (smtp.queue.length>0) {
var w = smtp.queue.pop();
console.log('>>%s',w);
client.write('VRFY '+w+'\n');
} else
client.write('quit\n');
return;
});
}
smtp.check = function(w) {
console.log('checking %s',w);
}
function main(wordlist,host) {
smtp.host = host;
var lineReader = require('line-reader');
lineReader.eachLine(wordlist, function(line, last) {
if (last) {
smtp.start(2);
} else {
smtp.queue.push(line);
}
});
}
main(args[2],args[3]);
})(process.argv);