美文网首页
Mac终端cmd控制设备 SSH_Over_USB

Mac终端cmd控制设备 SSH_Over_USB

作者: 愤斗的小蚂蚁 | 来源:发表于2021-03-03 11:55 被阅读0次

一、Mac终端cmd控制设备 SSH_Over_USB

安装 usbmuxd

usbmuxd 安装细节

安装 MonkeyDev/wiki

MonkeyDev 报错CydiaSubstrate.tbd处理方法
Building for iOS, but linking in .tbd file (/opt/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd) built for iOS Simulator, file '/opt/theos/vendor/lib/CydiaSubstrate.framework/CydiaSubstrate.tbd' for architecture arm64

越狱设备命令cmd等插件和安装ipa包

二、常用cmd命令

killall -9 SpringBoard // 重启App桌面

open com.apple.Preferences // 打开设置

killall -9 Preferences // 关闭设置

open YourAppBundleID // 打开App

killall -9 YourAppName // 关闭App

三、命令操作

AppledeMac-mini:~ apple$ 
AppledeMac-mini:~ apple$ ssh -P2222 root@localhost
ssh: connect to host localhost port 22: Connection refused
AppledeMac-mini:~ apple$ ssh localhost
ssh: connect to host localhost port 22: Connection refused
AppledeMac-mini:~ apple$ 
AppledeMac-mini:~ apple$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:P3X5QOIilX5bTb/OJvDQjLgCIu8FRL3qoMf0Gj5SGmY.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': no
Host key verification failed.
AppledeMac-mini:~ apple$ 
AppledeMac-mini:~ apple$ ssh -P2222 root@localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:P3X5QOIilX5bTb/OJvDQjLgCIu8FRL3qoMf0Gj5SGmY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:2228' (RSA) to the list of known hosts.
root@localhost's password: 
4136-142-b:~ root# exit
logout
Connection to localhost closed.
AppledeMac-mini-2:~ apple$ 
AppledeMac-mini-2:~ apple$ 
AppledeMac-mini-2:~ apple$ ssh -p2228 root@localhost
ssh_exchange_identification: read: Connection reset by peer
AppledeMac-mini-2:~ apple$ ssh -p2228 root@localhost
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:5qn0rLzl2lSSTNnwiOMLFe46Wpffhrnnc+SSwnkob3s.
Please contact your system administrator.
Add correct host key in /Users/apple/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/apple/.ssh/known_hosts:1
RSA host key for [localhost]:2228 has changed and you have requested strict checking.
Host key verification failed.
AppledeMac-mini-2:~ apple$ rm /Users/apple/.ssh/known_hosts
AppledeMac-mini-2:~ apple$ ssh -p2228 root@localhost
The authenticity of host '[localhost]:2228 ([127.0.0.1]:2228)' can't be established.
RSA key fingerprint is SHA256:5qn0rLzl2lSSTNnwiOMLFe46Wpffhrnnc+SSwnkob3s.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:2228' (RSA) to the list of known hosts.
root@localhost's password: 
413612-black:~ root# 
413612-black:~ root# launchctl load /Library/LaunchDaemons/com.oych.ModianDaemon.plist 
413612-black~ root# 
413612-black:~ root# launchctl load /Library/LaunchDaemons/com.oych.ModianDaemon.plist 
/Library/LaunchDaemons/com.oych.ModianDaemon.plist: service already loaded
413612-black~ root# 
413612-black~ root# killall -9 SpringBoard
4136-124-black:~ root# 
413612-black~ root# killall -9 ModianDaemon
4136-124-black:~ root# 
413612-black:~ root# ldid -S /usr/bin/ModianDaemon

ssh: connect to host localhost port 22: Connection refused

屏幕快照 2021-02-25 上午11.40.10.png

说明

1 在mac终端安装2个plist文件到设备
scp -P2228 -r /Users/apple/Desktop/AMT/AutoTest/自动化测试安装文档/com.oych.ModianDaemon.plist root@localhost:/Library/LaunchDaemons/

scp -P2228 -r /Users/apple/Desktop/AMT/AutoTest/ModianTweak_mainPackage/ModianTweak/Package/Library/MobileSubstrate/DynamicLibraries/ModianTweak.plist root@localhost:/Library/MobileSubstrate/DynamicLibraries

2 在mac终端安装2个库文件到设备

scp -P2228 -r /Users/apple/Library/Developer/Xcode/DerivedData/ModianTweak-clcbudtmksrsvhdygrpprhqbhlzw/Build/Products/Debug-iphoneos/ModianDaemon.framework/ModianDaemon root@localhost:/usr/bin

scp -P2228 -r /Users/apple/Library/Developer/Xcode/DerivedData/ModianTweak-clcbudtmksrsvhdygrpprhqbhlzw/Build/Products/Debug-iphoneos/ModianTweak.dylib root@localhost:/Library/MobileSubstrate/DynamicLibraries

3 文件路径
/var/mobile/Library/Preferences/
com.oych.VpnClose.plist

4
launchctl load /Library/LaunchDaemons/com.oych.ModianDaemon.plist plist文件 (第一次使用或重新挂载)

launchctl unload /Library/LaunchDaemons/com.oych.ModianDaemon.plist plist文件 (取消daemon挂载)

killall -9 ModianDaemon // 第一次不用

ldid -S /usr/bin/ModianDaemon

5、越狱方式不同,导致文件读写权限不同,采用沙盒方式
ModianTweak 与 App关联,可以直接读取UD和Sandbox中数据,ModianDaemon是高权限,可以直接读写系统目录和APP中Sandbox数据。

拷贝plist文件到/资源库/LaunchAgents/

tmp02b69e23.png

连接多台设备

tmp1112e5cc.png
tmp13b18585.png

相关文章

网友评论

      本文标题:Mac终端cmd控制设备 SSH_Over_USB

      本文链接:https://www.haomeiwen.com/subject/qbwyfltx.html