목록전체 (162)
Oh! JUN

문제설명 Exercise: Blind SQL Injection Advanced에서 실습하는 문제입니다. 관리자의 비밀번호는 "아스키코드"와 "한글"로 구성되어 있습니다. Query를 보니까 DH{**FLAG**} 여기 FLAG 값을 구하면 된다. 먼저, FLAG의 길이를 구해보자 FLAG 값은 27자인거 알았다. 이제 blind_Sql Injection 공격으로 FLAG값을 알아볼것이다. FLAG가 위치한 레코드의 uid='admin'이니까 select upw from users where uid='admin' 한글자씩 아스키코드로 변환해서 비트추론할 것이다. 다하기는 오래걸리니까 글자하나만 수공업으로 하고 나머지는 python으로 코드짜서 자동화 돌리겠습니다. INPUT OUTPUT admin' and..

http://testphp.vulnweb.com/index.php Home of Acunetix Art welcome to our page Test site for Acunetix WVS. Warning: This is not a real shop. This is an example PHP application, which is intentionally vulnerable to web attacks. It is intended to help you test Acunetix. It also helps you understand how developer err testphp.vulnweb.com 1. login 예상 쿼리 : select * from table where Usename=' ' and pass..

이전 포스팅에서 idx=2로 로그인하면 'gugucon'에 대응하는 세션을 생성했다. id='gugucon' and idx=999 or idx=4 'gugucon'에 대응하는 세션 값과 상관없이 idx=999 거짓입력하여 idx=4의 정보를 출력했다. 이번에는 id값과 대응하는 세션값이 일치하지 않으면 오류 메시지를 출력한다. idx=999와 같이 거짓 값을 넣어서 id를 무력화시키면 안된다. 그래서 UNION 공격을 사용해서 id는 'gugucon' 세션을 유지하면서 다른 계정정보를 훔쳐볼것이다. idx=2 order by 1 정상 출력 idx=2 order by 2 정상 출력 idx=2 order by 3 정상 출력 idx=2 order by 4 정상 출력 idx=2 order by 5 오류 발생 4..

idx=2로 우회접속을 할것이다. select * from members where id='' and password='' or idx=2 -- ' idx=2에 해당하는 id가 session으로 들어간다. ' or idx=2[spacebar]--[spacebar]입력하면 idx에 로그인 되면서 idx, id, password, jumin 정보가 출력된다. idx에 해당하는 id가 session에 들어간 상태 select * from members where id='$_SESSION["gugucon"]' and idx=2 만약 idx=4로 변경하고 싶다면 어떻게 해야될까? id는 SESSION 부분으로 건들 수 없어서 id and idx는 버려야된다. id='' and idx=999 or idx=4 id=..
HPF(HTTP Parameter Fragmentation)기법 HPF 기법 적용한 요청 예시 SELECT * FROM board WHERE title like '%[keyword]%'order by[sort]desc keyword=' and ascii(substring/*&sort=*/(@@version,1,1))&1=-- ↓ SELECT * FROM board WHERE title like '%' and ascii(substring/*%'order by*/(@@version,1,1))&1=--desc 쿼리 문장하나에 keyword랑 sort 파라미터를 입력할 수 있어야 공격이 가능하다.
http(평문) http://www.attack.co.kr/boardView.do?idx=100+and+1=1-- https(암호화) https://www.attack.co.kr/boardView.do?idx=100+and+1=1-- http 사용하는 웹 사이트에서 https로 암호화된 프로토콜을 사용하면 우회된다. (옛날 방식이라 현재는 잘 안먹힘)

NULL Byte 삽입 ' and%00ascii(substring(@@version,1,1))&1=1-- 보안 솔루션에서는 %00까지만 읽히고 뒤에는 읽히지 않고 끝난다. DBMS에서는 쿼리 끝까지 읽히니까 %00으로 보안 솔루션을 우회하면서 정상적인 쿼리 실행이 가능하다. %00는 인코딩하면 안되고 문자 그대로 작성해야한다. Multipart에서는 %00 기본형태로 작성하면 안된다. %00 디코딩 해주어야 한다. (and와 1사이에 아무것도 없는거 같지만 HEX값으로 보면 00 되어있음)
※ 기타 우회 기법 ※ 1. 대문자 사용 2. % 문자 사용 3. 키워드 중복 사용 4. 암호화 채널 사용 대문자 사용 ' and AsCii(suBStRinG(@@vErSiOn, 1,1))&1=1-- % 문자 사용 ' and %as%cii(su%bstring(@@v%er%si%on, 1,1))&1=1-- 키워드 중복 사용 ' and asasciiscii(subssubstringtring(@@version,1,1))&1=1-- 암호화 채널 사용 추후 업데이트 예정