ããã¯ãç§ã«ã¯éçºã®å¹³å¡ãªçµéšãããããã«æãããšãã«èµ·ãããŸãããç§ã¯ããžã¥ãã¢ããèªä¿¡ã®ãªããžã¥ãã¢ãŸã§é²åïŒãŸãã¯çªç¶å€ç°ïŒã§ããå Žæãæ¢ããŠããŸããã äž»ã®ç¥ç§çãªæ¹æ³ã§ããã®ãããªå ŽæãèŠã€ããããããžã§ã¯ãããã®å Žæã«åãä»ããããã·ã¹ãã ã§ã®åœŒã®çµæŽã«ã€ããŠå¥³ã®åãããå€ãæžãããå€ãåŠæ ¡ãã®ããã°ã©ããŒã ããããïŒ ãããžã§ã¯ãããããã£ãŠRFPã«ãéããããã¡ã³ã¿ãŒãä»ããŸããç§ãã¡ã¯çããŠããŸãïŒããšæã£ãããå žåçãªææã®èª¬æã®ããã«ãæéã®ããŒããŒã¯æãããææã«çŽé¢ãã...
ãŸãæåã«ïŒ
1.ãµã€ãºãéèŠ
éçºã¯ããã€ãŠèª°ããæžããphpãšã³ãžã³ã§å§ãŸããããŒã¿ãä¿åããããã«äœ¿çšãããŠããŸããïŒããã§ã¯ãMySQL \ PostgreSQL \ SQLite \ MongoDB \ Something-else- but-necessarily-with-DB-suffix-otherwise-ã¿ããªç解ããŠããŸãããã圌ãã¯æšæž¬ããŸããã§ããïŒapi-gatewayã
ããããphpã䜿çšããŠãå¥ã®APIã²ãŒããŠã§ã€ãã¢ã¿ããããããŒã¿ãä¿åããŸããïŒ APIãjs-codeããçŽæ¥æäœããæ¹ãç°¡åã§ã¯ãããŸãããïŒ ãŸãã¯ãDBMS + PHPã䜿çšããŸããïŒã ãããŠåœŒã¯æ£ããã§ãããã ããããåœæãç§ã¯çš®ããŸã èŠãŠããªãã£ãã®ã§ãããã¯æããŸããã§ãããç¥ã£ãŠãã人ã¯ãã¯ãŒã«ãªäººã¯ããããããããã§ããããããå€ãåŠæ ¡ã®ãããã°ã©ãã¯ããç¥ã£ãŠããŸãã
ããã«èª¬æããããã«ïŒ
- ã²ãŒããŠã§ã€=ã»ãã¥ãªãã£ããã®ãããªäººã¯åºå ¥ãããŸãã
- ã²ãŒããŠã§ã€=ã»ãã¥ãªãã£ã§ä¿è·ãããããŒã¿ã¹ãã¬ãŒãžãã¢ã¯ã»ã¹ã§ããªãã+ããã¯ã¢ãã
- ã²ãŒããŠã§ã€=é床ãè¿ éã«æ©èœããé害ãªããã¿ã€ã ãã¹ãæžã¿
- ãæãªããã®ãããã°ã©ããŒã®æš©åšãã芳ç¹ã¯ãããªãã®phpãç©Žã ããã§ããã¹ãŠã®Webã¢ããªã±ãŒã·ã§ã³ãããã©ã«ãã§ãããã³ã°ãããŠããããããã®é£ã«ããŒã¿ãä¿åãããã®ããªãããšã§ãã
APIã²ãŒããŠã§ã€ã®ç¹åŸŽã¯ãjsonããŒã¿ãgetãªã¯ãšã¹ãã§éä¿¡ãããããšã§ãã ã¯ããã¯ãããããã®éåžžã«çŸããjsonãªããžã§ã¯ãã¯urlãšã³ã³ãŒãã®å¯Ÿè±¡ãšãªããã¯ãšãªæååã«å ¥ããããŸããã ãããŠãçªç¶ãããæ¥... getãªã¯ãšã¹ãã®é·ããååã§ãªããªã£ããšãããã¹ãŠãããŸãããã§ãããã æããªããšã«ãURLãšã³ã³ãŒããããJSONã¯ããã«åãŸããŸããã§ããã ãæãªããã®ãããã°ã©ããŒã¯é ããããŠã次ã®ããã«å°ããŸããã
ãã·ã§ãŒã¯ããïŒ jsonã¯æé·ããŸããããæ°ã¥ããŠããŸãã...ã
ãããããå€åããã¹ãã«æçš¿ããã®ïŒããšææ¡ããã®ã§ãããã¯ãã£ãšæ£ããããã§ãã
ãããããŸãããæçš¿ããŠãã ãããã
ããã¯atasãã³ããŒã¯ã³ã§ããã
2.æéãšããã¯ã¢ããã®ç®¡ç
ãããžã§ã¯ãã«æ°ããæ©èœãçµã¿èŸŒãã«ã¯ãå®è£ ããå¿ èŠããããŸãã
ã²ãŒããŠã§ã€äžã®å¯Ÿå¿ããCRUDãªã¯ãšã¹ããããã¯ããŸãã«ãå€ãåŠæ ¡ãã®åå¿ãå®éã«è¡ã£ãããšã§ãã åé¡ã¯ã圌ã3æ¥ããšã«1åãããè¡ã£ãŠããå®äºã確èªããšããããšã§ããã æã ãã§ãã¯ã¯ããã¹ãŠãæ©èœããªãã£ãããšã瀺ããŸãããäŸãã°ããªã¹ããååŸããããšã¯åé¡ãããŸããããæ°ããã¢ã€ãã ãè¿œå ããããšã¯åé¡ã§ã¯ãããŸããã ä¿®æ£ãšæ¹è¯ã«æéããããããã®åŸã倧éã¢ã¯ã»ã¹ã§æ©èœããªãªãŒã¹ããããšãã§ããŸããã ã²ãŒããŠã§ã€äžã§ã¯ãšãªã®å®è£ ãèªåã§è¡ããšããææ¡ã¯ãå°ãªããšãé«éã§ããããæåŠãããŸããããããã¯é£ããã®ã§ãããªãã¯ãããç解ã§ããªãããã§ããã ãã®ã¢ãããŒãã®çµæããèªåèªèº«ã§ãäœæ¥ãçµäºããŸããã ããšãã°ãããŒã¿ããŒã¹å ã®äœãããŸãšããŠä¿®æ£ããå¿ èŠãããå Žåã3æ¥éåŸ æ©ããããã¯ãšãªã䜿çšããŠèªåã§ä¿®æ£ãå®è£ ããããéžæããŸãã2çªç®ã®ãªãã·ã§ã³ãéžæããŸããã 顧客ã¯ç¹ã«åŸ ã€ããšã奜ãŸãªãã£ããããæ°ããå ¥éæžã¯å®å®ããŠé£ã³ãŸããã ãã®ãããªçŽ¹ä»çãªãã®ã®1ã€ãã€ãŸãç¹å®ã®æšèã®ãŠãŒã¶ãŒã«æšèã倧éã«è²Œãä»ããããšã¯ãç§ã«å®è£ ãä»»ããããŸããã ããã§ç§ãã¡ãåŸ ã£ãŠããŸãã
äºå®ããªã¯ãšã¹ãã§éä¿¡ãããjsonããŒã¿ã®åœ¢åŒã¯ãããã€ãã®å¿ é ãã£ãŒã«ãã®ã¿ãæ瀺ããæ®ãã¯ãã¹ãŠarbitraryæçã§ãããæ確ã§æçµçãªæ§é ã¯ååšããŸããã§ããã ããšãã°ããŠãŒã¶ãŒãè¿œå ããã«ã¯ã次ã®åœ¢åŒã®JSONãæž¡ããŸããã
POST /api/users { "email":"ivanov@mail.ru", "password":"myEmailIsVeryBig", "name_last":"", "name_first":"", "name_middle":"", "birth":"01.01.1961", // , - "living_at":"., .3 .4 .24", "phone_num":"+70000000000" }
è¿œå /æŽæ°ãªã¯ãšã¹ãã§éä¿¡ããããªãã·ã§ã³ã®éšåã¯ä¿åãããå šäœãæäŸãããŸããïŒãããã©ã®ããã«å®è£ ããããã«ã€ããŠã¯åŸè¿°ããŸãïŒã çµè«ã¯ãæéãæ¢ãŸããªããšããããšã§ããåé¡ã解決ããå¿ èŠããããŸã-ãŠãŒã¶ãŒãæŽæ°ããã©ãã«ã貌ãã ããããæ§é å šäœãæ¯åé転ããªãã®ã§ããïŒ ãã§ãã¯ããå¿ èŠããããŸãïŒ èªåã§ãã¹ãããŸãã-æŽæ°èŠæ±ã§1ã€ã®ãã£ãŒã«ãã®ã¿ãéä¿¡ãããã§ãã¯ãããã£ãŒã«ãã衚瀺ãããæ®ãã®ããŒã¿ãé 眮ãããŸããã ãã€ã³ãã¯å°ãã-ã«ãŒãããæ®ããæŽæ°ããŸãã
ã¹ã¯ãªããã¯ãœããã«èšãã¿ãããŒã¿ãéåä¿¡ãããã¹ãŠãé 調ã«é²ãã§ããããã«èŠããŸãã...çªç¶ã®ãšã-åŒã³åºãã ãã·ã¹ãã ã«ãŠãŒã¶ãŒã®ååã¯è¡šç€ºãããŸããïŒã-ã¯ã€ã€ã®ãã®ç«¯ããã®ã¬ããŒãã ãããïŒ ããŸããããŸããïŒã-äžå¿«ãªå¯ããç§ã®èäžãé§ãå·¡ããŸããã ãããªã調æ»ã®çµæãå®éã«ã¯ãååã«ãããå«ãŸããŠããããšã瀺ãããŸããããä»ã®ãã¹ãŠã®ããŒã¿ã¯ååšããŠããŸããã ãã®ãããªç¶æ³ã§äœããã¹ããïŒ ããã¯ã¢ãããå±éããŠãã ããïŒ
ãåå¿ãã®å€ãåŠæ ¡ã®ãããã°ã©ããŒãwi hev eråé¡hirïŒ ããã¯ã¢ãããå¿ èŠã§ãïŒ ææ°ã®é¢é£ã¯ãã€è¡ãããŸããïŒã-ç§ã¯å°ããŸãã
ãããŒã...ä»ããèŠãŸã.... ãããããã«ãã¯ãããŸãããã
æ°æéåã«ã¬ããŒãã§ã¢ãžã¥ãŒã«ãå®æãããŠãã¹ãããå¿ èŠãªãã¹ãŠã®ããŒã¿ãå«ãcsv-boxãæã£ãŠããŠãããã«1æé以å ã«é åºã埩å ããããšããäºå®ã«ãã£ãŠãç¶æ³ã¯æãããŸããã
ããããããããã¥ã¡ã³ãã®æ¬ åŠãæäœã¢ã«ãŽãªãºã ã®èª¬æãå ¥åã®åŠ¥åœæ§ãã§ãã¯ããããŠæãéèŠãªããš-ããŒã¿ããŒã¹ã®ããã¯ã¢ãã-atas number 2-sã
ãã以æ¥ãããã¯ã¢ããã¯æ¯æ¥åé€ããå§ããŸããã
3.æ·±æ
æºããŸãããäœæ¥ãåããåé¡ã解決ãããããã€ãã¯ããéããããã€ãã¯ããé ããçªç¶...ã·ã¹ãã ã¯èª°ãã®ãµãŒããŒã«ç解ãããŠããªãããšã«æ°ã¥ããŸããããããŠãPDãšISPDã§ZIã¢ã¯ãã£ããã£ãçµç¹ãããšããæ 床ã«å¯ŸããŠåœŒãã¯é ããªã§ãŸããã ãµãŒããŒãèªåã«è»¢éããå¿ èŠããããŸãã
ã·ã¹ãã ãæåã«è»¢éãããªãã£ãã®ã¯ãªãã§ããïŒ ãªãŒããŒã·ããã«ã¯æ ç±ããããŸãã-éäžåã çµå¶é£ã¯ããã¹ãŠãè¡ãã·ã¹ãã ã倢èŠãŠããŸããïŒ åäŸãåŠæ ¡ã«é£ããŠè¡ãå¿ èŠããããŸããïŒ ããªãã¯ç¹å¥ãªãªãã£ã¹ã§ã·ã¹ãã ã«å ¥ããããã§ç³è«æžãæåºããŸãã ããšãã°ããã¶ã泚æããå¿ èŠããããŸããã·ã¹ãã ã«å ¥ããå¥ã®ç¹å¥ãªãªãã£ã¹ã«è¡ãããã¶ãç³è«ããŸãã ãã¶ããããªãã¯çŸãã女æ§/玳士ãšã³ãã¥ãã±ãŒã·ã§ã³ãåãããã£ãã®ã§ããïŒ ããªãã®ãµãŒãã¹ã«ã¯3çªç®ã®ç¹å¥ãªãã£ããããããããŸã-ããªããããã«ç³è«æžãæåºããŠããŸãã
å©ç¹-ãã¹ãŠã«å¯ŸããŠ1ã€ã®ãã°ã€ã³ãšãã¹ã¯ãŒããããŒã¿ãã²ãŒããŠã§ã€ã«å®å šãã€å®å šã«ä¿åãããŸãã ããã¯ã¢ããããããŸãã ãããŠãå¿ã«çããŠã誰ãç§ãã¡ãããã®ã·ã¹ãã ãåããŸããïŒ ãããŠãããããããåãé€ããŠã-次ã¯äœã§ããïŒ ããã§ãã圌ãã¯ãå€ãåŠæ ¡ãã®ããã°ã©ããŒã«å¯Ÿããä¿è·ã·ã¹ãã ãç解ããŸãããããã§ã¯ãã¹ãŠãè€éã§ãã
ã·ã¹ãã ãåããVDSã¯ã¢ã³ããŒãããã顧客ã«åž°ããã圌ãã¯ãããå±éããçãèžããæããçŸãããçºæ®ããŸããïŒ
ãããŠã奜å¥å¿ãšç念ã®æ³¢ãç§ãèŠããŸããã
Webã¢ããªã±ãŒã·ã§ã³ã«ç©Žããã£ã±ãããå ŽåãããŒã¿ã¯ã©ãã«ãããŸããïŒ æ¬åœã«ä»ã®ãµãŒããŒã«ãšã©ãŸã£ãŠããŸããïŒ ãããŠã圌ããå€éšããã·ã¹ãã ãéããããšã«æ±ºããå Žåããã¹ãŠã厩å£ããŸããïŒ
ç°¡åãªãã§ãã¯ã§ãããŒã¿ãšã²ãŒããŠã§ã€ããã»ããµèªäœãåããµãŒããŒäžã«ããããšãããããŸããã ãããŠããããããããã¯ãµãŒããŒã®è»¢éã®ããã«ããã«è»¢éãããŸããã§ããã圌ãã¯åžžã«ããã«ããŸããã
ä»ãç§ã¯ç 究ã®ããã«èšå®ããéåžžã«ç§å¯ã®ãå€ãåŠæ ¡ãã®éçºãèªç±ã«äœ¿çšã§ããŸããã ãã¡ãããollydbgããªãã»ãããããã³ãã®ä»ã®ã¯ãŒã«ãªãã®ãå«ããHackerãã¬ãžã³ã®èšäºã¹ã¿ã€ã«ã®ã¯ãŒã«ãªãªããŒã¹ãšã³ãžãã¢ãªã³ã°ã¯æ©èœããªãã£ãã®ã§ãç§ãæã£ãŠãããã®ãå ±æããŸãã
éçºèªäœã¯pythonã§å®è£ ãããç°¡åã«éã³ã³ãã€ã«ããŠèªã¿åãå¯èœãªã³ãŒãã«æ»ãããšãã§ãã.pycãã¡ã€ã«ã®ã¿ããããŸããã ççŽã«èšã£ãŠããããã©ã®ããã«æ©èœããããç解ããã®ã«å€ãã®æéã25åãããããŸããã
ãããã£ãŠããå€ãåŠæ ¡ãã®ããã°ã©ããŒã«ãã£ãŠéçºãããè€éãªã·ã¹ãã ã¯ãã»ãšãã©ç解ã§ããŸãããã次ã®ãã®ã§æ§æãããŠããŸãã
- å®éã«ãªã¯ãšã¹ããåä¿¡ããApacheã«ãã£ãŠåŠçãããã¹ã¯ãªããã ãã®ã¹ã¯ãªããã¯äœãããŸãããïŒ ç¹å®ã®localhostããŒããžã®æ¥ç¶ãéããããã«ãã¹ãŠã®ããŒã¿ãå«ãèŠæ±ãæž¡ããŸããã ããã ãã§ã èå³ã¯ããã«é²ã¿ãŸãã
- ã¹ã¯ãªããããã®ãªã¯ãšã¹ããåŠçãããµãŒããŒéšåã 圌ã®è¡åã®è«çã¯éåžžã«èå³æ·±ããã®ã§ããã ãŸããã³ãŒãã«ã¯ããŒã¿æäœããªããããŒã¿ããŒã¹ã«ã¯ã¯ãšãªããããŸããã§ããããPL \ SQLã®ããŒã¿ããŒã¹é¢æ°ãåŒã³åºãããŸããã ãã¹ãŠã®ããžãã¯ããã§ãã¯ãªã©ããã¹ãŠãããŒã¿ããŒã¹é¢æ°ã«é 眮ãããŸããã ã¹ã¯ãªããã®50ïŒ ã¯ãèŠæ±ã®ååãããã«ããããããé¢æ°ãããã³get-requestè¡ã§æž¡ãããããŒã¿ã«å¯Ÿå¿ããé¢æ°ãã©ã¡ãŒã¿ãŒã®ååãå«ãèŸæžã§ããã JSONããŒã¿ã¯ãå¿ èŠã«å¿ããŠãå¥åã®ãã©ã¡ãŒã¿ãŒãšããŠæž¡ãããŸããã ãµãŒããŒéšåã®çµç¹ã®ç¹åŸŽã¯ããŠãŒã¶ãŒèªèšŒäžã®ããã¯ã¢ããæ¥ç¶ã§ããã ããŒã¿ããŒã¹ã§ãã°ã€ã³ãšãã¹ã¯ãŒããèŠã€ãã£ãå Žå-ã»ãã·ã§ã³IDãçæãããéããŠããæ¥ç¶ã€ã³ã¹ã¿ã³ã¹ãèŸæžã«è¿œå ããïŒ10åã®ã¿ã€ã ã¢ãŠãã§åŒ·å¶çµäºãããããã匷å¶çµäºãããŸãã-ã»ãã·ã§ã³ã®å¯¿åœã延ã°ãç¹å¥ãªæ¹æ³ããããŸããïŒãããŒã¯ããŒã¿ããŒã¹ã«çŽæ¥ããã»ãã·ã§ã³IDã§ããä¿åãããŸããã ã»ãã·ã§ã³IDã¯ãŠãŒã¶ãŒããŒã¿ã«ã©ã®çšåºŠæ£ç¢ºã«é¢é£ä»ããããŠããŸããïŒ çµå±ã®ãšããããŠãŒã¶ãŒIDãéä¿¡ãããªãããŒã¿ã®èŠæ±ã¯ãããŸããïŒ ããã¯æ©èœããŸããã€ãŸããããã§äœããééã£ãŠãããšããããšã§ãã
éåžžã«å°é£ãªéçºã¯ãå°é£ã䌎ãæèã«äžããããéå»ã®å·šå ã®é·ã倱ãããç§å¯ãæããã«ããããã«æ¥ãã§ããŸããã§ããã
ããã«ãããããããä¿¡ããããªãã»ã©ïŒå®çŸ©ãžç§»åãPL \ SQLãç解ããŠãããPhpStormã«æè¬ïŒããªãŒã«ãã¹ã¯ãŒã«ããã°ã©ããŒã®å€±ãããææã®çã®ç¥èã«èŠããã§ããçŽ äººã®å¿ã«ã¯ç解ã§ããŸããã§ããã äžè¬ã«ãæ¥ç¶ãããšãèªèšŒããŒã¿æ€èšŒæ©èœã§äžæããŒãã«ãçæããããŠãŒã¶ãŒIDãä¿åãããŸãã
ããã¯ã»ãã®å§ãŸãã«éãããèŠã€ãã£ãæ·±å»ãªè匱æ§ã®ææšãªã¹ãã§ãã
- äžæ¬èªèšŒã䜿çšããDDoSïŒæ¥ç¶ã¯äºçŽãããŠãããããDBMSã®æ¥ç¶å¶éã«åºã¥ããŠãããããã»ãã·ã§ã³ã®æå¹æéã延é·ãããå¯èœæ§ããããããã¡ã¢ãªãæ¥ç¶ã§å®å šã«æºããããšãã§ããã·ã¹ãã å ã®æ°ãããŠãŒã¶ãŒã®äœæ¥ã¯äžå¯èœã«ãªããŸããïŒ;
- ç·åœããæ»æã«å¯Ÿããä¿è·ã®æ¬ åŠïŒå€±æãããã°ã€ã³è©Šè¡ã®æ°ã¯æ€åºããããä¿åãããããã§ãã¯ãããŸããã
- ãšã³ãã£ãã£ã䜿çšããã¢ã¯ã·ã§ã³ã®å¶åŸ¡ã®æ¬ åŠïŒããšãã°ããŠãŒã¶ãŒãèŠæ±ããããã¥ã¡ã³ãã®ãªã¹ãã¯ããŠãŒã¶ãŒãé¢é£ä»ããããŠããçµç¹ãèæ ®ããŠçºè¡ããããã®ã§ãããããã¥ã¡ã³ãã®IDãããã£ãŠããå Žåã¯ãããã¥ã¡ã³ãã®æŽæ°/åé€ã®ãªã¯ãšã¹ããæ£åžžã«å®äºã§ãããŠãŒã¶ãŒã®ãªã¹ãã¯ãªããŠãããã¡ãªã¿ã«ãããã·ã¥ãªãã§ãªãŒãã³åœ¢åŒã§ããŒã¿ããŒã¹ã«ä¿åããããã¹ã¯ãŒãã¯ãã ãã§ãåä¿¡ã§ããŸããïŒã
ãŸããå¥ã®æ·±å»ãªåé¡ã¯ãæ£åŒãªããŒã¿ã¹ãã¬ãŒãžã¹ããŒã ã§ã¯ãããŸããã åã«çŽæããããã«ãJSONãããä»»æã®ãã£ãŒã«ãããä¿åããããšã«ã€ããŠè©±ããŠããŸãã ããããããŒãã«ã®è¡ãšããŠä¿åãããŠããŸããã ãããã¯ããŒãšå€ã®ãã¢ã«åå²ãããå¥ã®ããŒãã«ã«ä¿åãããŸããã ããšãã°ããŠãŒã¶ãŒã®å ŽåããŠãŒã¶ãŒãšãusers_dataïŒæååããŒãæååå€ïŒã®2ã€ã®ããŒãã«ããããããŒã¿ãå®éã«ä¿åãããŠããŸããã ãã®ã¢ãããŒãã®çµæã¯ãããŒã¿ããŒã¹ããã®è€éãªãµã³ãã«ã®æéã®å¢å ã§ããã
å®éãããã¯ãã·ã¹ãã ãæ°ããAPIã«ç§»è¡ããç解ãããããææžåããããµããŒãããããšãã決å®ãäžããå®è£ ããã®ã«ååã§ããã
é埳
ããããããã®ã·ã¹ãã ã¯ãã¬ã¬ã·ãŒãã§ããããããäœæãããæ§æ¥ã®ãããã°ã©ããŒã¯ã¬ã¬ã·ãŒã®ä¿è·è ã§ãã
ããã«ãããããããçµè«ã¯æ¬¡ã®ãšããã§ãã
- ãããã¯é£ãããç解ã§ããªãããšèšãããã-å®å šãªatasããããŸã
- 圌ããæš©åšã«ãã£ãŠæŒãã€ã¶ããããªããäœããæ±ããŠãã
- ä¿¡é ŒããŸããã確èªããŸã-ã»ãã¥ãªãã£ã¯ç¶æ ã§ã¯ãªããã»ãã¥ãªãã£ã¯ããã»ã¹ã§ãããããã«ç¶ç¶çã§ãããããã£ãŠããã¹ãŠã®ãŠãŒã¶ãŒãçªç¶ãIvanov Ivanov Ivanitchãã«ãªã£ãããbacapsããªãããšãç¥ããããã宣èšãããå質ãæ£ããããšã確èªããæ¹ãè¯ãã§ã