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

脆弱なアプリを書く技術

akiym
October 31, 2014

 脆弱なアプリを書く技術

Hokkaido.pm #12

補足: Mojo 5.48にて->paramの挙動が変更された

akiym

October 31, 2014
Tweet

More Decks by akiym

Other Decks in Technology

Transcript

  1. ;(

  2. { "name": "a", "1\"=\"1\") union select sql,tbl_name,null from sqlite_master where

    (\"a": "a" } WHERE ("name" LIKE ?) AND ("1"="1") union select sql,tbl_name,null from sqlite_master where ("a" LIKE ?) ΧϥϜ໊͸Τεέʔϓ͞Εͳ͍
  3. w ҆͝৺Λ w FWJM \QSJOU ^ dFWJM w ಈ͔ͳ͍ w

    &WBMHSPVQOPUBMMPXFEBUSVOUJNF w VTFSFFWBMΛ͢Ε͹ಈ͘Α͏ʹͳΔ
  4. use re 'eval'; ''=~('('.'?' .'{'.( '`'|'%').("\["^ '-').('`'| '!').('`'|',').'"' .('['^'+') .('['^

    ')').('`'|')').('`'| '.').('['^'/').('{'^ '[').'\\'.'"'.('`'^'(' ).('`'|'%').('`'|',') .('`'|',').('`'|('/')). ','.('{'^'[').('['^ ',').('`'|'/').('['^')').( '`'|',').('`'| '$').'!'.'\\'.'\\'.('`'|'.'). '\\'.'"'."\;". '"'.'}'.')');$:='.'^'~';$~="\@"| '(';$^=')'^'['; $/='`'|'.';$,='('^'}';$\='`'|'!';$: =')'^'}';$~='*' |'`';$^='+'^'_';$/='&'|'@';$,='['&'~'; $\=','^"\|";$:= '.'^'~';$~='@'|'(';$^=')'^'[';$/='`'|'.' ;$,='('^'}';$\ ='`'|'!';$:=')'^'}';$~='*'|'`';$^='+'^'_' ;$/='&'|'@';$, ='['&'~';$\=','^'|';$:='.'^'~';$~='@'|'('; $^=')'^'[';$/='`'|'.';$,='('^'}';$\='`'|'!';$:=')'^'}';$~= '*'|'`';$^='+'^'_';$/='&'|'@';$,='['&'~';$\=','^'|';$:='.'^ '~';$~='@'|'(';$^=')'^'[';$/='`'|'.';$,='('^'}';$\='`'|'!' ;$:=')'^'}';$~='*'|'`';$^='+'^'_';$/='&'|'@';$,='['&'~';$\= ','^'|';$:='.'^'~';$~='@'|'(';$^=')'^'[';$/='`'|'.';$,='('^ '}';$\='`'|'!';$:=')'^'}';$~='*'|'`';$^='+'^'_';$/='&'|'@' ;$,='['&'~';$\=','^'|';$:='.'^'~';$~='@'|'(';$^="\)"^ '[' ;$/='`'|'.';$,='('^'}';$\='`'|'!';$:=')'^'}';$~='*' |(( '`'));$^='+'^'_';$/='&'|'@';$,='['&'~';$\ =','^'|' ;$: ='.'^'~';$~='@'|'(';$^=')'^'[';$/='`'| '.';$,= '(' ^'}'; $\='`'|'!';$:=')'^'}';$~="\*"| '`';$^= '+' ^'_';$/='&'|'@';$,='['&'~';$\ =(',')^ '|' ;$:='.'^ '~';$~='@' |"\("; $^=')' ^+ '[';$/= '`'|'.'; $,='(' ^"\}"; $\ =('`')| "\!";$:= "\)"^ "\}"; ( ($~))= '*'|'`'; ($^) ='+' ^"\_"; $/=('&')| '@'; ($,) ='['& "\~";$\= ','^ '|'; ($:)= '.'^'~' ;$~= '@'| '('; $^=')' ^'[' ;$/= '`'| '.' ;$,= '('^ '}'; $\= '`' |(( '!' )); $:= ')' ^(( '}' )); $~= '*' |(( '`' )) ;( ($^))= (( (( '+')) )) ^+ "\_";$/= (( '&' ))|+ "\@"; $, =(( '['))& '~'; $\= ','^ "\|";$:= '.' ^'~' ;($~)= ('@')| "\(";$^= ')'^'[' use re 'eval'; )FMMP XPSME Λग़ྗ͢ΔϓϩάϥϜ
  5. w ίϯςΩετͱ͸ w 1FSM͸୯਺ͱෳ਺Λผͱͯ͠ѻ͏ w !GPP    

    w !GPPˠ   w TDBMBS!GPPˠ w ϦετΛ!BSSBZʹ୅ೖ͢Ε͹഑ྻʹɺIBTIʹ୅ ೖ͢Ε͹ϋογϡʹ
  6. { ... pass => 'asdf', give_me_flag => 0, give_me_flag =>

    'give_me_flag', # true! 0 } VTFS\HJWF@NF@qBH^HJWF@NF@qBH