è匱æ§æ€çŽ¢
å§ããããã«ãç§ã¯binwalkãéããŠé»è©±ã®ãã¡ãŒã ãŠã§ã¢ãå®è¡ãã16é²ãšãã£ã¿ãŒã調ã¹ãŸããã çµæã¯åæºãããã¡ãŒã ãŠã§ã¢ã¯æå·åããããããå¥ã®æ¹æ³ã§é»è©±èªäœãžã®ã«ãŒãã¢ã¯ã»ã¹ãååŸããå¿ èŠããããŸãã ã»ãŒ2é±éãç§ã¯Webã€ã³ã¿ãŒãã§ã€ã¹ã®ãã£ãŒã«ãããã£ã«ã¿ãªã³ã°ããè匱æ§ãæ¢ããŠããŸããã ããã€ãã®å Žæã§ãsyslogdããã³udhcpdã³ãã³ãã«ãã©ã¡ãŒã¿ãŒãæž¡ãæ©äŒãèŠã€ããŸããã syslogã®å Žåãããã¯èå³ãåŒããã®ã§ã¯ãããŸããã§ããããudhcpdã®å Žåã-sãã©ã¡ãŒã¿ãŒãæå®ããŠãã€ã³ã¿ãŒãã§ãŒã¹ãæ§æããããã«å®è¡ãããã¹ã¯ãªãããåç §ããããšãã§ããŸããã ããã§ã¯ä»»æã®ã³ãã³ããå®è¡ã§ããŸããããã®ãã©ã¡ãŒã¿ãŒãæå®ããããšã¯äžå¯èœã§ãããåžžã«defconfigãã©ã¡ãŒã¿ãŒã䜿çšããŠå®è¡ãããŸããã ãã®è匱æ§ã䜿çšããŠã䟡å€ã®ããããšãè¡ãããšã¯ã§ããŸããã§ããã ãããã£ãŠãè匱æ§ã®æ€çŽ¢ã¯ç¶ç¶ãããŸããã ãããŠãç§ã¯åœŒå¥³ãèŠã€ããŸããïŒ æ£ç¢ºãªå ŽæãæããŸãã ã¡ãŒã«ãŒã¯ããã«ãããã«ããŒããããšãã§ããå°æ¥çã«ã¯ããããŸã 䟿å©ã«ãªãå¯èœæ§ããããŸãããŸãããããªãã§ã«ãŒãã¢ã¯ã»ã¹ãååŸã§ããŸãã
ããã«ãã¡ãŒã«ãŒã¯ãããããããšãã°ãããã°ã®ããã«ã«ãŒããååŸããå¯èœæ§ãæ®ãã¹ãã§ããããããæ¢ãããšã¯æçšã ãšç€ºåããŸããã Webçµç±ã§å®è¡ããããã¹ãŠã®ã¹ã¯ãªãããåæããŸããããåæ§ã®ã¹ã¯ãªããã¯èŠã€ãããŸããã§ããã ãã®åŸãã·ã§ã«ã®åæãéå§ããŸãããããã¯ãsshãä»ããŠå ¥æã§ããŸãã
ã·ã§ã«åæ
sshãä»ããŠé»è©±ã«æ¥ç¶ãããšãgs_configã·ã§ã«ã衚瀺ãããŸãããã®ã·ã§ã«ãããã·ã§ã«èªäœã«ãã£ãŠåŠçãããã³ãã³ãã®å°ããªãªã¹ããå ¥æã§ããŸãã ãã«ãã«èšèŒãããŠããªããµãŒãã¹ã³ãã³ãããããããããªããšææ¡ããŸããã ãã®ããã«ãç§ã¯ç«ã¡äžããŸãã
ãã€ããªå ã®è¡ãèŠãŠãå¥åŠãªå¥åŠãªãã®ãèŠãŸããïŒstrings gs_config
ãããã®ã³ãã³ããã·ã§ã«ã§ãã°ããå ¥åãããšã次ã®ããšãããããŸãããconsole fw_setenv console yes gssu /bin/sh
ããŒã ã¯ãã£ã¬ã³ãžã«åºã¥ããŠçæããããã¹ã¯ãŒããå¿ èŠãšããŸãGrandstream GXP2130 Command Shell Copyright 2014 GXP2130> gssu Challenge: fb72f22fc5e233ae Response:
ããããããšãªããIDAã«gs_configãããŒãããããã§gssuè¡ãæ¢ããŸãã
ããã«ãé¢æ°sub_94BCã§XFERãæž¡ããŸã
gssuã³ãã³ããå ¥åããåŸãsub_B254é¢æ°ãåŒã³åºããããã®çµæã«å¿ããŠ/ bin / shã³ãã³ããå®è¡ããããã©ãããããããŸãã
ãã®é¢æ°ã«ç§»åããŠF5ãæŒããã¢ã»ã³ãã©ãŒããC ++æ¬äŒŒã³ãŒãã«åãæ¿ããŸã
ã³ãŒããèŠããšããã£ã¬ã³ãžãæåã«çæãããçµæã®ãã£ã¬ã³ãžãå€æ°sã«é 眮ãããŠããããšãæããã§ãã
printf("Challenge: %s\n", s);
次ã«ããŠãŒã¶ãŒå¿çããã®å
¥åãåä¿¡ãããå¿çèªäœã®çæãéå§ãããŸã
ãã®è¡ã¯ãnvramãã管çè ãã¹ã¯ãŒããåŒãåºããŸããããã«ãããweb faceããã³sshã«ãã°ã€ã³ããŸã
次ã«ãå€æ°v13ã«æ ŒçŽãããŸãã
次ã«ãsub_B254é¢æ°ã®ãã©ã¡ãŒã¿ãŒã§ããå€æ°v1ã®å 容ãåæãããŸãã ãã®å€ã¯ãã©ã®ã³ãã³ãã«å¯ŸããŠResponseããã¹ãããŠããã®ãããã®ãããªã³ãã³ãã3ã€ããã¯ãã§ããããšã瀺ããŠããŸãããgssuãšconsoleã®2ã€ããèŠã€ãããŸããã§ãã
gssuã®å Žåãå€æ°v14 ã®æååïŒ sïŒsfTXrhCA2010ïŒïŒ sãååŸããŸã
次ã«ã sprintfãä»ããŠãCallengeïŒsfTXrhCA2010ïŒPasswordãšãã圢åŒã®æçµè¡ãååŸããå€æ°v27ã«å ¥ããŸãã
次ã«ããã®è¡ã®md5ãæ€èšããŸãã
次ã«ãdo ... whileã«ãŒãã8åç¹°ãè¿ãããmd5ã®åèšã®ååãééããŠã16é²æ°ã«å€æãããŸãã 次ã«ãå ¥åãããå¿çãšæ¯èŒããŸãã
ã¢ã«ãŽãªãºã ã¯éåžžã«åçŽã§ããPythonã§ã®keygenã®å®è£ ã¯æ¬¡ã®ãšããã§ãã
import hashlib import sys challenge=sys.argv[2] pwd=sys.argv[1] secret=':sfTXrhCA2010:' # /sin/sh #secret=':dspg_cordless_config:' #secret=':a50ba3e905c0627eb0a204d82880fb46:' # console str=challenge+secret+pwd md5=hashlib.md5(str).hexdigest() result=md5[:16] print result
ãã¡ãŒã ãŠã§ã¢ã䜿çšãã
ããŠãé»è©±ã§æ°žä¹ ã«rootã«ãªãæ¹æ³ãåŠã³ãŸãããä»åºŠã¯ãã¡ãŒã ãŠã§ã¢ã解åããæ¹æ³ãåŠã³ãŸãã
é»è©±æ©ã®å®è¡å¯èœã¹ã¯ãªããããã£ãšèŠãŠã¿ããšãã¹ã¯ãªãã/ sbin / provisionãèŠã€ãããŸããããã¯å®éã«é»è©±æ©ããã©ãã·ã¥ãã圹å²ãæãããŸãã
prov_pipe_unpackã³ãã³ãã䜿çšããŠãã¡ãŒã ãŠã§ã¢ãåå¥ã®ãã¡ã€ã«ã«è§£åããã prov_pipedecã³ãã³ãã䜿çšããŠãã¡ãŒã ãŠã§ã¢ã®åå¥ã®ã»ã¯ã·ã§ã³ã埩å·åãããŠããããšãããããŸãã å®éãããã¯åããã€ããªã§ãã ãã®ãã¹ãŠã®æ©èœãèŠã€ããããã«ãç§ã¯ãããIDAã«æã蟌ã¿ãŸãããç§ãã¡ãèå³ãæã£ãŠããããŒã ãèŠã€ããŸããããããã¯æ¬¡ã®ãšããã§ãã
prov_unpackãããIDAã§ã©ã®ããã«æ€çŽ¢ããããã«ã€ããŠã¯è§ŠããŸããããªããŒã¹ãšã³ãžãã¢ãªã³ã°ã容æã«ããããã«ãgdbserverãé»è©±ã«ããŠã³ããŒããããããã¬ãŒã§ãããã®ã³ãã³ããå®è¡ããŸããã
prov_dec
prov_enc
prov_pack
次ã«ããããã®ã³ãã³ãã«ã€ããŠè©³ãã説æããŸãã
prov_unpack-ãã¡ãŒã ãŠã§ã¢ãåå¥ã®ãã¡ã€ã«ã«è§£åãã次ã®ããã«éå§ããŸãã
解åçµæã¯çŸåšã®ãã£ã¬ã¯ããªã«ãããŸããprov_unpack gxp1400fw.bin
prov_dec-åã ã®ãã¡ãŒã ãŠã§ã¢ãã¡ã€ã«ã埩å·åããŸã
æåã®ãã©ã¡ãŒã¿ã¯ãã¡ãŒã ãŠã§ã¢ããŒã§ããå·¥å Žåºè·æã®ãã¡ãŒã ãŠã§ã¢ã®å Žåã¯nokeyã§ãããç¬èªã®ããŒãæã€OEMé»è©±ãããå ŽåããããŸããprov_dec nokey gxp1400prog.bin gxp1400prog.bin
2çªç®ã®ãã©ã¡ãŒã¿ãŒã¯ã埩å·åãããã¡ã€ã«ã§ã
3çªç®ã®ãã©ã¡ãŒã¿ãŒ-ã¡ãŒã«ãŒã®æå³ã«ãããšãããã¯æºåž¯é»è©±ã®ãã©ãã·ã¥å ã®ç»åã«å¯Ÿå¿ããã»ã¯ã·ã§ã³ã§ããããã°ã©ã ã¯ãã¡ã€ã«ã®ããŒãžã§ã³ãšæ¢ã«ãã©ãã·ã¥ãããããŒãžã§ã³ãæ¯èŒããçããå Žåã¯äœãããŸããã æå·åããããã¡ãŒã ãŠã§ã¢ãã¡ã€ã«ã2çªç®ã®ãã©ã¡ãŒã¿ãŒãšããŠå床æå®ãããšããã¹ãŠãã¹ã ãŒãºã«é²ã¿ãŸãã åºåã¯åŸ©å·åããããã¡ã€ã«gxp1400prog.binã§ã
prov_enc-ç»åãæå·åããŠæ»ããŸãããç¹å¥ãªåœ¢åŒã®ç»åãå¿ èŠã§ãã
ç»åãã©ãŒãããã«ã€ããŠããã«è©³ããïŒ
ã€ã¡ãŒãžã¯ãããããŒãšsquashfsãã¡ã€ã«ã·ã¹ãã ãªã©ã®æçšãªããŒã¿èªäœã§æ§æãããŸãã
以äžã¯ç»åããããŒgxp2130prog.binã®äŸã§ã
ããããŒã¯æåã®0x5Cãã€ããåãåããŸãã圢åŒã¯æ¬¡ã®ãšããã§ãã
struct header { DWORD signature; DWORD version; DWORD size_max; DWORD size; WORD image_id; WORD checksum; WORD ts_year; WORD ts_month_day; WORD ts_time; WORD oem_id; DWORD FW_V_Mask; WORD supported_bits1; WORD supported_bits2; WORD supported_bits3; WORD supported_bits4; WORD HW_id; }
ãã¹ãŠã®ãã£ãŒã«ãã®ç®çã¯æ確ã§ã¯ãããŸããããéèŠã§ã¯ãããŸãããäž»ãªãã®ãèæ ®ããŠãã ããã
versionã¯ããŒãžã§ã³ã§ãããã¡ãŒã ãŠã§ã¢ãé»è©±æ©ã«ãã©ãã·ã¥ããå Žåããã®ããŒãžã§ã³ã¯çŸåšãããé«ããªããã°ãªããŸãã
size-ãã¡ãŒã ãŠã§ã¢å ã®æçšãªããŒã¿ã®ãµã€ãºããã®ãã©ã¡ãŒã¿ãŒã¯prov_encãšæå·åã䜿çšããŸã
ãã§ãã¯ãµã -ãã¡ãŒã ãŠã§ã¢ã®ãã§ãã¯ãµã ããã¡ãŒã ãŠã§ã¢ã埩å·åãããšãã«äœ¿çšãããäžèŽããªãå Žåããã¡ãŒã ãŠã§ã¢ã¯æŽæ°ããããåŸã§çæãããŸãã æ¥ä»ãä¿®æ£ã§ããããšãé€ããŠãæ®ãã®ããããŒãã£ãŒã«ãã¯å ã®ããããŒãã£ãŒã«ãã®ãŸãŸã«ããŠãã ããã
次ã«ãããããŒã¯ãµã€ãº0x5CãŸã§ãŒãã§ã
ãã€ããŒãã¯ãªãã»ãã0x200ããååŸãããããããŒãšãã€ããŒãã®éã®ã¹ããŒã¹ããŠãããã§è©°ãŸã£ãŠããŸã...
ããã¯ã埩å·åããããã¡ãŒã ãŠã§ã¢ã®å€èŠ³ã§ãããã®åœ¢åŒã§ã¯ãããããŒãšãšãã«ãã©ãã·ã¥ã«æžã蟌ãŸããŸãã
prov_encãŠãŒãã£ãªãã£ã¯ç°ãªã圢åŒã§åäœããŸãã å ¥åã«ã¯ãæçšãªããŒã¿ãæåã«ç§»åãããã¡ã€ã«ãšããã®çŽåŸïŒãã¡ã€ã«ã®æåŸïŒã«ãµã€ãº0x5Cã®ããããŒãå¿ èŠã§ãã prov_encã¯ãããããŒãããã€ããŒãã®ãµã€ãºãèªã¿åããããããæå·åããŠãããããããŒèªäœãæå·åããŸãã ããããŒã§ã¯åžžã«æåã®32ãã€ãã®ã¿ãæå·åãããæ®ãã®ãã€ãã¯æå·åãããŸããã æå·åããããã¡ã€ã«ãçµã¿ç«ãŠãŠprov_packãŠãŒãã£ãªãã£ãã¡ãŒã ãŠã§ã¢ã«æ»ãã«ã¯ãæåã®åœ¢åŒã«å€æããå¿ èŠããããŸãã æ¢ã«æå·åãããããããŒããã¡ã€ã«ã®å é ã«ç§»åãããã¡ãŒã ãŠã§ã¢ã®æå·åãããæ¬äœããªãã»ãã0x200ã«é 眮ããŸãã
ãã®ããã«prov_encãéå§ããŸãïŒ
ããã®ãã¹ãŠã¯prov_decã«äŒŒãŠããŸããprov_enc nokey gxp1400prog.bin gxp1400prog.bin
prov_pack-æå·åããããã¹ãŠã®ãã¡ãŒã ãŠã§ã¢ãã¡ã€ã«ãåäžã®ãã¡ãŒã ãŠã§ã¢ã«åéããé»è©±æ©ã®ãã¡ãŒã ãŠã§ã¢ã«å¯Ÿå¿
prov_pack nokey gxp1400fw.bin gxp1400boot.bin gxp1400recovey.bin gxp1400core.bin gxp1400base.bin gxp1400prog.bin
åºåã§ã¯ããã¡ãŒã ãŠã§ã¢ã®æºåãã§ããgxp1400fw.binãã¡ã€ã«ããããŸãã
é»è©±èªäœãããqemuä»®æ³ãã·ã³ã§ãããã®ãŠãŒãã£ãªãã£ã䜿çšããæ¹ã䟿å©ã§ãã
ãããç·LED
次ã«ããã¹ãŠãéå§ããããšããäºå®ã«ç§»ããBLFããŒã®ç·è²ã®LEDããªãã«ããŸãã
gs_guiããã»ã¹ã¯ãé»è©±ã®GUIãæ åœããŸãã/app/gui/ã«ããã/ app / gui / libã®ã©ã€ãã©ãªã®å±±ã䜿çšããŸãã
/ app / guiãã©ã«ããŒå ã®LEDãšããåèªã§grepãäœæããã©ã€ãã©ãªlibFramework.so.1.0.0ãèŠã€ããŸãã
ããã«ãããã¹ãŠã®æ©èœã«ã¯äººéã®ååããããããã³ã³ãã¥ãŒã¿ãŒã«ããŒãžããŠIDAã«ããŒãããŸãã
èå³æ·±ãååã®turnOnMKPLEDãæã€é¢æ°ãèŠã€ãããŸãããå¥ã®writeToFileé¢æ°ãåŒã³åºãããŸãïŒLEDCOLORãintãboolïŒ
以äžã¯åœŒå¥³ã®äœåã§ãã
ã芧ã®ãšããããã¡ã€ã«/ proc / sys / dev / led / *ã¯LEDãæäœããããã«äœ¿çšãããŸã
ãšã³ãŒçµç±ã§ãããã®ãã¡ã€ã«ã«ããŒã¿ãæžã蟌ãããšãããšãprog_greenãã¡ã€ã«ãšprog_redãã¡ã€ã«ãBLFïŒMKPïŒããŒãæ åœããŠããããšãããããŸããã
ãããã£ãŠãç·è²ã®LEDã®ç¹ç¯ãçŠæ¢ããã«ã¯ãprog_greenãã¡ã€ã«ãžã®æžã蟌ã¿ãçŠæ¢ããã ãã§ãã 16é²ãšãã£ã¿ã§ãç·ã®è¡šã®1æåãå€æŽããŸããã
ããã§ãããããé©çšããlibFramework.so.1.0.0ãé»è©±æ©ã«æ»ãå¿ èŠããããŸãã ãã®ããã®ã«ã¹ã¿ã ãã¡ãŒã ãŠã§ã¢ãäœæããŸãããã
/ appãã£ã¬ã¯ããªã¯gxp2130prog.binã€ã¡ãŒãžã«å«ãŸããŠããŸãã ãã¡ãŒã ãŠã§ã¢ã解åãããã®ã€ã¡ãŒãžã埩å·åããŸãã 次ã«ã16é²ãšãã£ã¿ãŒã§ããã¹ãŠã0x200ã®ãªãã»ããã«ããªãã³ã°ããŠãsquashfsã€ã¡ãŒãžãååŸããŸãã
squashfsã䜿çšããã«ã¯ãsquashfs-toolsãŠãŒãã£ãªãã£ã®ã»ãããå¿ èŠã§ãã
Centosãã£ã¹ããªãã¥ãŒã·ã§ã³ã®ããŒãžã§ã³4.0ã¯è§£åã§ããªãã£ãããããœãŒã¹ããããŒãžã§ã³4.2ããã«ãããå¿ èŠããããŸãã
ããŒã ãé梱ãã
ã³ã³ãã³ãã¯squashfs-rootãã£ã¬ã¯ããªã«ãããŸã./unsquashfs gxp2130prog.bin
次ã«ããã¡ã€ã«libFramework.so.1.0.0ãç§ãã¡ã®ãã®ã«å€æŽããŠãããã¯ãçŽããŸã
次ã«ãèŠåºããæºåããå¿ èŠããããŸãã éå§ããã«ã¯ãå ã®gxp2130prog.binããããããŒãååŸããsquashfsã€ã¡ãŒãžã®æåŸã«ã³ããŒããŸãã 次ã«ãããŒãžã§ã³ãšãµã€ãºãä¿®æ£ããå¿ èŠããããŸãã ãµã€ãºã¯ããã£ãã·ã§ã³ãªãã®squashfsã€ã¡ãŒãžèªäœã®ãµã€ãºã§ãã 次ã«ããã§ãã¯ãµã ãèšç®ããå¿ èŠããããŸãã çæçšã®Cã³ãŒãã次ã«ç€ºããŸãïŒPythonã®å Žåãäœããã®çç±ã§åæ§ã®ã³ãŒãã200åé ãåäœããŸããããã¢ãŒã ãšãã¥ã¬ãŒã·ã§ã³ã䜿çšããŠqemuã§éå§ããŸããïŒ./mksquashfs squashfs-root new.bin -comp xz -all-root -noappend -always-use-fragments
#include <stdio.h> void main(int argc, char *argv[]) { FILE *f; int summ=0; int word; char buff[32]; int i; f = fopen(argv[1],"rb"); if(f) { while(fread(buff,32,1,f) != 0) { for(i=0;i<32;i+=2) { word = buff[i]; word |= buff[i+1]<<8; summ += word; summ &= 0xFFFF; } } printf("%d\n",0x10000-summ); } else printf("Error\n"); }
次ã«ãåã®ã»ã¯ã·ã§ã³ã§èª¬æããããã«ããã¡ã€ã«ãæå·åããããããŒãåé 眮ããŠãã¡ãŒã ãŠã§ã¢ãåéããŸãã ãŸãããããç¹æ» ãããŸãã
å ã®ãã¡ãŒã ãŠã§ã¢ãè¿ãå Žåã¯ãé»è©±ã§ã«ãŒãããã³ãã³ããå ¥åããå¿ èŠããããŸã
nvram set force_upgrade=1
ãããŠãé»è©±æ©ã¯ãã¹ãŠã®ãã¡ãŒã ãŠã§ã¢ããã©ãã·ã¥ããŸãã ããŒãžã§ã³ã«é¢ä¿ãªãã
èå³ãããã°ãGrandstreamé»è©±ã®ããããžã§ãã³ã°ïŒã©ãã«ãæžãããŠããªããã¥ã¢ã³ã¹ããããŸãïŒããã³éããweb-apiã«é¢ãã詳现ãªèšäºãæžãããšãã§ããŸãã
updïŒGXV3140ã§å¿çãçæããããã®ç§å¯ããããŸããã
:gshz: