![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FKlUfR%2Fbtq9eM6LVYX%2FokvvmRvcRFCOZH6ti9cRm0%2Fimg.png)
https://www.hackerrank.com/challenges/cats-and-a-mouse/problem Cats and a Mouse | HackerRank Which cat will catch the mouse first? www.hackerrank.com Algorithms > Implementation Cat A, Cat B, Mouse C의 위치가 차례로 주어지면, Cat A와 Cat B 중에 Mouse C와의 위치가 더 가까운 쪽을 리턴하는 문제이다. 만약 거리가 같으면 Mouse C를 리턴한다. 코드 char* catAndMouse(int x, int y, int z) { int dA, dB; dA = (x - z > 0) ? x - z : z - x; dB = (y - z > 0) ..
![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FZiza9%2Fbtq9e55ZWa8%2F6Nf61mme1fL3eT874JwoT1%2Fimg.png)
https://www.hackerrank.com/challenges/divisible-sum-pairs/problem Divisible Sum Pairs | HackerRank Count the number of pairs in an array having sums that are evenly divisible by a given number. www.hackerrank.com Algorithms > Implementation 배열 ar이 주어지면, i
![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbeBCWu%2Fbtq89NMcp2B%2FroKHKmuy3NXRaTeVfgew61%2Fimg.png)
이번에도 blind sql injection을 이용하는 문제다. or, and, substr 등이 필터링 된다. or는 ||, and는 &&로 우회할 수 있고, substr는 mid 함수로, =은 in으로 쓰면 된다. 아래와 같이 입력해보았다. ?pw=' || id in("admin") %23 Hello admin이라고 뜬다. 마찬가지로 쿼리 뒤에 && length(pw) in ("8") #을 추가해 pw의 길이가 8임을 확인했다. pw를 알아내기 위헤 파이썬을 이용해 자동화 프로그램을 작성했다. import requests url = 'https://los.rubiya.kr/chall/golem_4b5202cfedd8160e73124b5234235ef5.php' headers= {'User-Agent'..
![article thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbtgpuA%2Fbtq86VoTVG8%2FG5U7ACtnaqrmdHQo87QQ8k%2Fimg.png)
http://natas21.natas.labs.overthewire.org/index.php natas21/IFekPyrQXftziDEsUr3x21sYuahypdgJ로 로그인 화면에 표시된 링크와 같이 보아야 하는 문제다. 일단 링크를 타고 들어가보았다. CSS style experimenter 페이지라고 한다. 이 두 웹페이지가 연동되니 세션 id도 공유될 것이라 생각했다. 소스코드를 살펴보았다. 메인 페이지 natas21 Note: this website is colocated with http://natas21-experimenter.natas.labs.overthewire.org View sourcecode 눈여겨볼 부분은 세션 key에 admin이 포함되어 있고 value가 1인지 체크하는 부분..