metasploit-framework/data/webcam/answerer.html

104 lines
2.4 KiB
HTML
Raw Normal View History

2014-02-06 16:44:24 +00:00
<!DOCTYPE html>
<head>
2014-02-08 04:17:42 +00:00
<script src="=WEBRTCAPIJS="> </script>
2014-02-06 16:44:24 +00:00
</head>
<body>
2014-02-08 23:28:15 +00:00
<div id="info">
<pre>
Target IP : =RHOST=
Start Time : =STARTTIME=
2014-02-10 20:59:44 +00:00
Status : <span id="message">Please wait for the broadcast...</span>
2014-02-08 23:28:15 +00:00
</pre>
2014-02-08 09:53:49 +00:00
</div>
2014-02-08 04:17:42 +00:00
<div id="chat_area"></div>
<a href="http://metasploit.com/" target="_blank">Metasploit.com</a>
2014-02-06 16:44:24 +00:00
<script>
2014-02-09 01:36:33 +00:00
var channel = '=CHANNEL=';
2014-02-06 16:44:24 +00:00
var websocket = new WebSocket('ws://wsnodejs.jit.su:80');
2014-02-08 21:41:44 +00:00
var inSession = false;
2014-02-06 16:44:24 +00:00
websocket.onopen = function() {
websocket.push(JSON.stringify({
open: true,
channel: channel
}));
};
websocket.push = websocket.send;
websocket.send = function(data) {
websocket.push(JSON.stringify({
data: data,
channel: channel
}));
};
var peer = new PeerConnection(websocket);
peer.onUserFound = function(userid) {
2014-02-08 21:41:44 +00:00
if (inSession) {
console.debug("Already in session, will not send another participation request");
return;
};
userid = "=OFFERERID=";
2014-02-06 16:44:24 +00:00
getUserMedia(function(stream) {
peer.addStream(stream);
console.debug("Joining: " + userid);
2014-02-06 16:44:24 +00:00
peer.sendParticipationRequest(userid);
2014-02-08 21:41:44 +00:00
inSession = true;
2014-02-08 23:28:15 +00:00
document.getElementById("message").innerHTML = "Session is now active.";
2014-02-06 16:44:24 +00:00
});
};
peer.onStreamAdded = function(e) {
var video = e.mediaElement;
2014-02-09 01:56:43 +00:00
video.setAttribute('width', 640);
video.setAttribute('height', 480);
2014-02-06 16:44:24 +00:00
video.setAttribute('controls', true);
2014-02-09 01:56:43 +00:00
video.volume = 0.5;
2014-02-08 04:17:42 +00:00
document.getElementById("chat_area").appendChild(video);
2014-02-06 16:44:24 +00:00
video.play();
};
peer.onStreamEnded = function(e) {
var video = e.mediaElement;
if (video) {
video.style.opacity = 0;
setTimeout(function() {
video.parentNode.removeChild(video);
}, 1000);
}
2014-02-08 21:41:44 +00:00
document.getElementById("message").innerHTML = "The video session has ended.";
2014-02-06 16:44:24 +00:00
};
function getUserMedia(callback) {
var hints = {audio:true,video:{
optional: [],
mandatory: {
minWidth: 1280,
minHeight: 720,
maxWidth: 1920,
maxHeight: 1080,
minAspectRatio: 1.77
}
}};
navigator.getUserMedia(hints,function(stream) {
var video = document.createElement('video');
video.src = URL.createObjectURL(stream);
video.controls = true;
2014-02-07 17:25:20 +00:00
video.muted = false;
2014-02-06 16:44:24 +00:00
peer.onStreamAdded({
mediaElement: video,
userid: 'self',
stream: stream
});
callback(stream);
});
}
</script>
</body>
</html>