Documentation
¶
Index ¶
- Constants
- Variables
- func DeleteCache(key string) error
- func GetCache(key string, data any) error
- func GetClient(api *gzapi.GZAPI) (*gzapi.GZAPI, error)
- func GetFileHashHex(file string) (string, error)
- func MustRunScripts(script string)
- func NormalizeFileName(name string) string
- func ParseYamlFromBytes(b []byte, data any) error
- func ParseYamlFromFile(confPath string, data any) error
- func RunScripts(script string) error
- type AppSettings
- type CTFTimeFeed
- type ChallengeYaml
- type Config
- type Container
- type GZ
- func (gz *GZ) CreateTeams(csvURL string, isSendEmail bool) error
- func (gz *GZ) CreteTeamAndUser(teamCreds *TeamCreds, config *Config, ...) (*TeamCreds, error)
- func (gz *GZ) DeleteAllUser() error
- func (gz *GZ) GenerateStructure() error
- func (gz *GZ) MustCreateTeams(url string, sendEmail bool)
- func (gz *GZ) MustDeleteAllUser()
- func (gz *GZ) MustScoreboard2CTFTimeFeed() *CTFTimeFeed
- func (gz *GZ) MustSync()
- func (gz *GZ) RemoveAllEvent() error
- func (gz *GZ) Scoreboard2CTFTimeFeed() (*CTFTimeFeed, error)
- func (gz *GZ) Sync() error
- type Label
- type Standing
- type TeamCreds
Constants ¶
View Source
const ( GZCTF_DIR = ".gzctf" CONFIG_FILE = "conf.yaml" APPSETTINGS_FILE = "appsettings.json" )
Variables ¶
View Source
var (
CHALLENGE_CATEGORY = []string{
"Misc", "Crypto", "Pwn",
"Web", "Reverse", "Blockchain",
"Forensics", "Hardware", "Mobile", "PPC",
"OSINT", "Game Hacking", "AI", "Pentest",
}
)
View Source
var LeetSpeakMap = map[rune]rune{
'a': '4',
'e': '3',
'i': '1',
'o': '0',
's': '5',
't': '7',
'g': '9',
}
LeetSpeakMap defines rune replacements for leetspeak transformations
Functions ¶
func DeleteCache ¶
DeleteCache removes cache files with minimal syscalls
func GetFileHashHex ¶
func MustRunScripts ¶
func MustRunScripts(script string)
MustRunScripts executes scripts or fatally logs error
func NormalizeFileName ¶
func ParseYamlFromBytes ¶
func ParseYamlFromFile ¶
Types ¶
type AppSettings ¶
type AppSettings struct { AllowedHosts string `json:"AllowedHosts"` ConnectionStrings struct { Database string `json:"Database"` RedisCache string `json:"RedisCache"` } `json:"ConnectionStrings"` Logging struct { LogLevel struct { Default string `json:"Default"` Microsoft string `json:"Microsoft"` MicrosoftHostingLifetime string `json:"Microsoft.Hosting.Lifetime"` } `json:"LogLevel"` Loki struct { Enable bool `json:"Enable"` EndpointUri string `json:"EndpointUri"` Labels []Label `json:"Labels"` PropertiesAsLabels []string `json:"PropertiesAsLabels"` Credentials struct { Login string `json:"Login"` Password string `json:"Password"` } `json:"Credentials"` Tenant string `json:"Tenant"` MinimumLevel string `json:"MinimumLevel"` } `json:"Loki"` } `json:"Logging"` Telemetry struct { Prometheus struct { Enable bool `json:"Enable"` Port int `json:"Port"` TotalNameSuffixForCounters bool `json:"TotalNameSuffixForCounters"` } `json:"Prometheus"` OpenTelemetry struct { Enable bool `json:"Enable"` Protocol string `json:"Protocol"` EndpointUri string `json:"EndpointUri"` } `json:"OpenTelemetry"` AzureMonitor struct { Enable bool `json:"Enable"` ConnectionString string `json:"ConnectionString"` } `json:"AzureMonitor"` Console struct { Enable bool `json:"Enable"` } `json:"Console"` } `json:"Telemetry"` EmailConfig struct { SenderAddress string `json:"SenderAddress"` SenderName string `json:"SenderName"` UserName string `json:"UserName"` Password string `json:"Password"` Smtp struct { Host string `json:"Host"` Port int `json:"Port"` BypassCertVerify bool `json:"BypassCertVerify"` } `json:"Smtp"` } `json:"EmailConfig"` XorKey string `json:"XorKey"` ContainerProvider struct { Type string `json:"Type"` PortMappingType string `json:"PortMappingType"` EnableTrafficCapture bool `json:"EnableTrafficCapture"` PublicEntry string `json:"PublicEntry"` DockerConfig struct { SwarmMode bool `json:"SwarmMode"` ChallengeNetwork string `json:"ChallengeNetwork"` Uri string `json:"Uri"` UserName string `json:"UserName"` Password string `json:"Password"` } `json:"DockerConfig"` KubernetesConfig struct { Namespace string `json:"Namespace"` ConfigPath string `json:"ConfigPath"` AllowCIDR []string `json:"AllowCIDR"` DNS []string `json:"DNS"` } `json:"KubernetesConfig"` } `json:"ContainerProvider"` RequestLogging bool `json:"RequestLogging"` DisableRateLimit bool `json:"DisableRateLimit"` RegistryConfig struct { UserName string `json:"UserName"` Password string `json:"Password"` ServerAddress string `json:"ServerAddress"` } `json:"RegistryConfig"` CaptchaConfig struct { Provider string `json:"Provider"` SiteKey string `json:"SiteKey"` SecretKey string `json:"SecretKey"` GoogleRecaptcha struct { VerifyAPIAddress string `json:"VerifyAPIAddress"` RecaptchaThreshold string `json:"RecaptchaThreshold"` } `json:"GoogleRecaptcha"` } `json:"CaptchaConfig"` ForwardedOptions struct { ForwardedHeaders int `json:"ForwardedHeaders"` ForwardLimit int `json:"ForwardLimit"` ForwardedForHeaderName string `json:"ForwardedForHeaderName"` TrustedNetworks []string `json:"TrustedNetworks"` TrustedProxies []string `json:"TrustedProxies"` } `json:"ForwardedOptions"` Kestrel struct { Endpoints struct { Web struct { Url string `json:"Url"` } `json:"Web"` Prometheus struct { Url string `json:"Url"` } `json:"Prometheus"` } `json:"Endpoints"` Limits struct { MaxResponseBufferSize int `json:"MaxResponseBufferSize"` MaxRequestBufferSize int `json:"MaxRequestBufferSize"` MaxRequestLineSize int `json:"MaxRequestLineSize"` MaxRequestHeadersTotalSize int `json:"MaxRequestHeadersTotalSize"` MaxRequestHeaderCount int `json:"MaxRequestHeaderCount"` MaxRequestBodySize int64 `json:"MaxRequestBodySize"` KeepAliveTimeout string `json:"KeepAliveTimeout"` RequestHeadersTimeout string `json:"RequestHeadersTimeout"` MaxConcurrentConnections *int `json:"MaxConcurrentConnections"` MaxConcurrentUpgradedConnections *int `json:"MaxConcurrentUpgradedConnections"` } `json:"Limits"` AddServerHeader bool `json:"AddServerHeader"` AllowResponseHeaderCompression bool `json:"AllowResponseHeaderCompression"` AllowSynchronousIO bool `json:"AllowSynchronousIO"` AllowAlternateSchemes bool `json:"AllowAlternateSchemes"` DisableStringReuse bool `json:"DisableStringReuse"` ConfigurationLoader *string `json:"ConfigurationLoader"` } `json:"Kestrel"` }
type CTFTimeFeed ¶
type ChallengeYaml ¶
type ChallengeYaml struct { Name string `yaml:"name"` Author string `yaml:"author"` Description string `yaml:"description"` Flags []string `yaml:"flags"` Value int `yaml:"value"` Provide *string `yaml:"provide,omitempty"` Visible *bool `yaml:"visible"` Type string `yaml:"type"` Hints []string `yaml:"hints"` Container Container `yaml:"container"` Scripts map[string]string `yaml:"scripts"` Category string `yaml:"-"` Cwd string `yaml:"-"` }
func GetChallengesYaml ¶
func GetChallengesYaml(config *Config) ([]ChallengeYaml, error)
type Config ¶
type Container ¶
type Container struct { FlagTemplate string `yaml:"flagTemplate"` ContainerImage string `yaml:"containerImage"` MemoryLimit int `yaml:"memoryLimit"` CpuCount int `yaml:"cpuCount"` StorageLimit int `yaml:"storageLimit"` ContainerExposePort int `yaml:"containerExposePort"` EnableTrafficCapture bool `yaml:"enableTrafficCapture"` }
type GZ ¶
type GZ struct { UpdateGame bool // contains filtered or unexported fields }
func (*GZ) CreteTeamAndUser ¶
func (gz *GZ) CreteTeamAndUser(teamCreds *TeamCreds, config *Config, existingTeamNames, existingUserNames map[string]struct{}, credsCache []*TeamCreds, isSendEmail bool) (*TeamCreds, error)
CreteTeamAndUser creates a team and user, ensuring the team name is unique and within the specified length.
func (*GZ) DeleteAllUser ¶
func (*GZ) GenerateStructure ¶
func (*GZ) MustCreateTeams ¶
MustCreateTeams creates teams or fatally logs error
func (*GZ) MustDeleteAllUser ¶
func (gz *GZ) MustDeleteAllUser()
MustDeleteAllUser removes all users or fatally logs error
func (*GZ) MustScoreboard2CTFTimeFeed ¶
func (gz *GZ) MustScoreboard2CTFTimeFeed() *CTFTimeFeed
func (*GZ) RemoveAllEvent ¶
Bulk game deletion with parallel execution
func (*GZ) Scoreboard2CTFTimeFeed ¶
func (gz *GZ) Scoreboard2CTFTimeFeed() (*CTFTimeFeed, error)
Preallocated scoreboard generation
type TeamCreds ¶
type TeamCreds struct { Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` Email string `json:"email" yaml:"email"` TeamName string `json:"team_name" yaml:"team_name"` IsEmailAlreadySent bool `json:"is_email_already_sent" yaml:"is_email_already_sent"` IsTeamCreated bool `json:"is_team_created" yaml:"is_team_created"` }
TeamCreds stores team credentials
Source Files
¶
Click to show internal directories.
Click to hide internal directories.