Documentation
¶
Index ¶
- Variables
- func ChooseRandomUser(dir string) (string, string, error)
- func Initalize(gameConfig *enum.YamlConfig)
- func LoadFTPFiles(path string) error
- func LoadWebFiles(dir string) error
- func ScoreDNSExternalFwd(service enum.Service, address string) (int, bool, error)
- func ScoreDNSExternalRev(service enum.Service, address string) (int, bool, error)
- func ScoreDNSInternalFwd(service enum.Service, address string) (int, bool, error)
- func ScoreDNSInternalRev(service enum.Service, address string) (int, bool, error)
- func ScoreFTP(service enum.Service, address string) (int, bool, error)
- func ScoreFTPLogin(service enum.Service, address string) (int, bool, error)
- func ScoreFTPRead(service enum.Service, address string) (int, bool, error)
- func ScoreFTPWrite(service enum.Service, address string) (int, bool, error)
- func ScoreRouterICMP(service enum.Service, address string) (int, bool, error)
- func ScoreSSHLogin(service enum.Service, address string) (int, bool, error)
- func ScoreWeb80(service enum.Service, address string) (int, bool, error)
- func ScoreWebContent(service enum.Service, address string) (int, bool, error)
- func ScoreWebSSLTLS(service enum.Service, address string) (int, bool, error)
Constants ¶
This section is empty.
Variables ¶
var ScoringDispatch = map[string]func(service enum.Service, address string) (int, bool, error){ "ftp": ScoreFTP, "ftplogin": ScoreFTPLogin, "ftpread": ScoreFTPRead, "ftpwrite": ScoreFTPWrite, "ssh": ScoreSSHLogin, "web80": ScoreWeb80, "webssl": ScoreWebSSLTLS, "webcontent": ScoreWebContent, "routericmp": ScoreRouterICMP, "dnsexternalfwd": ScoreDNSExternalFwd, "dnsexternalrev": ScoreDNSExternalRev, "dnsinternalfwd": ScoreDNSInternalFwd, "dnsinternalrev": ScoreDNSInternalRev, }
Functions ¶
func ChooseRandomUser ¶
ChooseRandomUser reads the file at `dir`, which contains lines formatted as "username:password", picks one user at random, and returns the parsed username and password.
func Initalize ¶
func Initalize(gameConfig *enum.YamlConfig)
func LoadFTPFiles ¶
loadFTPFiles is a utility function that loads a files or all the files in a directory into memory for use in scoring. The function uses sync to only run one time, when it initially called.
func LoadWebFiles ¶
LoadWebFiles is a function that loads all the required web files into memory at startup (HTML FILES) so that they can be accessed later without inconvenience
func ScoreDNSExternalFwd ¶
ScoreDNSExternalFwd checks that for each line in the query file, a forward DNS query (A record) for the external domain returns the expected external IP. The team number is derived from the resolver’s last octet (but the actual DNS server is now 10.20.0.10).
func ScoreDNSExternalRev ¶
ScoreDNSExternalRev checks that for each line in the query file, a reverse DNS (PTR) query for the external IP returns the expected external domain. The team number is derived from the resolver’s last octet (but the actual DNS server is now 10.20.0.10).
func ScoreDNSInternalFwd ¶
ScoreDNSInternalFwd checks that for each line in the query file, a forward DNS query (A record) for the internal domain returns the expected internal IP. The team number is derived from the resolver’s third octet.
func ScoreDNSInternalRev ¶
ScoreDNSInternalRev checks that for each line in the query file, a reverse DNS (PTR) query for the internal IP returns the expected internal domain. The team number is derived from the resolver’s third octet.
func ScoreFTP ¶
ScoreFTP is a general scorer for FTP that checks for a valid FTP connection and then returns
func ScoreFTPLogin ¶
ScoreFTPLogin is a scorer for FTP that checks for if the user can log in
func ScoreFTPRead ¶
ScoreFTPRead is a scorer for FTP that checks for if the user can read from a/many file(s).
Requires `service.QDir` to be a directory of files expected to be in the FTP server.
func ScoreFTPWrite ¶
ScoreFTPWrite is a scorer for FTP that checks for if the user can write to a/many file(s).
Requires `service.QDir` to be a directory of files expected to be in the FTP server.
func ScoreRouterICMP ¶
Checks if a router is pingable via ICMP
func ScoreWeb80 ¶
ScoreWeb80 ensures that a website is accessible via http, but does not check for the content on the website
func ScoreWebContent ¶
ScoreWebContent scores a website based on the content it's providing users, through either port 80 or SSL/TLS
To do this, it first checks both ScoreWeb80 and ScoreWebSSLTLS to ensure the website is up before continuing any operations. It will return false and 0 points if both of those functions do, but if either function returns true it will work.
Types ¶
This section is empty.