Underc0de

Programación Scripting => Otros lenguajes Scripting => Mensaje iniciado por: 79137913 en Febrero 25, 2016, 01:07:17 PM

Título: [VBS] ScreenShot Proof Of Concept.
Publicado por: 79137913 en Febrero 25, 2016, 01:07:17 PM
HOLA!!!

Antes que nada aclaro que esto es un proof of concept.

Ya que se ve en la pc cuando el programa captura la pantalla.

Código (vb) [Seleccionar]
    'HECHO POR 79137913
    'FUNCIONA SOLO SI LA PC POSEE FIREFOX (CREO QUE TAMBIEN SE PODRIA HACER CON CHROME CAMBIANDO LA LINEA DONDE DICE "FIREFOX.EXE" POR "CHROME.EXE")
     
    Call ScreenShot("C:\Users\user\Desktop\web.html","C:\Users\user\Desktop\a.html")
     
    Function ScreenShot(WebUrl, Output)
        With CreateObject("Word.Basic")
            .SendKeys "{1068}"
        End With
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.CreateTextFile(WebUrl, True)
        objFile.Write "<script>function handlepaste () {myimage = ImageGrab.grabclipboard();}</script><body onload='handlepaste()'></body><div id='div' contenteditable='true' onpaste='handlepaste()'>Paste</div>" & vbCrLf
        objFile.Close
        On Error Resume Next
            CreateObject("Scripting.FileSystemObject").DeleteFile "c:\a.html"
        On Error GoTo 0
        Set wshshell = wscript.CreateObject("WScript.Shell")
        'antes de aca se podria poner una instruccion para que cerrara el proceso del Firefox
            wshshell.run "firefox.exe -Height 1 -Width 1 " & WebUrl 'Abre firefox en tamaño 1x1
                wscript.sleep 2000
            wshshell.SendKeys ("{TAB}") 'entra a la web
                wscript.sleep 300
            wshshell.SendKeys ("+{INSERT}") 'pega el screenshot
                wscript.sleep 1000
            wshshell.SendKeys ("^s") 'guarda la pagina
                wscript.sleep 100
            wshshell.SendKeys (Output) 'pone el path
                wscript.sleep 500
            wshshell.SendKeys ("{ENTER}") 'confirma el guardado
            wshshell.SendKeys ("{ENTER}") 'confirma el guardado
        'aca se podria matar a la ventana del firefox abierta para no dejar rastos.
    End Function


En los path de ScreenShot en caso que de acceso denegado pongan un path como Escritorio o mis documentos.

El screenshot sera guardado en a.html

GRACIAS POR LEER!!!
Título: Re:[VBS] ScreenShot Proof Of Concept.
Publicado por: blackdrake en Febrero 26, 2016, 04:06:39 PM
Muy bueno!

Y con iexplore.exeserviría? Pues lo traen todos por defecto.

Saludos.