telnetd for android

來源:互聯網
上載者:User

adb登入上去,執行telnetd發現可以執行,說明android系統內建了telnetd

但從用戶端串連發現每次介面一閃而過,無法成功登入,懷疑是android內建的telnetd有問題,於是改用busybox的telnetd,發現存在同樣的問題。抓包也沒看出什麼異常錯誤提示,就是每次使用putty登入一閃而過就完了。

在網上搜尋了一下,終於找到原因了:

因為android系統裡面沒有login程式,所以我們從用戶端登入後系統找不到要啟動的Shell,就直接退出了(telnetd預設執行/bin/login程式)。所以解決方案很簡單:

在adb下執行:

telnetd -l /system/bin/sh      <-開啟telnet服務,加的參數是告訴系統收到telnet請求時直接啟動shell>

這裡順便介紹一下telnetd的參數:

Usage: telnetd [OPTIONS]

Handle incoming telnet connections
        -l LOGIN        Exec LOGIN on connect
        -f ISSUE_FILE   Display ISSUE_FILE instead of /etc/issue
        -K              Close connection as soon as login exits
                        (normally wait until all programs close slave pty)
        -p PORT         Port to listen on
        -b ADDR[:PORT]  Address to bind to
        -F              Run in foreground
        -i              Inetd mode
        -w SEC          Inetd 'wait' mode, linger time SEC
        -S              Log to syslog (implied by -i or without -F and -w)

原文地址:

http://hi.baidu.com/hf_zd/item/de7514c58710512746d5c095

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.