BinaryBrother Posted August 11 Share Posted August 11 Sometimes people use my laptop without my permission. It's a family home and people are allowed to use my laptop, but someone has been using it and denying it. So, I slapped together a Snitch that takes a picture through the webcam each time someone logs in. Here's the full code... #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Custom-Icon-Design-Mono-General-4-Eye.ico #AutoIt3Wrapper_Outfile_x64=Snitch.Exe #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Date.au3> #include <StringConstants.au3> #include <MsgBoxConstants.au3> _AddToStartup() $Date = _NowDate() $Time = StringStripWS(_NowTime(), $STR_STRIPALL) $String = StringReplace(StringReplace($Date & " " & $Time,":","-"), "/", "-") Run(@ScriptDir & "\CommandCam.exe /filename " & '"' & $String & ".bmp" & '"' & " /quiet",@ScriptDir,@SW_HIDE) Func _AddToStartup() If Not FileExists(@StartupDir & "\Snitch.ink") Then FileCreateShortcut(@ScriptFullPath, @StartupDir & "\Snitch.ink") MsgBox(0,"Snitch","Snitch has been installed!" & @CRLF & "Path: C:\Snitch.") EndIf EndFunc I shared it with a friend and added a routine to ensure it starts with the PC. The CommandCam.exe is simply a console app that takes a snapshot and isn't included, nor relevant to this issue. Although, you can find it online, and it is OpenSource. The issue is that the MsgBox stating that it has been added to startup is triggered despite the file existing. In other words, it lets the user know that Snitch has been added to startup every startup. The only relevant piece of code is here... Func _AddToStartup() If Not FileExists(@StartupDir & "\Snitch.ink") Then FileCreateShortcut(@ScriptFullPath, @StartupDir & "\Snitch.ink") MsgBox(0,"Snitch","Snitch has been installed!" & @CRLF & "Path: C:\Snitch.") EndIf EndFunc NVM... I just figured it out. The font that I'm using the "I"s look like "L"s in lowercase... I changed Snitch.INK to Snitch.LNK and it fixed it. So, here's the broken version. lol SIGNATURE_0X800007D NOT FOUND Link to comment Share on other sites More sharing options...
argumentum Posted August 11 Share Posted August 11 (edited) 1 hour ago, BinaryBrother said: The CommandCam.exe is simply a console app that takes a snapshot and isn't included, nor relevant to this issue. Although, you can find it online, and it is OpenSource. just got 2 warnings for getting https://github.com/tedburke/CommandCam/archive/refs/heads/master.zip as "This site may be hacked or contain malicious software. Visiting this page may be harmful. (Reported by urlhaus Our fraud reports are maintained by third-party vendors. )". And uBlock also stopped me. ( ||github.com/tedburke/commandcam/archive/refs/heads/master.zip$all ) Virustotal did not find anything. In any case, be careful. Edited August 11 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Solution BinaryBrother Posted August 11 Author Solution Share Posted August 11 (edited) It accesses your webcam without a consent prompt. I always recommend reviewing the source and compiling it yourself. The third-party bmp2jpg is the one that could cause concern because it's closed-source. Anyway, here's the final product. It's sloppy, and uses third-party apps, but figured I'd share anyway. #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Custom-Icon-Design-Mono-General-4-Eye.ico #AutoIt3Wrapper_Outfile_x64=Snitch.Exe #AutoIt3Wrapper_Compression=4 #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <Date.au3> #include <StringConstants.au3> #include <MsgBoxConstants.au3> _AddToStartup() $Date = _NowDate() $Time = StringStripWS(_NowTime(), $STR_STRIPALL) $FileName = StringReplace(StringReplace($Date & " " & $Time,":","-"), "/", "-") & ".bmp" _TakeSnapshot($FileName) _CompressImage($FileName) FileDelete($FileName) Func _TakeSnapshot($pFileName) RunWait(@ScriptDir & "\CommandCam.exe /filename " & '"' & $pFileName & '"' & " /quiet",@ScriptDir,@SW_HIDE) EndFunc Func _CompressImage($pFileName) $RunCommand = @ScriptDir & "\bmp2jpgcmd -i " & '"' & $pFileName & '"' & " --wm-image=Watermark.png" RunWait($RunCommand, @ScriptDir, @SW_HIDE) EndFunc ;ConsoleWrite(@ScriptDir & "\CommandCam.exe /filename " & '"' & $String & '"') Func _AddToStartup() If Not FileExists(@StartupDir & "\Snitch.lnk") Then FileCreateShortcut(@ScriptFullPath, @StartupDir & "\Snitch.lnk") MsgBox(0,"Snitch","Snitch has been installed!" & @CRLF & "Path: C:\Snitch.") EndIf EndFunc Edited August 11 by BinaryBrother Added info about third-party apps SIGNATURE_0X800007D NOT FOUND 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