Documentation
¶
Overview ¶
Package ctfsendai2018 is a pseudo customer management system created for the task of CTF Sendai 2018. There are three vulnerabilities in this system, and we exploit the vulnerability from the outside to obtain a hidden flag.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthHandler ¶
AuthHandler is handler manipulating authentication information
func NewAuthHandler ¶
func NewAuthHandler(uc AuthUsecase) AuthHandler
NewAuthHandler is create new instance
type AuthRepository ¶
type AuthRepository interface {
Login(*User) (*Authentication, error)
}
AuthRepository is repository manipulating authentication information
func NewAuthRepository ¶
func NewAuthRepository() AuthRepository
NewAuthRepository is create new instance
type AuthUsecase ¶
type AuthUsecase interface { Register(string, string) error Login(string, string) (*Authentication, error) }
AuthUsecase is service manipulating authentication information
func NewAuthUsecase ¶
func NewAuthUsecase(a AuthRepository, u UserRepository) AuthUsecase
NewAuthUsecase is create new instance
type Authentication ¶
type Authentication struct {
Token string
}
Authentication is structure that represents authentication information
type User ¶
type User struct { ID string `json:"id"` Password string `json:"-"` EMail string `json:"email"` Name string `json:"name"` Age uint8 `json:"age"` Note string `json:"note"` Auth uint8 `json:"auth"` }
User は、ユーザー情報を表す構造体
type UserHandler ¶
UserHandler is handler manipulating authentication information
func NewUserHandler ¶
func NewUserHandler(uc UserUsecase) UserHandler
NewUserHandler is create new instance
type UserRepository ¶
type UserRepository interface { Add(*User) error List() ([]*User, error) FetchByEMail(string) (*User, error) }
UserRepository is repository manipulating user information
func NewUserRepository ¶
func NewUserRepository() UserRepository
NewUserRepository is Create new instance
type UserUsecase ¶
UserUsecase is service manipulating user information
func NewUserUsecase ¶
func NewUserUsecase(rep UserRepository) UserUsecase
NewUserUsecase is create new instance