Circuit-level firewalls function similarly to application gateways in that they too use a proxy to secure the network. When the circuit gateway scans a packet, however, it often only checks that the connection is legitimate, ensuring that the incoming packets are coming from the same source that the request was sent to and that the user has sufficient privileges for whatever service is needed. Circuit-level gateways offer a wider variety of possible rules than other firewalls along with its proxy service, so it is more versatile in this regard. For example, it can block specific URLs from being accessed, whereas a packet filter would need the IP address of the website, which may not be unique since many large companies such as Google use multiple servers.
Elaborating this we are using the URL blocking approach of Circuit-Level Firewall.
P.S.: No special commands are needed to install these packages as they already exist in Python.
This code is made to run the file on Kali Linux but yes you can run it on any other os as well. Just you need to change the 'host_path'. For checking the hosts path click below as per prefered OS:
Make sure you are in root environment for Kali Linux or running as an administrator in Windows OS.
- sudo su (For enabling root)
- cd {Your Circuit Level Firewall file location} (To change the directory)
- python3 circuit-level-firewall.py