From 83fa1efe0d6c73669f61987627a30e2710c64bc9 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Tue, 9 Jun 2015 19:17:19 +0000 Subject: [PATCH] Add '/api/server/bind' example --- tools/rest_api_examples/lib/beef_rest_api.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/rest_api_examples/lib/beef_rest_api.rb b/tools/rest_api_examples/lib/beef_rest_api.rb index 33b021a8f..f6fb9f951 100644 --- a/tools/rest_api_examples/lib/beef_rest_api.rb +++ b/tools/rest_api_examples/lib/beef_rest_api.rb @@ -344,4 +344,23 @@ def webrtc_status id end end +################################################################################ +### Social Engineering +################################################################################ + +# bind dropper to path +def bind(fname, path) + print_verbose "Binding 'extensions/social_engineering/droppers/#{fname}' to '#{path}'" + begin + response = RestClient.post "#{@url}/server/bind?token=#{@token}", + { 'mount' => "#{path}", + 'local_file' => "#{fname}" }.to_json, + :content_type => :json, + :accept => :json + print_good "Bound '#{fname}' successfully" if response.code == 200 + rescue => e + print_error "Could not bind file #{fname}: #{e.message}" + end +end + end