answerer's interface gets a makeover

bug/bundler_fix
sinn3r 2014-02-11 02:15:22 -06:00
parent fdd696fc31
commit 2bb15d3a87
2 changed files with 184 additions and 99 deletions

View File

@ -1,18 +1,77 @@
<!DOCTYPE html>
<html>
<head>
<script src="=WEBRTCAPIJS="> </script>
</head>
<body>
<div id="info">
<pre>
Target IP : =RHOST=
Start Time : =STARTTIME=
Status : <span id="message">Please wait for the broadcast. You need to allow your webcam to run in order to join the video session.</span>
</pre>
</div>
<div id="chat_area"></div>
<a href="http://metasploit.com/" target="_blank">Metasploit.com</a>
<script>
<title>webcam_chat</title>
<style type="text/css">
div.container {
position: relative;
}
div.windowa {
height: 480px;
width: 640px;
border-radius: 15px;
-moz-border-raidus: 15px;
background-color: black;
position: absolute;
left: 50;
padding : 10px;
margin-left: auto;
margin-right: auto;
text-align: center;
vertical-align: middle;
color: white;
}
div.windowb {
height: 180px;
width: 200px;
border-radius: 15px;
-moz-border-raidus: 15px;
background-color: #9B9B9B;
position: absolute;
top: 480;
left: 470;
padding: 10px;
margin-left: auto;
margin-right: auto;
text-align: center;
vertical-align: middle;
}
div.windowc {
position: absolute;
top: 510;
left: 80;
height: 150px;
width: 380px;
color: red;
}
div.footer {
position: fixed;
bottom: 0;
width: 100%;
padding: 10px;
}
video.peer {
position: absolute;
top: 15;
left: 10;
}
video.self {
position: absolute;
top: 5;
left: 10;
}
</style>
<script src="=WEBRTCAPIJS="> </script>
<script>
window.onload = function() {
document.getElementById("message").innerHTML = "Waiting for the session. When the session arrives, you must manually allow the webcam to run in order to join the session."
}
var channel = '=CHANNEL=';
var websocket = new WebSocket('ws://wsnodejs.jit.su:80');
var inSession = false;
@ -43,7 +102,6 @@ Status : <span id="message">Please wait for the broadcast. You need to allow
getUserMedia(function(stream) {
peer.addStream(stream);
console.debug("Joining: " + userid);
peer.sendParticipationRequest(userid);
inSession = true;
document.getElementById("message").innerHTML = "Session is now active.";
@ -52,11 +110,24 @@ Status : <span id="message">Please wait for the broadcast. You need to allow
peer.onStreamAdded = function(e) {
var video = e.mediaElement;
if (e.userid == 'self') {
video.controls = true;
video.setAttribute('width', 200);
video.setAttribute('height', 190);
video.setAttribute('controls', false);
video.setAttribute('class', 'self');
document.getElementById("windowb").appendChild(video);
}
else {
video.controls = true;
video.setAttribute('width', 640);
video.setAttribute('height', 480);
video.setAttribute('controls', true);
video.setAttribute('height', 460);
video.setAttribute('controls', false);
video.setAttribute('class', 'peer');
document.getElementById("windowa").appendChild(video);
}
video.muted = false;
video.volume = 0.5;
document.getElementById("chat_area").appendChild(video);
video.play();
};
@ -72,6 +143,7 @@ Status : <span id="message">Please wait for the broadcast. You need to allow
};
function getUserMedia(callback) {
var hints = {audio:true,video:{
optional: [],
mandatory: {
@ -86,8 +158,6 @@ Status : <span id="message">Please wait for the broadcast. You need to allow
navigator.getUserMedia(hints,function(stream) {
var video = document.createElement('video');
video.src = URL.createObjectURL(stream);
video.controls = true;
video.muted = false;
peer.onStreamAdded({
mediaElement: video,
@ -98,6 +168,22 @@ Status : <span id="message">Please wait for the broadcast. You need to allow
callback(stream);
});
}
</script>
</script>
</head>
<body>
<div class="container">
<div class="windowa" id="windowa">
</div>
<div class="windowb" id="windowb">
</div>
<div class="windowc">
<b>Session status (=RHOST=):</b><p></p>
<span id="message"></span>
</div>
</div>
<div class="footer">
<center><a href="http://metasploit.com/" target="_blank">metasploit.com</a></center>
</div>
</body>
</html>

View File

@ -206,7 +206,6 @@ class Webcam
interface = interface.gsub(/\=WEBRTCAPIJS\=/, tmp_api.path)
interface = interface.gsub(/\=RHOST\=/, rhost)
interface = interface.gsub(/\=STARTTIME\=/, Time.now.to_s)
interface = interface.gsub(/\=CHANNEL\=/, channel)
interface = interface.gsub(/\=OFFERERID\=/, offerer_id)