목록전체 글 (33)
D1N0's hacking blog
문제 풀이 세상에... 따옴표를 필터링하고 있다 지금까지 사용했던 SQL 인젝션 기법으로는 풀 수 없어 보인다 유일하게 전과 다른 것은 쿼리문에서 =이 아니라 like를 사용한다는 것이다 like는 =과 비슷하게 작동하여 전에 =을 우회하기 위해서도 사용하였지만 한 가지 큰 차이점이 있는데, 바로 와일드카드를 사용할 수 있다는 점이다 STEP 0 - SQL injection 취약점 확인 like는 특정 문자를 모르더라도 검색할 수 있는 와일드카드 %와 _를 지원한다 %는 문자의 길이에 관계없이 어떤 문자가 오던 상관없이 가져오고, _는 딱 한 글자를 어떤 문자던지 상관없이 가져온다 예를 들어, A%B라면 ACB, A1234B, AB 등을 모두 가져오고, A_B라면 ACB는 가져올 수 있지만 AB, A12..
문제 풀이 코드를 보면 입력받는 쿼리는 shit 하나이다 shit의 길이가 1을 넘으면 No Hack이 뜨고, 띄어쓰기, 개행, 캐리지 리턴, 탭도 필터링한다 필터링만 봐도 공백을 우회하는 방법을 묻는 문제임을 알 수 있다 아마 정상적으로 우회했다면 from과 prob_giant가 떨어지면서 SQL 구문이 정상적으로 1234를 반환할 것이다 풀이 shit=%0b shit=%0c 전에도 공백을 우회하는 비슷한 문제가 있었다 Lord of SQL injection - Wolfman 문제 풀이 언뜻 보면 pw=' or id = 'admin';%23으로 풀 수 있을 것 같지만 코드를 보면 공백을 필터링하고 있다 불필요한 공백을 지우더라도 or과 id는 띄워야 한다 SQL에서 공백은 Tab, Line Feed, ..
이 글에서는 64bit 환경에서의 함수 호출 과정을 알아보겠다 나는 함수 호출 규약을 64bit에선 fastcall만 쓰는 줄 알았는데, 찾아보니 vectorcall을 사용한다, 기본 64bit 호출 규약이 있다,... 말이 다 달라서 용어는 모르겠지만 나는 그냥 gcc 기본옵션으로 컴파일된 바이너리를 살펴보겠다 어차피 일반적으로 그냥 컴파일 된 바이너리를 제일 자주 볼 테니 말이다 물론 내가 기본옵션으로 컴파일 한 파일이 일반적인 방식으로 컴파일된 파일이 아닐 수도 있다 아무튼 나중에 자세히 알게된다면 이 부분에 대해선 다시 정리하겠다 이 글은 전 글과 연결되어 있으니 아직 보지 않았다면 이전 글을 보고 오는 것을 추천한다 C언어 함수 호출과정 - cdecl 포너블에서 너무 중요하고 기초적인 내용이지만..