fwscript

package
v0.0.26 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2020 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Clear = []string{
		"-F",
		"-P INPUT ACCEPT",
		"-P FORWARD ACCEPT",
		"-P OUTPUT ACCEPT",
		"-t nat -F",
		"-t mangle -F",
		"-F",
		"-X",
	}

	DenyAll = []string{

		"-P INPUT DROP",
		"-P FORWARD DROP",
		"-P OUTPUT DROP",
		"-A INPUT -i lo -j ACCEPT",
		"-A OUTPUT -o lo -j ACCEPT",
		"-A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT",
	}
)
View Source
var AllowBasic = []string{
	"advfirewall firewall add rule name=\"Core Networking (DNS-Out)\" dir=out action=allow protocol=UDP remoteport=53 program=\"%%%%systemroot%%%%\\system32\\svchost.exe\" service=\"dnscache\"",
	"advfirewall firewall add rule name=\"Core Networking (DHCP-Out)\" dir=out action=allow protocol=UDP localport=68 remoteport=67 program=\"%%%%systemroot%%%%\\system32\\svchost.exe\" service=\"dhcp\"",
}

Functions

func AppendFile

func AppendFile(filename, text string, perms os.FileMode) error

func Command

func Command(command string, args ...string) (string, error)

func DarwinServerSetup

func DarwinServerSetup(iface, gface string) error

func DefaultGate

func DefaultGate() string

func DefaultIface

func DefaultIface() (string, error)

func DenyIPTables

func DenyIPTables() (string, error)

func EnableVPN

func EnableVPN(tunnel, ipaddr string) []string

func EnableVPNIPTables

func EnableVPNIPTables(tunnel, ipaddr string) (string, error)

func ExceptApplication

func ExceptApplication(appname, pathtoapp string) []string

func ExceptTCPPort

func ExceptTCPPort(port string) []string

func ExceptUDPPort

func ExceptUDPPort(port string) []string

func ExceptWindowsTCPPort

func ExceptWindowsTCPPort(port int) []string

func ExceptWindowsUDPPort

func ExceptWindowsUDPPort(port int) []string

func GetPidOf

func GetPidOf(Executable string) (int, error)

func GetPidString

func GetPidString(Executable string) (string, error)

func IfIP

func IfIP(INTERFACE string) (net.IP, error)

func LinuxServerSetup

func LinuxServerSetup(iface, gface string) error

func LinuxSetupVPNDNS

func LinuxSetupVPNDNS(tunnel, ipaddr string) (string, error)

func LinuxSetupVPNExceptPort

func LinuxSetupVPNExceptPort(tunnel, ipaddr, port string) (string, error)

func LinuxSetupVPNTunnelled

func LinuxSetupVPNTunnelled(tunnel, ipaddr string) (string, error)

func ResetIPTables

func ResetIPTables() (string, error)

func RunExceptDHCP

func RunExceptDHCP() (string, error)

func RunExceptTCPPort

func RunExceptTCPPort(port string) (string, error)

func RunExceptUDPPort

func RunExceptUDPPort(port string) (string, error)

func RunExceptWindowsApplication

func RunExceptWindowsApplication(appname, pathtoapp string) (string, error)

func RunExceptWindowsTCPPort

func RunExceptWindowsTCPPort(port int) (string, error)

func RunExceptWindowsUDPPort

func RunExceptWindowsUDPPort(port int) (string, error)

func RunIPTables

func RunIPTables(net int, rules []string) (string, error)

func RunNetSH

func RunNetSH(rules []string) (string, error)

func RunRoute

func RunRoute(rules []string) (string, error)

func ServerSetup

func ServerSetup(iface, gface string) error

func Setup

func Setup(iface string) error

func SetupIPTables

func SetupIPTables(rules []string) (string, error)

func SetupRoute

func SetupRoute(gateway string, ifname string) (string, error)

func SetupRouteWithMetric

func SetupRouteWithMetric(gateway string, metric int, ifname string) (string, error)

func VPNRoute

func VPNRoute(gateway string, ifname string) []string

func VPNRouteWithMetric

func VPNRouteWithMetric(gateway string, metric int, ifname string) []string

func WindowsServerSetup

func WindowsServerSetup(iface, gface string) error

func WindowsSetupRouteDHCP

func WindowsSetupRouteDHCP(gateway string, ifname string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL