# AddFirewallRule Add a new inbound or outbound firewall rule using COM. >This operation requires elevated privileges. ## Arguments * ``: specify `in` for inbound or `out` for outbound. * ``: specify a single port (80) or port range (80-1000). * ``: specify the name of the new firewall rule. * ``: specify the name of the rule group OR leave empty. * ``: specify the description of the new rule OR leave empty. ## Usage * `addfirewallrule "" "" ""` ## Example * `addfirewallrule in 80 "ExampleRuleName1" "ExampleGroup1" "Test rule"` * `addfirewallrule out 80-1000 "ExampleRuleName2"` ## Compile - 1\. Make sure Visual Studio is installed and supports C/C++. - 2\. Open the `x64 Native Tools Command Prompt for VS <2019/2022>` terminal. - 3\. Run the `bofcompile.bat` script to compile the object file. - 4\. In Cobalt strike, use the script manager to load the .cna script to import the tool.