Use sshpass for scp and ssh

- also rename from arm to armhf
- also other small changes in kdfu
This commit is contained in:
LukeZGD 2023-03-04 18:35:14 +08:00
parent c73328de9a
commit c3e27ed9ee
28 changed files with 32 additions and 12 deletions

View File

@ -47,12 +47,12 @@ jobs:
- name: Move linux arm64 binaries and other files - name: Move linux arm64 binaries and other files
run: | run: |
rm -r ./bin/linux/arm64 rm -r ./bin/linux/arm64
cp -R ./exclude/bin/linux/arm ./bin/linux cp -R ./exclude/bin/linux/armhf ./bin/linux
- name: Zip linux arm files - name: Zip linux armhf files
run: zip -r ${{ github.event.repository.name }}_linux_arm_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip bin/ LICENSE resources/ restore.sh README.md run: zip -r ${{ github.event.repository.name }}_linux_armhf_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip bin/ LICENSE resources/ restore.sh README.md
- name: Move linux arm binaries and other files - name: Move linux armhf binaries and other files
run: | run: |
rm -r ./bin/linux rm -r ./bin/linux
cp -R ./exclude/bin/windows ./bin cp -R ./exclude/bin/windows ./bin
@ -77,7 +77,7 @@ jobs:
files: | files: |
${{ github.event.repository.name }}_complete_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip ${{ github.event.repository.name }}_complete_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_macos_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip ${{ github.event.repository.name }}_macos_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_linux_arm_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip ${{ github.event.repository.name }}_linux_armhf_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_linux_arm64_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip ${{ github.event.repository.name }}_linux_arm64_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_linux_x86_64_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip ${{ github.event.repository.name }}_linux_x86_64_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip
${{ github.event.repository.name }}_windows_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip ${{ github.event.repository.name }}_windows_${{ env.DATE }}-${{ env.SHA_SHORT }}.zip

BIN
bin/linux/arm64/sshpass Executable file

Binary file not shown.

BIN
bin/linux/armhf/sshpass Executable file

Binary file not shown.

BIN
bin/linux/x86_64/sshpass Executable file

Binary file not shown.

BIN
bin/macos/sshpass Executable file

Binary file not shown.

BIN
bin/windows/sshpass Normal file

Binary file not shown.

View File

@ -122,7 +122,7 @@ set_tool_paths() {
if [[ $(uname -m) == "a"* && $(getconf LONG_BIT) == 64 ]]; then if [[ $(uname -m) == "a"* && $(getconf LONG_BIT) == 64 ]]; then
dir+="arm64" dir+="arm64"
elif [[ $(uname -m) == "a"* ]]; then elif [[ $(uname -m) == "a"* ]]; then
dir+="arm" dir+="armhf"
elif [[ $(uname -m) == "x86_64" ]]; then elif [[ $(uname -m) == "x86_64" ]]; then
dir+="x86_64" dir+="x86_64"
else else
@ -284,8 +284,8 @@ set_tool_paths() {
idevicererestore+="$dir/idevicererestore" idevicererestore+="$dir/idevicererestore"
ipwnder+="$dir/ipwnder" ipwnder+="$dir/ipwnder"
irecovery2+="$dir/irecovery2" irecovery2+="$dir/irecovery2"
scp="$(which scp) -F ../resources/ssh_config" scp="scp -F ../resources/ssh_config"
ssh="$(which ssh) -F ../resources/ssh_config" ssh="ssh -F ../resources/ssh_config"
} }
install_depends() { install_depends() {
@ -661,6 +661,20 @@ device_find_mode() {
fi fi
} }
device_sshpass() {
# ask for device password and use sshpass for scp and ssh
local pass=$1
if [[ -z $pass ]]; then
read -s -p "$(input 'Enter the root password of your iOS device: ')" pass
echo
fi
if [[ -z $pass ]]; then
pass="alpine"
fi
scp="$dir/sshpass -p $pass $scp"
ssh="$dir/sshpass -p $pass $ssh"
}
device_enter_mode() { device_enter_mode() {
# usage: device_enter_mode {Recovery, DFU, kDFU, pwnDFU} # usage: device_enter_mode {Recovery, DFU, kDFU, pwnDFU}
# attempt to enter given mode, and device_find_mode function will then set device_mode variable # attempt to enter given mode, and device_find_mode function will then set device_mode variable
@ -729,7 +743,7 @@ device_enter_mode() {
log "Please read the message below:" log "Please read the message below:"
print "1. Make sure to have installed the requirements from Cydia." print "1. Make sure to have installed the requirements from Cydia."
print " - Only proceed if you have followed Section 2 (and 2.1 for iOS 10) in the GitHub wiki." print " - Only proceed if you have followed Section 2 (and 2.1 for iOS 10) in the GitHub wiki."
print " - You will be prompted to enter the root password of your iOS device twice." print " - You will be prompted to enter the root password of your iOS device."
print " - The default root password is \"alpine\"" print " - The default root password is \"alpine\""
print " - Do not worry that your input is not visible, it is still being entered." print " - Do not worry that your input is not visible, it is still being entered."
print "2. Afterwards, the device will disconnect and its screen will stay black." print "2. Afterwards, the device will disconnect and its screen will stay black."
@ -738,8 +752,8 @@ device_enter_mode() {
echo "chmod +x /tmp/kloader*" > kloaders echo "chmod +x /tmp/kloader*" > kloaders
if [[ $device_det == 1 ]]; then if [[ $device_det == 1 ]]; then
echo "[[ -e /.installed_kok3shiX || -e /.installed_p0insettia || -e /.installed_socket ]] && /tmp/kloader /tmp/pwnediBSS || \ echo '[[ $(uname -a | grep -c "MarijuanARM") == 1 ]] && /tmp/kloader_hgsp /tmp/pwnediBSS || \
/tmp/kloader_hgsp /tmp/pwnediBSS" >> kloaders /tmp/kloader /tmp/pwnediBSS' >> kloaders
sendfiles+=("../resources/kloader_hgsp") sendfiles+=("../resources/kloader_hgsp")
sendfiles+=("../resources/kloader") sendfiles+=("../resources/kloader")
elif [[ $device_det == 5 ]]; then elif [[ $device_det == 5 ]]; then
@ -751,14 +765,20 @@ device_enter_mode() {
fi fi
sendfiles+=("kloaders" "pwnediBSS") sendfiles+=("kloaders" "pwnediBSS")
device_sshpass
log "Entering kDFU mode..." log "Entering kDFU mode..."
print "* This may take a while, but should not take longer than a minute." print "* This may take a while, but should not take longer than a minute."
if [[ $device_det == 1 ]]; then
print "* If the script seems to be stuck here, read Section 2.1 in the GitHub wiki for more details."
fi
$scp -P 2222 ${sendfiles[@]} root@127.0.0.1:/tmp $scp -P 2222 ${sendfiles[@]} root@127.0.0.1:/tmp
if [[ $? == 0 ]]; then if [[ $? == 0 ]]; then
$ssh -p 2222 root@127.0.0.1 "bash /tmp/kloaders" & $ssh -p 2222 root@127.0.0.1 "bash /tmp/kloaders" &
else else
warn "Failed to connect to device via USB SSH." warn "Failed to connect to device via USB SSH."
print "* For Linux users, try running \"sudo systemctl restart usbmuxd\" before retrying USB SSH." if [[ $platform == "linux" ]]; then
print "* Try running \"sudo systemctl restart usbmuxd\" before retrying USB SSH."
fi
if [[ $device_det == 1 ]]; then if [[ $device_det == 1 ]]; then
print "* Try to re-install both OpenSSH and Dropbear, reboot, re-jailbreak, and try again." print "* Try to re-install both OpenSSH and Dropbear, reboot, re-jailbreak, and try again."
print "* Alternatively, place your device in DFU mode (see \"Troubleshooting\" wiki page for details)" print "* Alternatively, place your device in DFU mode (see \"Troubleshooting\" wiki page for details)"