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

Web Security - The Basics

Inndy
October 07, 2016

Web Security - The Basics

2016/Computer Security at National Taiwan University of Science and Technology (NTUST)

Inndy

October 07, 2016
Tweet

More Decks by Inndy

Other Decks in Technology

Transcript

  1. *OUFSOFUBOE/FUXPSL '51  44)  5FMOFU 155  )551 

    )5514  .Z42-  3%1  7/$  3FEJT 
  2. 8IBUIBQQFOFEBGUFS&OUFS  $MJFOU ˙ %/4MPPLVQ *GOFFEFE  ˙ $SFBUF5$1DPOOFDUJPO ˙

    44-IBOETIBLF *GOFFEFE  ˙ $PNQPTFBOETFOE)551SFRVFTU
  3. 8IBUIBQQFOFEBGUFS&OUFS  'JMFCBTFE ˙ $IFDLJGMFFYJTUT  ˙ *GOPU SFTQPOTFXJUIFSSPS ˙

    *TJUBTUBUJDMF  ˙ *GTP TFOEJUUPDMJFOU ˙ 0UIFSXJTF DBMMSFTQPOEJOHQSPDFTTPS ˙ .BZCFBDHJ QIQ QFSMTDSJQU ˙ 4FOESFTQPOTFUPDMJFOU
  4. 8IBUIBQQFOFEBGUFS&OUFS  4PGUXBSFSVMFT ˙ 1BSTFSFRVFTUGSPN)551TFSWFS ˙ 3PVUF ˙ %JTQBUDIDPOUSPMMFS ˙

    1SPDFTTSFRVFTUBOE3FOEFSSFTQPOTFEBUB ˙ 4FOEJUCBDLUP)551TFSWFS ˙ 4FSWFSTFOESFTQPOTFEBUBUPDMJFOU
  5. 8IBUIBQQFOFEBGUFS&OUFS  $MJFOU ˙ (PUSFTQPOTFEBUB .BZCFB)5.-EPDVNFOU  ˙ 1BSTF)5.-BOE%PXOMPBESFMBUFEBTTFUT ˙

    $44 *NBHF +BWB4DSJQU 'MBTI PS0UIFSNFEJBDPOUFOU ˙ 3FOEFSFOHJOFTUBSUXPSLJOHXJUI$44BOE)5.- ˙ 8FCLJU (FDLP #MJOL 5SJEFOU &EHF)5.- ˙ +BWB4DSJQUFOHJOFSVOUIFTDSJQUT ˙ 7 4QJEFS.POLFZ $BSBLBO $IBLSB 3IJOP
  6. )5513FTQPOTF$PNQPTJUJPO HTTP/1.1 200 OK<CRLF> Server: nginx<CRLF> Date: Thu, 06 Oct

    2016 15:03:36 GMT<CRLF> Content-Type: text/html; charset=UTF-8<CRLF> Content-Length: 1973<CRLF> Connection: keep-alive<CRLF> <CRLF> <!DOCTYPE html>..... )5517FSTJPO 3FTQPOTF4UBUVT
  7. )5513FTQPOTF$PNQPTJUJPO HTTP/1.1 200 OK<CRLF> Server: nginx<CRLF> Date: Thu, 06 Oct

    2016 15:03:36 GMT<CRLF> Content-Type: text/html; charset=UTF-8<CRLF> Content-Length: 1973<CRLF> Connection: keep-alive<CRLF> <CRLF> <!DOCTYPE html>..... (1973 bytes) 3FTQPOTF)FBEFST 3FTQPOTF#PEZ .BZCFCJOBSZEBUB
  8. )5514UBUVT$PEF ˙ 99 ˙ *UTOF ˙ 99 ˙ 3FEJSFDUJPO ˙

    99 ˙ *UTZPVSGBVMU ˙ 99 ˙ *UTNZGBVMU
  9. )5514UBUVT$PEF ˙ #BE3FRVFTU ˙ :PVKVTUHBWFNFXSPOHUIJOHT ˙ 6OBVUIPSJ[FE ˙ 'PSCJEEFO ˙

    :PVBSFOPUBMMPXFEIFSF ˙ /PU'PVOE ˙ .FUIPE/PU"MMPXFE ˙ *NBUFBQPU ˙ 6OBWBJMBCMF'PS-FHBM3FBTPOT
  10. )5514UBUVT$PEF ˙ *OUFSOBM4FSWFS&SSPS ˙ &YDFQUJPOSBJTFEJOZPVSDPEF ˙ #BE(BUFXBZ ˙ 6QTUSFBNPGSFWFSTFQSPYZJTEFBE ˙

    4FSWJDF6OBWBJMBCMF ˙ .BJOUFOBODFNPEF  ˙ (BUFXBZ5JNFPVU ˙ 6QTUSFBNPGSFWFSTFQSPYZUJNFPVU
  11. )551.FUIPE (&5 1045 165 1"5$) %&-&5& 015*0/4 )&"% $0//&$5 53"$&

    $034 "QBDIFEFCVHQVSQPTF )551QSPYZ /PSFTQPOTFC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