Add '/api/server/bind' example

This commit is contained in:
Brendan Coles
2015-06-09 19:17:19 +00:00
parent 03ecd61781
commit 83fa1efe0d

View File

@@ -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