iOS逆向之三-authorized_keys ssh登录越狱手机免验证设置

释放双眼,带上耳机,听听看~!

iOS逆向之三-authorized_keys ssh登录越狱手机免验证设置

iOS逆向之一-工具的安装和使用

iOS逆向之二-一个简单的Tweak插件原理解析

iOS逆向之三-authorized_keys ssh登录越狱手机免验证设置

iOS逆向之四-FishHook的简单使用

iOS逆向之五-MACH-O文件解析

 

默认情况下使用ssh登录到iPhone每次都是需要输入密码的,比较繁琐,可以配置ios的authorized_keys和电脑端的一致来简化这个步骤

电脑配置

删除 ~/.ssh/known_hosts文件的配置

known_hosts 的文件如下

➜  .ssh cat known_hosts
192.168.8.220 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7ZyuWzvOD7ZvO4cvz+OI9npOmCLkqIPIEMUg+A0/TL3MxB+KGEC7XaEI4tZb/617w9sIJbH0LeXlwAb7be0lrLDntXnH9mQV0DcI94mfOmMKCZtzBcPiHqYVFiEXi4Gtdn2Ki8wH8s5EvIB+Xtad2ZCoR9KpDFxINw9SkMvxAK5zO6RkoQbe8EHKK2986d+QrnT39HfqymP744RhCABuSkGTyeIFBYJlqjUT+HocLfIrF4MBdQul4JJa7rcm7F3NDp+DLryAh6/yJRsXSlM2RcdkbvhD2Cvvd+YJCcD0LPht1Nibf91htvd2glUjoU4DpIUwd7RI8OvVH+QETXjO9
192.168.8.215 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7ZyuWzvOD7ZvO4cvz+OI9npOmCLkqIPIEMUg+A0/TL3MxB+KGEC7XaEI4tZb/617w9sIJbH0LeXlwAb7be0lrLDntXnH9mQV0DcI94mfOmMKCZtzBcPiHqYVFiEXi4Gtdn2Ki8wH8s5EvIB+Xtad2ZCoR9KpDFxINw9SkMvxAK5zO6RkoQbe8EHKK2986d+QrnT39HfqymP744RhCABuSkGTyeIFBYJlqjUT+HocLfIrF4MBdQul4JJa7rcm7F3NDp+DLryAh6/yJRsXSlM2RcdkbvhD2Cvvd+YJCcD0LPht1Nibf91htvd2glUjoU4DpIUwd7RI8OvVH+QETXjO9

比如说你的iPhone手机IP是192.168.8.215,那么就把这一项的配置删除,删除之后的配置如下即可。

➜  .ssh cat known_hosts
192.168.8.220 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7ZyuWzvOD7ZvO4cvz+OI9npOmCLkqIPIEMUg+A0/TL3MxB+KGEC7XaEI4tZb/617w9sIJbH0LeXlwAb7be0lrLDntXnH9mQV0DcI94mfOmMKCZtzBcPiHqYVFiEXi4Gtdn2Ki8wH8s5EvIB+Xtad2ZCoR9KpDFxINw9SkMvxAK5zO6RkoQbe8EHKK2986d+QrnT39HfqymP744RhCABuSkGTyeIFBYJlqjUT+HocLfIrF4MBdQul4JJa7rcm7F3NDp+DLryAh6/yJRsXSlM2RcdkbvhD2Cvvd+YJCcD0LPht1Nibf91htvd2glUjoU4DpIUwd7RI8OvVH+QETXjO9

生成authorized_keys

➜  ~ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/aron/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/aron/.ssh/id_rsa.
Your public key has been saved in /Users/aron/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:EH+sVXPn72+iXqGMLMEXMtuW9/PNlZcvOixBXezJWBo aron@aron-MacBook-Pro.local
The key's randomart image is:
+---[RSA 2048]----+
|      .     o.. .|
|       o . .Eo+o |
|      . + =. O ..|
|       o O.o+ + .|
|        S.= . . .|
|         =.+ o oo|
|        . ooo +o+|
|         .. o.o+B|
|           o++ +*|
+----[SHA256]-----+

拷贝authorized_keys文件

➜  ~ cd ~/.ssh
➜  .ssh cp id_rsa.pub ~/authorized_keys

ios手机配置

iPhone:/User root# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/var/root/.ssh/id_rsa): Created directory '/var/root/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/root/.ssh/id_rsa.
Your public key has been saved in /var/root/.ssh/id_rsa.pub.
The key fingerprint is:
de:f8:4c:d6:32:9b:6d:68:c9:c0:f5:17:29:3c:94:1e root@iPhone
The key's randomart image is:
+---[RSA 2048]----+
|             .   |
|            E    |
|           + . . |
|          . = o  |
|       .S. . o . |
|       .oo .. .  |
|        oo*o..   |
|         ==*.    |
|         .=..    |
+-----------------+

退出ssh登录,拷贝电脑的authorized_keys文件到iPhone中

iPhone:/User root# logout
Connection to 192.168.1.86 closed.
➜  theos git:(master) ✗ scp ~/authorized_keys root@192.168.1.86:/var/root/.ssh
The authenticity of host '192.168.1.86 (192.168.1.86)' can't be established.
RSA key fingerprint is SHA256:1X8esSMK4inAEDTDKkfVoI+YeFxcatt9HVZONu9UG7M.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.86' (RSA) to the list of known hosts.
root@192.168.1.86's password:
authorized_keys                                                                               100%  409     3.6KB/s   00:00

重新登录,这时候就不需要密码了,包括在tweak的时候也是不用繁琐的密码输入步骤了。

➜  theos git:(master) ✗ ssh root@192.168.1.86

iOS逆向之一-工具的安装和使用

iOS逆向之二-一个简单的Tweak插件原理解析

iOS逆向之三-authorized_keys ssh登录越狱手机免验证设置

iOS逆向之四-FishHook的简单使用

iOS逆向之五-MACH-O文件解析

 

人已赞赏
iOS文章

iOS逆向之一-工具的安装和使用

2020-4-27 21:48:02

iOS文章

iOS逆向之四-FishHook的简单使用

2020-4-27 23:03:02

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索