Windows XP Firewall

  • Hallo Leute,

    Hat von euch jemand schon ein script oder eine idee wie man die firewall prüfen kann ob sie eingeschaltet ist und wenn ja das sie ausgeschaltet wird und auch diese meldung im sicherheitscenter qauf selber verwalten.

    Ich will das machen da ich gerade in einem unternehmen angefangen habe ohne Domäne und manchmal auf den arbeitsplätzen die firewall noch aktiv ist.
    somit komme ich nicht mit vnc auf die computer.
    möchte aber auch nicht an jedem arbeitsplat laufen und das testen. sonder wollte es per loginscript ausführen lassen.

    hatte schon überlegt eine gruppen richtlinie zu erstellen nur sind nicht alle windows versionen gleich xp64bit, sp2 ,sp3 usw

  • Diese Zeile auf jedem Client laufen lassen

    Code
    netsh firewall set service REMOTEADMIN ENABLE SUBNET

    Danach kannst du mit diesem Skript bei jedem Client die Firewall ein und ausschalten.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #NoTrayIcon

    [/autoit] [autoit][/autoit] [autoit]

    ;$vTarget is who we are getting so lets declare him as ourselfs for presentation sake
    $vTarget = "Working As "&@IPAddress1

    [/autoit] [autoit][/autoit] [autoit]

    ;The GUI is created here.
    GUICreate("DFW-IR - " &$vTarget, 300, 140)

    [/autoit] [autoit][/autoit] [autoit]

    ; Show the GUI
    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    ;INPUTBOXES of IP Address for the Target and action button along with a status label
    $Target = GuiCtrlCreateInput(@IPAddress1, 5, 20, 0, 0)
    $button_1 = GUICtrlCreateButton("Execute", "5", "60", "80", "20", $BS_DEFPUSHBUTTON)
    $Status = GUICtrlCreateLabel ("Ready", "90", "60", "100", "25")

    [/autoit] [autoit][/autoit] [autoit]

    ;Enable and Disable options options for the firewall
    $Radio1 = GUICtrlCreateRadio ("Disable", 205, 50, 120, 20)
    $Radio2 = GUICtrlCreateRadio ("Enable", 205, 70, 120, 20)
    GUICtrlSetState($Radio1,$GUI_CHECKED)
    GUICtrlSetState($Target,$GUI_FOCUS)

    [/autoit] [autoit][/autoit] [autoit]

    ;Creating ProgressBar
    $ProgressBar = GUICtrlCreateProgress("5","100","180","0")

    [/autoit] [autoit][/autoit] [autoit]

    ;This script is to bring down the RI Firewall on the Windows XP Images
    Dim $aReg[6]

    [/autoit] [autoit][/autoit] [autoit]

    ;Now the arrays are created
    $aReg[0] = "\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile /v EnableFirewall /t reg_dword "
    $aReg[1] = "\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile /v EnableFirewall /t reg_dword "
    $aReg[2] = "/d 00000000 /F"
    $aReg[3] = "/d 00000001 /F"
    $aReg[4] = "on"
    $aReg[5] = "off"

    [/autoit] [autoit][/autoit] [autoit]

    ;While 1 keeps the application from stoping
    While 1
    $msg = GUIGetMsg()
    $i = 0 ;$i is defined as 0 so the while loop that is later called, for DFW-IR, can be broken
    GUICtrlSetData($ProgressBar,0) ;Setting the progressbar to 0

    Select
    Case $msg = $GUI_EVENT_CLOSE
    Exit
    Case $msg = $GUI_EVENT_MINIMIZE

    Case $msg = $GUI_EVENT_MAXIMIZE

    Case $msg = $button_1
    $i = $i + 1
    While $i = 1

    ;Here is we get the state of the radio buttons
    If GUICtrlRead($Radio1) = $GUI_CHECKED Then $x = $aReg[2]
    If GUICtrlRead($Radio2) = $GUI_CHECKED Then $x = $aReg[3]
    If GUICtrlRead($Radio1) = $GUI_CHECKED Then $q = $aReg[5]
    If GUICtrlRead($Radio2) = $GUI_CHECKED Then $q = $aReg[4]

    ;Now the games begin
    $vTarget = GUICtrlRead($Target)
    GUICtrlSetData($ProgressBar,18)
    GUICtrlSetData($Status, "Enabling Remote Registry")
    RunWait(@ComSpec & " /c sc \\" & $vTarget&" config RemoteRegistry start= auto", "C:\", @SW_HIDE)
    GUICtrlSetData($ProgressBar,38)
    GUICtrlSetData($Status, "Starting Remote Registry")
    RunWait(@ComSpec & " /c sc \\" & $vTarget&" start RemoteRegistry", "C:\", @SW_HIDE)
    GUICtrlSetData($ProgressBar,42)
    GUICtrlSetData($Status, "Turning "& $q&" firewall for the user")
    RunWait(@ComSpec & " /c reg add \\" & $vTarget&$aReg[0]&$x, "C:\", @SW_HIDE)
    GUICtrlSetData($ProgressBar,64)
    GUICtrlSetData($Status, "Turning "& $q&" firewall for the computer")
    RunWait(@ComSpec & " /c reg add \\" & $vTarget&$aReg[1]&$x, "C:\", @SW_HIDE)
    GUICtrlSetData($ProgressBar,79)
    GUICtrlSetData($Status, "Stoping Remote Registry")
    RunWait(@ComSpec & " /c sc \\" & $vTarget&" start RemoteRegistry", "C:\", @SW_HIDE)
    GUICtrlSetData($ProgressBar,95)
    GUICtrlSetData($Status, "Disabling Remote Registry")
    RunWait(@ComSpec & " /c sc \\" & $vTarget&" config RemoteRegistry start= auto", "C:\", @SW_HIDE)
    GUICtrlSetData($ProgressBar,100)
    GUICtrlSetData($Status, "Process Complete on "&$vTarget)
    $i = $i + 1
    WEnd

    EndSelect
    WEnd

    [/autoit]


    Quelle: http://www.autoitscript.com/forum/index.php?showtopic=42707