SCRIPT SELECTIONNE :
Firewall_standard.cmd
REM - Il arrive parfois, lors d'une remasterisation, que les regles du FireWall ne soient pas appliquees.
REM - Copier l'ennsemble des lignes et les coller dans une fenetre Ms Dos ouverte en tant qu'admin puis valider.
@echo off
REM Version 1.09 allow all ports on FTP , remove localport=21
call %systemroot%\m_var.cmd
IF /I "%OS_Language%"=="FR" GOTO FR
:EN
Echo --- Add Rules for OS English version
Echo ---
netsh advfirewall firewall set rule group="Network Discovery" new enable=no
netsh advfirewall firewall set rule group="Core Networking" new enable=no
netsh advfirewall firewall set rule name="Windows Remote Management (HTTP-In)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Windows Remote Management - Compatibility Mode (HTTP-In)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Event Log Management (NP-In)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Event Log Management (RPC)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Event Log Management (RPC-EPMAP)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Scheduled Tasks Management (RPC)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Scheduled Tasks Management (RPC-EPMAP)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Service Management (NP-In)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Service Management (RPC)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Remote Service Management (RPC-EPMAP)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Performance Logs and Alerts (DCOM-In)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Performance Logs and Alerts (TCP-In)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Network Discovery (LLMNR-UDP-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (NB-Datagram-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (NB-Name-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (SSDP-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (UPnP-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (WSD-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (WSD Events-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (Pub-WSD-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="Network Discovery (WSD EventsSecure-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes
GOTO COMMON_RULES
:FR
Echo --- Add Rules for OS French version
Echo ---
netsh advfirewall firewall set rule group="Recherche du r‚seau" new enable=no
netsh advfirewall firewall set rule group="R‚seau de base" new enable=no
netsh advfirewall firewall set rule name="Gestion … distance de Windows (HTTP-Entr‚e)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion … distance de Windows - Mode de compatibilit‚ (HTTP-Entr‚e)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion … distance des journaux des ‚v‚nements (NP-Entr‚e)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion … distance des journaux des ‚v‚nements (RPC)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion … distance des journaux des ‚v‚nements (RPC-EPMAP)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion … distance des tƒches planifi‚es (RPC)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion … distance des tƒches planifi‚es (RPC-EPMAP)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion des services … distance (NP-Entr‚e)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion des services … distance (RPC)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Gestion des services … distance (RPC-EPMAP)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Journaux et alertes de performance (DCOM entrant)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="Journaux et alertes de performance (TCP entrant)" new enable=yes profil=domain
netsh advfirewall firewall set rule name="D‚couverte de r‚seau (LLMNR-UDP-Entr‚e)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte de r‚seau (NB-Datagramme-Entr‚e)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte de r‚seau (NB-Nom-Entr‚e)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte de r‚seau (SSDP-Entr‚e)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte de r‚seau (UPnP-Entr‚e)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte de r‚seau (WSD-Entr‚e)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte du r‚seau (‚v‚nements WSD-Trafic entrant)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte du r‚seau (Pub-WSD-In)" new enable=yes profil=domain,private
netsh advfirewall firewall set rule name="D‚couverte du r‚seau (WSD EventsSecure-In)" new enable=yes profil=domain,private
:COMMON_RULES
Echo --- Add Common Rules (WorldWide rules)
Echo ---
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=ICMPV4
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=UDP localport=161
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=UDP localport=137,138
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=TCP localport=445
netsh advfirewall firewall add rule name="Radia" dir=in action=allow protocol=TCP localport=3460,3461,6462,3463,3464,3465,3466
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=TCP localport=3473
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=TCP localport=3484
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=TCP localport=7686,7685
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=UDP program="C:\Program Files\Microsoft Office\Office12\outlook.exe" localport=6004
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=UDP program="C:\windows\system32\svchost.exe" localport=68 remoteport=67
netsh advfirewall firewall add rule name="WorldWide rules" dir=in action=allow protocol=TCP program="C:\Program Files\ICW\bin\cygrunsrv.exe " localport=873
netsh advfirewall firewall add rule name="Ftp transfer" dir=in action=allow protocol=TCP program="%SystemRoot%\System32\ftp.exe"
rem --- RSync
Echo --- Add Rules for Rsync
Echo ---
netsh advfirewall firewall add rule name="Rsync rules" dir=in action=allow protocol=TCP localport=873
rem --- HOTIX
Echo --- Add Rules for HOTIX
Echo ---
netsh advfirewall firewall add rule name="HOTELS_13000" dir=in action=allow protocol=TCP localport=13000
rem --- for FOLS servers only
Echo --- Add Rules for FOLS Server
Echo ---
netsh advfirewall firewall add rule name="HOTELS_5006" dir=in action=allow protocol=TCP localport=5006
netsh advfirewall firewall add rule name="FOLS_5009" dir=in action=allow protocol=TCP localport=5009
netsh advfirewall firewall add rule name="FOLS_11011" dir=in action=allow protocol=TCP localport=11011
netsh advfirewall firewall add rule name="FOLS_3015" dir=in action=allow protocol=TCP localport=3015
netsh advfirewall firewall add rule name="FOLS_2403_2404" dir=in action=allow protocol=TCP localport=2403,2404
netsh advfirewall firewall add rule name="FOLS_3293to3299" dir=in action=allow protocol=TCP localport=3293,3294,3295,3296,3297,3298,3299
netsh advfirewall firewall add rule name="FOLS_917" dir=in action=allow protocol=TCP localport=917
netsh advfirewall firewall add rule name="FOLS_80" dir=in action=allow protocol=TCP localport=80
netsh advfirewall firewall add rule name="FOLS_443" dir=in action=allow protocol=TCP localport=443
netsh advfirewall firewall add rule name="FOLS_30000_30001" dir=in action=allow protocol=TCP localport=30000,30001
netsh advfirewall firewall add rule name="FOLS_8080to8099" dir=in action=allow protocol=TCP localport=8080,8081,8082,8083,8084,8085,8086,8087,8088,8089,8090,8099
rem --- SQL ports
echo Rules SQL
netsh advfirewall firewall add rule name="FOLS_SQL_1433" dir=in action=allow protocol=TCP localport=1433
netsh advfirewall firewall add rule name="FOLS_SQL_1434" dir=in action=allow protocol=UDP localport=1434
netsh advfirewall firewall add rule name="FOLS_SQL_135" dir=in action=allow protocol=TCP localport=135
rem --- SF2E ports
echo Rules SF2E
netsh advfirewall firewall add rule name="FOLS_SF2E_9500" dir=in action=allow protocol=TCP localport=9500
netsh advfirewall firewall add rule name="FOLS_SF2E_9590" dir=in action=allow protocol=TCP localport=9590
netsh advfirewall firewall add rule name="FOLS_SF2E_PRG_24778" dir=in action=allow protocol=TCP program="C:\SF2E\Ecoute\Ecoute32.exe" localport=24778
rem --- visual restaurant
Echo --- Add Rules for VR
Echo ---
netsh advfirewall firewall add rule name="ProvideX" dir=in action=allow protocol=TCP program="c:\vg\pxp\pxplus.exe"
netsh advfirewall firewall add rule name="ProvideX" dir=in action=allow protocol=TCP program="d:\vg\pxp\pxplus.exe"
netsh advfirewall firewall add rule name="ProvideX" dir=in action=allow protocol=TCP program="c:\vgcs\pxp\pxplus.exe"
Echo --- Tune Firewall parameters
Echo ---
netsh advfirewall set currentprofile logging filename %systemroot%\system32\LogFiles\firewall\pfirewall.log
netsh advfirewall set currentprofile logging maxfilesize 4096
netsh advfirewall set currentprofile logging droppedconnections enable
netsh advfirewall set currentprofile logging allowedconnections disable
IF /I "%ONITY%"=="YES" (
netsh advfirewall firewall add rule name="ONITY_7123" dir=in action=allow protocol=UDP localport=7123 profil=domain
netsh advfirewall firewall add rule name="ONITY_6669" dir=in action=allow protocol=TCP localport=6669 profil=domain
netsh advfirewall firewall add rule name="ONITY_6543" dir=in action=allow protocol=UDP localport=6543 profil=domain
)
IF /I "%WEBKEYS%"=="YES" (
netsh advfirewall firewall add rule name="WEBKEYS_8030" dir=in action=allow protocol=TCP localport=8030 profil=domain
netsh advfirewall firewall add rule name="WEBKEYS_8020" dir=in action=allow protocol=TCP localport=8020 profil=domain
netsh advfirewall firewall add rule name="WEBKEYS_8011" dir=in action=allow protocol=TCP localport=8011 profil=domain
netsh advfirewall firewall add rule name="WEBKEYS_8010" dir=in action=allow protocol=TCP localport=8010 profil=domain
)
IF /I "%WINCARTE%"=="YES" (
netsh advfirewall firewall add rule name="WINCARTE_3389" dir=in action=allow protocol=TCP localport=3389 profil=domain
netsh advfirewall firewall add rule name="WINCARTE_80" dir=in action=allow protocol=TCP localport=80 profil=domain
)
IF /I "%WINKEY%"=="YES" (
netsh advfirewall firewall add rule name="WINKEY_8010" dir=in action=allow protocol=TCP localport=8010 profil=domain
netsh advfirewall firewall add rule name="WINKEY_8020" dir=in action=allow protocol=TCP localport=8020 profil=domain
)
IF /I "%VINGCARD%"=="YES" (
netsh advfirewall firewall add rule name="VINGCARD_4000" dir=in action=allow protocol=TCP localport=4000 profil=domain
netsh advfirewall firewall add rule name="VINGCARD_3015" dir=in action=allow protocol=TCP localport=3015 profil=domain
)
Exit /B 0
© Untitled. All rights reserved. | Support Technique Fols N2