lorenkinzel Posted April 20, 2011 Share Posted April 20, 2011 I use this simple script to keep track of where I've been while virus-hunting so I can report the infected site to Google webmaster. expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> $Form1 = GUICreate("Site Log", 145, 110, 192, 124, -1, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW, $WS_EX_ACCEPTFILES)) $gobutton = GUICtrlCreateButton("GO--1.5 sec.", 13, 8, 120, 49) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") $loggerbutton = GUICtrlCreateButton("logger", 13, 59, 57, 20) $iebutton = GUICtrlCreateButton("IE on",75, 59, 57, 20) $psbutton = GUICtrlCreateButton("Pics on", 13, 82, 57, 20) GUISetState(@SW_SHOW) ;once site is open(ing) (& you push button1)you have 1.5 seconds to click somewhere on the webpage ;you don't usually get a lot of time if it is an infected site While 1 $nMsg = GUIGetMsg() Select Case $nMsg = $GUI_EVENT_CLOSE Exit Case $nMsg = $iebutton $oIE = _IECreate("http://www.google.com/") Case $nMsg = $loggerbutton Run("site log record.exe", @ScriptDir); ClipGet & _FileWriteLog Straight out of the help section Case $nMsg = $psbutton Run("PrintScreen.exe", @ScriptDir);highly stripped-down version of "screen capture marquee2". Triggered by pressing prt scr. Case $nMsg = $gobutton Sleep(1500) Send("!d");select address bar Sleep(300) Send("^c");gets me the _FileWriteLog Send("^v");paste it back in otherwise it just don't work out Send("{enter}") EndSelect WEnd After pressing the 'go' button I need to click anywhere on the web page or the script does not work as intended. My question is: is there a method of automaticly clicking on the page? (I won't know the page name, text in advance) This would save me 1.5 seconds which can be make-or-break if the site is infected. New variant definitions can be hard to come by, but worth-while if other less-adventurous folks are spared the hassle. Link to comment Share on other sites More sharing options...
bwochinski Posted April 21, 2011 Share Posted April 21, 2011 (edited) This assumes that you want to use the window created with the "IE on" button. Had to do a bit of research to figure out the best way to accomplish this myself, so I learned something as well. Case $nMsg = $gobutton WinActivate(_IEPropertyGet($oIE,"hwnd")) ;Gets the IE window handle and runs the WinActivate() function against it. Send("!d") ;select address bar Sleep(300) Send("^c") ;gets me the _FileWriteLog Send("^v") ;paste it back in otherwise it just don't work out Send("{enter}") This isn't clicking on the webpage background, but no such action should be necessary as long as Internet Explorer is the active window. Edited April 21, 2011 by bwochinski Link to comment Share on other sites More sharing options...
lorenkinzel Posted April 21, 2011 Author Share Posted April 21, 2011 Thanks! I'll try it out when I get home. Link to comment Share on other sites More sharing options...
lorenkinzel Posted April 21, 2011 Author Share Posted April 21, 2011 Works like a charm & adds many more possibilities toward automating the virus searches. I'd name my next new def. after you, but that would make you unhappy. Thanks again. Link to comment Share on other sites More sharing options...
bwochinski Posted April 22, 2011 Share Posted April 22, 2011 haha, yeah I suppose that wouldn't be exactly a good reward. But glad to have helped! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now