找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
楼主: ach***

唤醒华为智能网关光猫隐藏的小宇宙:OpenWRT

 火.. [复制链接]
发表于 2019-1-9 18:22 | 显示全部楼层
厉害了,先留贴备用!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-1 00:10 | 显示全部楼层
嗨,我又来了,之前看你的帖子捯饬过一回,无果,但因为用的桥接接的软路由,所以无果就无果吧
这次是丢掉了软路由,直接8145裸奔了,所以又回到你这个贴上上来。
在1.1.1步骤无错,在1.1.2开始报错cd /tmp && rm hw_ctree* 错误为 rm: can't remove 'hw_ctree*': No such file or directory,感觉这个没问题,下一步
在1.2步骤中,mkdir etc/rc.d && cd etc/rc.d 报错说已经建立过etc/rc.,,,mkdir: can't create directory 'etc/rc.d': File exists,可能是之前建立过的,直接cd etc/rc.d进行下一步
接着ln -s ../init.d/dropbear S50dropbear报错,ln: S50dropbear: File exists估计也是之前留下的,无视,下一步
1.3里你帖子里说ssh的密码跟原系统密码一致,但我试了超级密码telecomadmin,useradmin,root/adminHW,可是都进不去。网上找到ssh-keygen -t rsa命令,报错提示命令不存在,那现在想进行下一步需要怎么做呢?

点评

如果是按我给的步骤做过了的话,运行第二次的时候,root的密码肯定就不正确了。 不过如果你是想用密钥免密码的方式进入的话,可以用 dropbearkey 这个命令来产生密钥对。 在没有进入 op 之前,这个文件路径应该  详情 回复 发表于 2019-2-3 09:02
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-2 06:20 来自手机 | 显示全部楼层
支行,必须支持一哈
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-2-3 09:02 | 显示全部楼层
aini50563 发表于 2019-2-1 00:10
嗨,我又来了,之前看你的帖子捯饬过一回,无果,但因为用的桥接接的软路由,所以无果就无果吧
这次是丢掉 ...

如果是按我给的步骤做过了的话,运行第二次的时候,root的密码肯定就不正确了。

不过如果你是想用密钥免密码的方式进入的话,可以用 dropbearkey 这个命令来产生密钥对。
在没有进入 op 之前,这个文件路径应该在 /opt/upt/apps/apps/usr/bin/dropbearkey


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

感谢回复,我用root/adminHW可以进入Telnet,whoami回复srv_ssmp ,二次提权su后,whoami回复root,输入admin可以进入,srv_ssmp 可以运行你给的命令,dropbearkey -t rsa -f id_rsa ,root不能运行dropbearkey -t  详情 回复 发表于 2019-2-3 11:24
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-3 11:24 | 显示全部楼层
本帖最后由 aini50563 于 2019-2-3 12:27 编辑
achaoge 发表于 2019-2-3 09:02
如果是按我给的步骤做过了的话,运行第二次的时候,root的密码肯定就不正确了。

不过如果你是想用密钥 ...

感谢回复,我用root/adminHW可以进入Telnet,whoami回复srv_ssmp ,二次提权su后,whoami回复root,输入admin可以进入,srv_ssmp 可以运行你给的命令,dropbearkey -t rsa -f id_rsa  ,root不能运行dropbearkey -t rsa -f id_rsa,提示只读权限,用vi编辑 /opt/upt/apps/apps/usr/bin/dropbearkey ,打开是乱码。。。我现在的想法是找到或者生成新的ssh密码,免不免密码输入无所谓

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

看样子你是一点点 linux 的命令行概念也没有。 那你进入命令行之后,运行如下命令(一条一条的执行): 然后把当前目录下的文件 id_rsa 想办法保存到你的电脑上(用U盘或者 tftp),作为私钥导入到你用的Secur  详情 回复 发表于 2019-2-11 14:41
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-2-11 14:41 | 显示全部楼层
aini50563 发表于 2019-2-3 11:24
感谢回复,我用root/adminHW可以进入Telnet,whoami回复srv_ssmp ,二次提权su后,whoami回复root,输入a ...

看样子你是一点点 linux 的命令行概念也没有。

那你进入命令行之后,运行如下命令(一条一条的执行):
  1. cd /tmp
  2. dropbearkey -t rsa -f id_rsa
  3. dropbearkey -y id_rsa |grep ssh-rsa > /opt/upt/apps/apps/etc/dropbear/authorized_keys
复制代码


然后把当前目录下的文件 id_rsa 想办法保存到你的电脑上(用U盘或者 tftp),作为私钥导入到你用的SecureCRT 里面,就可以免密码登录了。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-12 08:59 | 显示全部楼层
achaoge 发表于 2019-2-11 14:41
看样子你是一点点 linux 的命令行概念也没有。

那你进入命令行之后,运行如下命令(一条一条的执行):
...

万分感谢,到时候回家试试

点评

我真是太笨了,看来是得好好的多学习下linux啊cd /tmp[/backcolor] dropbearkey -t rsa -f id_rsa 这个应该是在tmp文件夹下生成rsa加密的私钥,文件名为id—rsa[/backcolor] dropbearkey -y id_rsa |grep ssh-rsa  详情 回复 发表于 2019-2-12 23:03
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-12 16:44 | 显示全部楼层
烽火hg6821t-u,hg6201t-u里的openwrt

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-12 17:00 | 显示全部楼层
就是没有替代的软件源,原软件源是:http://downloads.openwrt.org/chaos_calmer/1.1/MT7526/packages/
另自带的opkg不能在本地安装和移除软件包,要通过电信app平台才能安装和移除。
我把opkg删除,app平台也不能安装和移除软件包,说明还是通过opkg操作的,只是不知指令是什么?

点评

电信平台是通过一个cloudclient的进程主动链接到电信服务器控制的  详情 回复 发表于 2019-3-22 14:33
这个是 mtk 的mips架构的CPU,所以找相类似的就可以了,比如mtk 7621 的试试。 手上没有这款猫,所以不清楚你说的不能通过opkg 安装软件是什么意思,如果有详细的错误信息,也许我可以帮你参考一下。  详情 回复 发表于 2019-2-13 09:34
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-12 23:03 | 显示全部楼层
aini50563 发表于 2019-2-12 08:59
万分感谢,到时候回家试试

我真是太笨了,看来是得好好的多学习下linux啊cd /tmp
dropbearkey -t rsa -f id_rsa  这个应该是在tmp文件夹下生成rsa加密的私钥,文件名为id—rsa
dropbearkey -y id_rsa |grep ssh-rsa > /opt/upt/apps/apps/etc/dropbear/authorized_keys这个是在对应的文件夹下建立相应的免密的key文件,
然后你让我导出id—rsa密钥文件出来导入crt使用,我导出后是导入不了crt的,crt可以用公钥密钥登陆,但好像只有密钥是不行的。
没有公钥不行好办,crt可以创建公钥,一并有密钥,还可以转换成openssh格式,好吧直接生成authorized_keys名字的公钥密钥,然后用tftp把公钥公钥放到 /opt/upt/apps/apps/etc/dropbear 下面,我发现 /opt/upt/apps/apps/etc/dropbearauthorized_keys是可以编辑的,内容跟authorized_keys.pub是一样的,然后重启光猫,其实重启光猫的作用是重启dropbearkey服务对吧?
重启后重新建立以公钥鉴权的连接,但crt要求用户名和密码来验证,纳尼???这不又回到起点了?只是不用次次输入密码,关键是我现在不知ssh的root的密码,难道还是我哪里没有理解对?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×

点评

OK, 慢慢进入正轨了。 有个概念纠正一下,我的例子中,id_rsa 文件是密钥对里面的私钥,这个是保存到你电脑上的,而 authorized_keys 是保存的公钥,公钥和私钥需要配对成功才会允许你免密码登录。 而在你的操  详情 回复 发表于 2019-2-13 09:30
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-2-13 09:30 | 显示全部楼层
aini50563 发表于 2019-2-12 23:03
我真是太笨了,看来是得好好的多学习下linux啊cd /tmp
dropbearkey -t rsa -f id_rsa  这个 ...

OK, 慢慢进入正轨了。

有个概念纠正一下,我的例子中,id_rsa 文件是密钥对里面的私钥,这个是保存到你电脑上的,而 authorized_keys 是保存的公钥,公钥和私钥需要配对成功才会允许你免密码登录。

而在你的操作过程中,你是在尝试把你生成的公钥上传到OP里面,所以OP才需要你先提供认证的密码,不然谁都可以上传公钥来免密登录了。

现在你已经有了自己生成的公钥和私钥了,你需要把你公钥的内容加入到我例子中的 authorized_keys 文件中。方法也很简单,把公钥文件上传上去并覆盖那个文件就可以免密了。

点评

我严格按照你说的流程和方法来操作,但是最后一步登陆的时候还是要密码,迷糊了不知道哪里错误。 具体步骤如下: 1,首先用crt生成rsa编码的密钥对,Identity和Identity.pub 2 , 用tftp把Identity.pub上传到光猫  详情 回复 发表于 2019-2-13 11:22
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-2-13 09:34 | 显示全部楼层
zhxush62 发表于 2019-2-12 17:00
就是没有替代的软件源,原软件源是:http://downloads.openwrt.org/chaos_calmer/1.1/MT7526/packages/
另 ...

这个是 mtk 的mips架构的CPU,所以找相类似的就可以了,比如mtk 7621 的试试。

手上没有这款猫,所以不清楚你说的不能通过opkg 安装软件是什么意思,如果有详细的错误信息,也许我可以帮你参考一下。

点评

我试过mtk7621,7620都不行,这是自带的opkg安装出现的提示。 [attachimg]269325[/attachimg][attachimg]269329[/attachimg]  详情 回复 发表于 2019-2-13 15:52
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-13 11:22 | 显示全部楼层
achaoge 发表于 2019-2-13 09:30
OK, 慢慢进入正轨了。

有个概念纠正一下,我的例子中,id_rsa 文件是密钥对里面的私钥,这个是保存到 ...

我严格按照你说的流程和方法来操作,但是最后一步登陆的时候还是要密码,迷糊了不知道哪里错误。
具体步骤如下:
1,首先用crt生成rsa编码的密钥对,Identity和Identity.pub
2 , 用tftp把Identity.pub上传到光猫
3,用Identity.pub覆盖/opt/upt/apps/apps/etc/dropbear/authorized_keys文件
4,登陆测试,但失败了

具体log如下:
Welcome Visiting Huawei Home Gateway
Copyright by Huawei Technologies Co., Ltd.

Login:
User name is wrong, please try it again!
Login:root
Password:
WAP>su
success!
SU_WAP>shell

BusyBox v1.18.4 (2017-06-30 17:46:01 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

profile close core dump
WAP(Dopra Linux) # cd /tmp
WAP(Dopra Linux) # ls
QoE         diaginfo    plugin.log
WAP(Dopra Linux) # tftp -g -l Identity.pub 192.168.100.10
WAP(Dopra Linux) # ls
Identity.pub  QoE           diaginfo      plugin.log
WAP(Dopra Linux) # mv Identity.pub /opt/upt/apps/apps/etc/dropbear/authorized_ke
ys
mv: overwrite '/opt/upt/apps/apps/etc/dropbear/authorized_keys'? y
^@WAP(Dopra Linux) #
WAP(Dopra Linux) # cd /opt/upt/apps/apps/etc/dropbear/
WAP(Dopra Linux) # ls
authorized_keys        dropbear_dss_host_key  dropbear_rsa_host_key
WAP(Dopra Linux) # vi authorized_keys

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCmKDK90WjTTs01Pg1ddmPZqpArEKJ5PiRi5zK8U6Ep



另,百度到除了/opt/upt/apps/apps/etc/dropbear/这里路径,光猫里还有/etc/dropbear这个路径,
WAP(Dopra Linux) # cd /etc/dropbear
WAP(Dopra Linux) # ls
dropbear_rsa_host_key
WAP(Dopra Linux) #

是否是因为光猫里原来的dropbear还在启用是原因?

点评

嗯,是的,不排除你是你光猫的dropbear在启动。 所以如果可以的话,可以把你的 ps -w 命令的输出情况贴出来参考一下。 另外也需要看看你的 hw_ctree.xml 的文件内容,是否是把光猫的 ssh 给禁用了。  详情 回复 发表于 2019-2-13 12:15
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2019-2-13 12:15 | 显示全部楼层
aini50563 发表于 2019-2-13 11:22
我严格按照你说的流程和方法来操作,但是最后一步登陆的时候还是要密码,迷糊了不知道哪里错误。
具体步 ...

嗯,是的,不排除你是你光猫的dropbear在启动。

所以如果可以的话,可以把你的 ps -w 命令的输出情况贴出来参考一下。

另外也需要看看你的 hw_ctree.xml 的文件内容,是否是把光猫的 ssh 给禁用了。

点评

解密查看文件,应该是关闭自带dropbear,启用ssh了, root的密码这一大串,应该也用不了  详情 回复 发表于 2019-2-13 13:32
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2019-2-13 13:12 | 显示全部楼层
唔 ,在用进程
Welcome Visiting Huawei Home Gateway
Copyright by Huawei Technologies Co., Ltd.

Login:
User name is wrong, please try it again!
Login:root
Password:
WAP>su
success!
SU_WAP>shell

BusyBox v1.18.4 (2017-06-30 17:46:01 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

profile close core dump
WAP(Dopra Linux) # ps -w
  PID USER       VSZ STAT COMMAND
    1 root      1352 S    init
    2 root         0 SW   [kthreadd]
    3 root         0 SW   [ksoftirqd/0]
    4 root         0 SW   [kworker/0:0]
    5 root         0 SW<  [kworker/0:0H]
    6 root         0 SW   [kworker/u8:0]
    7 root         0 SW   [migration/0]
    8 root         0 SW   [rcu_bh]
    9 root         0 SW   [rcu_sched]
   12 root         0 SW   [migration/1]
   13 root         0 SW   [ksoftirqd/1]
   14 root         0 SW   [kworker/1:0]
   15 root         0 SW<  [kworker/1:0H]
   16 root         0 SW<  [khelper]
   17 root         0 SW<  [netns]
   91 root         0 SW<  [writeback]
   94 root         0 SW<  [bioset]
   95 root         0 SW<  [crypto]
   97 root         0 SW<  [kblockd]
  109 root         0 SW<  [cfg80211]
  130 root         0 SW   [khungtaskd]
  131 root         0 SW   [kswapd0]
  181 root         0 SW   [fsnotify_mark]
  233 root         0 SW   [kboxd]
  237 root         0 SW<  [deferwq]
  260 root         0 SW   [ubi_bgt0d]
  363 root         0 SW<  [kworker/0:1H]
  364 root         0 SW<  [kworker/1:1H]
  535 root      1812 S    collect_pipe
  551 root         0 SW   [wap_wq]
  553 root     10008 S    kmsgread
  620 root         0 DW   [phy_manager]
  743 root         0 SW   [ubifs_bgt0_16]
  833 root         0 SW   [khubd]
  858 root         0 SW   [kworker/u8:2]
  972 root         0 SW   [sniffer_thread]
  997 root         0 SW   [kTimerTask]
1153 root         0 SW<  [dev_workqueue]
1178 root         0 SW<  [optic_status_wo]
1180 root     10472 S    hw_ldsp_xpon_adpt
1188 root         0 SW   [watchdog/0]
1189 root         0 SW   [watchdog/1]
1207 root      204m S    bbsp
1225 cfg_oam  60676 S    oam
1226 srv_igmp 51492 S    igmp
1227 srv_wifi 64816 S    wifi
1228 root         0 SW   [kworker/0:2]
1229 cfg_cwmp 38268 S    cwmp
1230 srv_etho 44744 S    ethoam
1231 srv_ssmp  109m S    ssmp
1232 srv_amp  54184 S    amp
1233 srv_voic 81020 S    voice_h248sip
1262 root      1656 S    dbus-daemon --system
1298 root         0 SW   [kworker/1:2]
1303 root         0 SW   [ubifs_bgt0_13]
1333 root     42076 S    procmonitor ssmp amp voice_h248sip
1350 root      1356 S    sh -c ip6tables-restore -n
1351 root      1812 S    ip6tables-restore -n
1385 srv_ssmp  1640 S    bftpd -d -p 21
1448 root         0 SW   [TraceSendMsgTas]
1449 root         0 SW   [SDPktSend]
1450 root         0 SW   [SDPktRecv]
1451 root         0 SW   [SDPktRtcp]
1452 root         0 SW   [SDRecv]
1453 root         0 SW   [SDMsgTimeout]
1454 root         0 SW   [SDMsgProc]
1457 root         0 SW   [SDTDMTrace0]
1458 root         0 SW   [SDTDMTrace1]
1470 root         0 SW<  [codec_workqueue]
1474 root         0 SW   [mpcp]
1501 root      9320 S    dnsmasq --conf-file=/var/dnsmasq_lo.conf
1503 root      1356 S    sh -c iptables-restore -n
1504 root      1916 S    iptables-restore -n
1683 root      1440 S    pppd nic-wan6 unit 262 maxfail 0 persist +ipv6 debug echo_interval 30 echo_fails 6 mru 1492 maxmru 1500 h
1717 root      1312 S    dhcpd
1933 root      1112 S    radvd -d 1 -n -m stderr
1949 root      129m S    upnpdmain !br+ br0 49652
2212 root      9320 S    dnsmasq --conf-file=/var/dnsmasqwan1.5.ip1.conf
2242 root     27496 S N  apm
2250 srv_appm 96664 S    app_m
2252 root     45024 S    usb_mngt
2253 root     23764 S    ldspcli
2288 root         0 SW   [RtmpCmdQTask]
2289 root         0 SW   [RtmpWscTask]
2290 root         0 SW   [MlmeTask-7603]
2292 root         0 SW   [RtmpAcsTask]
2323 root      1360 S    /bin/sh /bin/console.sh
2461 root      9316 S    dnsmasq --conf-file=/var/dnsv6/dnsmasq_ppp262.conf
2539 root      9344 S    dnsmasq --conf-file=/var/dnsmasqwan1.6.ppp1.conf
2576 srv_ssmp  1928 S    sntp
2607 root         0 SW   [RtmpCmdQTask]
2608 root         0 SW   [RtmpWscTask]
2609 root         0 SW   [RtmpMlmeTask]
2610 root         0 SW   [RtmpAcsTask_761]
2627 root      9320 S    dnsmasq --conf-file=/var/dnsv6/dnsmasq_br0.conf
2631 root      130m S    udm
2745 root      128m S    ctrg_m
2750 srv_web   1360 S    sh -c taskset 3 web
2751 srv_web  45732 S    web
2819 root     21328 S    saf-huawei service 17 18 19
2832 root     21328 S    [lxc monitor] /opt/upt/framework saf
2836 root      1104 S    /sbin/procd
3027 root       904 S    /sbin/ubusd
3028 root       700 S    /sbin/askfirst /bin/ash
3092 root      1420 S    /sbin/logd -S 512
3093 root      1008 S    /sbin/logread -f -F /opt/apps/ctsgw.log -p /var/run/logread.1.pid -S 512 -L notice
3102 root      1264 S    /sbin/rpcd
3111 root     39464 S    /sbin/appmgr
3119 root      6308 S    /sbin/cloudclient localserver
3120 root     39376 S    /sbin/cloudclient
3135 root      1004 S    /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 22 -K 300
3149 root      3804 S    /usr/sbin/uhttpd -f -h /www -r SAF -x /cgi-bin -t 60 -T 30 -k 20 -A 1 -n 3 -N 100 -R -p 0.0.0.0:80 -p [::
3269 root     39464 S    /sbin/appmgr
3272 root     39464 S    /sbin/appmgr
3275 root     39464 S    /sbin/appmgr
3277 root     39464 S    /sbin/appmgr
3279 root      1308 S    /sbin/init.lxc --quiet -- /files/b01odm
3280 200       1308 S    /sbin/init.lxc --quiet -- /files/inter_connd
3282 root      1308 S    /sbin/init.lxc --quiet -- /files/u01
3284 200      37796 S    /files/inter_connd
3285 root      1308 S    /sbin/init.lxc --quiet -- /files/xrobot
3286 root       836 S    /files/b01odm
3290 root       836 S    /files/u01
3292 root     78676 S    m01-b01-inner
3296 root     44744 S    m01-u01
3301 root     54560 S    /files/xrobot
3416 root      1240 S    dhcp6c -c /var/ipv6/dhcp6c/ppp262/dhcp6c.conf -t wan6 -f -p /var/ipv6/dhcp6c/ppp262/dhcp6c.pid -o /var/ip
3461 root      1220 S    dhcp6s -f -c /var/ipv6/dhcp6s/dhcp6s.conf br0
3502 root      9344 S    dnsmasq --conf-file=/var/dnsmasq_br0.conf
3963 srv_ssmp 99.3m S    clid
3971 srv_ssmp  1356 S    /bin/sh --wap
12706 srv_ssmp  1356 S    /bin/sh --wap
12715 srv_ssmp  1372 S    /bin/sh --login
12732 srv_ssmp  1352 R    ps -w
WAP(Dopra Linux) #

点评

只有一个 dropbear 的进程,而且是 /usr/sbin/dropbear ,这个应该是OP里面的dropbear启动了。 现在的问题应该就是你的dropbear 是否开启了密钥认证; 改密码这个事情简单,cat /opt/upt/apps/apps/etc/shadow  详情 回复 发表于 2019-2-13 13:57
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-25 16:39

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表