Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: IP block to Win7 FireWall  (Read 3975 times)

0 Members and 1 Guest are viewing this topic.

TosunPASA

    Topic Starter


    Rookie

    • Experience: Beginner
    • OS: Windows 8
    IP block to Win7 FireWall
    « on: March 24, 2015, 10:04:42 PM »
    Hello
    i did create rule Windows FireWall for inbound (Win7)
    i wanna block some ip list for hack
    (whats doing ?
    checking host & directories - files for include shell)

    i have ip.txt text file for will block ip list and created rule name Block_IP in firewall
    noted ip list from apache logs

    i found this code
    Code: [Select]
    @echo off
    if "%1"=="list" (
      netsh advfirewall firewall show rule Blockit | findstr RemoteIP
      exit/b
    )

    :: Deleting existing block on ips
    netsh advfirewall firewall delete rule name="Blockit"

    :: Block new ips (while reading them from ip.txt)
    for /f %%i in (ip.txt) do (
      netsh advfirewall firewall add rule name="Block_IP" protocol=any dir=in action=block remoteip=%%i
      netsh advfirewall firewall add rule name="Block_IP" protocol=any dir=out action=block remoteip=%%i
    )

    :: call this batch again with list to show the blocked IPs
    call %0 list

    this script is creating 1 separate rule for each blocked IP.

    but.. i wanna use ONE rule and will add new ip from text file
    daily or hourly i will add new ip for block. and will run batch file for block

    i dont delete old blocked ip from text file..
    when i run batch file will check ip in rule added will pass that ip else will add to rule to end of file

    (wanna) last work; will list blocked ip count
    smilar msg "Blocked  ###  IP in Windows FireWall"

    could you help me ?

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: IP block to Win7 FireWall
    « Reply #1 on: March 24, 2015, 10:18:28 PM »
    What documentation are you using?
    Have you read this one?
    Understanding Windows Firewall settings | Windows 7
    Quote
    ...
    A firewall can help prevent hackers or malicious software (such as worms) from gaining access to your computer through a network or the Internet. A firewall can also help stop your computer from sending malicious software to other computers.
    You can customize four settings for each type of network location in Windows Firewall. To find these settings, follow these steps:
        Open Windows Firewall by clicking the Start button Picture of the Start button, and then clicking Control Panel. In the search box, type firewall, and then click Windows Firewall.
        In the left pane, click Turn Windows Firewall on or off. Administrator permission required If you're prompted for an administrator password or confirmation, type the password or provide confirmation.  ...

    TosunPASA

      Topic Starter


      Rookie

      • Experience: Beginner
      • OS: Windows 8
      Re: IP block to Win7 FireWall
      « Reply #2 on: March 24, 2015, 10:31:35 PM »
      hello

      thx for doc. sorry dont understand complately

      but
      if i will block all inbound connection, will lost my remote connection (using vnc with setted port - not default port)

      if i can new rule for all inbound connection (exception vnc port) why not

      or whats your new idea for security my vds (esxi) ?