WithSecureLabs / needle

The iOS Security Testing Framework
https://mobiletools.mwrinfosecurity.com/
Other
1.34k stars 284 forks source link

Fix the installation process for installing Theos while using the module 'device/dependency_installer' #223

Closed Yogehi closed 6 years ago

Yogehi commented 6 years ago

Multiple issues addressed.

Issue 1: Symbolic linking fails if file exists

Current line 147:

"ln -s /usr/local/bin/perl /usr/bin/perl"

If the user were to already have "/usr/bin/perl" then the following error would occur in Needle:

[V] [INSTALL] Manually installing: THEOS
[D] [REMOTE CMD] Remote Command: ln -s /usr/local/bin/perl /usr/bin/perl
[!] ln: failed to create symbolic link `/usr/bin/perl': File exists

[V] [SSH] Disconnecting...
[V] [AGENT] Disconnecting from agent...

By adding the flag "-f" to the command, the symbolic link will be forced.

New proposed command:

"ln -sf /usr/local/bin/perl /usr/bin/perl"

===================================

Issue 2: Git clone fails if folder exists

Current line 148:

"GIT_SSL_NO_VERIFY=true git clone --recursive https://github.com/theos/theos.git %s" % THEOS_FOLDER

THEOS_FOLDER is set to '/private/var/theos'.

If the folder '/private/var/theos' already exists then the user will be presented with the following Needle error:

V] [INSTALL] Manually installing: THEOS
[D] [REMOTE CMD] Remote Command: ln -sf /usr/local/bin/perl /usr/bin/perl
[D] [REMOTE CMD] Remote Command: GIT_SSL_NO_VERIFY=true git clone --recursive https://github.com/theos/theos.git /private/var/theos/
[!] fatal: destination path '/private/var/theos' already exists and is not an empty directory.

[V] [SSH] Disconnecting...
[V] [AGENT] Disconnecting from agent...

Solution is to remove '/private/var/theos' before using the 'git clone' command.

Proposed line 148 before running the git clone command:

"rm -rf %s" % THEOS_FOLDER

===================================

Issue 3: Git command errors

The following errors were found while running the following Git versions when trying to clone the Theos project:

Git version 2.13.0 downloaded from repo 'cydia.radare.org'

Yay-iPhone-SE-Yay:~ root# git --version
git version 2.13.0
Yay-iPhone-SE-Yay:~ root# GIT_SSL_NO_VERIFY=true git clone --recursive https://github.com/theos/theos.git /private/var/theos/
Cloning into '/private/var/theos'...
fatal: Unable to find remote helper for 'https'

Git version 2.8.1 download from repo 'apt.saurik.com'

Yay-iPhone-SE-Yay:~ root# git --version
git version 2.8.1
Yay-iPhone-SE-Yay:~ root# GIT_SSL_NO_VERIFY=true git clone --recursive https://github.com/theos/theos.git /private/var/theos/
Cloning into '/private/var/theos'...
fatal: unable to access 'https://github.com/theos/theos.git/': error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Proposed change to the project URL would be "git://github.com/theos/theos.git" instead of "https://github.com/theos/theos.git".

However, because of the "--recursive" flag in the "git clone" command, this means that submodules need to be downloaded as well. The Theos project has it's ".git/config" file set to point to "https://github.com" instead of "git://github.com":

Yay-iPhone-SE-Yay:/private/var/theos root# cat .git/config
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    precomposeunicode = true
[remote "origin"]
    url = git://github.com/theos/theos.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[submodule "vendor/dm.pl"]
    url = https://github.com/theos/dm.pl.git
[submodule "vendor/include"]
    url = https://github.com/theos/headers.git
[submodule "vendor/lib"]
    url = https://github.com/theos/lib.git
[submodule "vendor/logos"]
    url = https://github.com/theos/logos.git
[submodule "vendor/nic"]
    url = https://github.com/theos/nic.git

To remedy this, instead of specifying the "--recursive" flag with the "git clone" command, we can manually run "git module init" and then modify each URL in the "config" file so that "https://" is changed to "git://". Finally, we use "git submodule update" to download each submodule.

Proposed lines 149-152

"GIT_SSL_NO_VERIFY=true git clone --quiet git://github.com/theos/theos.git %s" % THEOS_FOLDER, #clone Theos into /private/var/theos quietly
"cd %s && git submodule init --quiet" % THEOS_FOLDER, #change directory to /private/var/theos and initiate the git submodules
"sed -i -- 's/https/git/g' %s.git/config" % THEOS_FOLDER, #take the .git/config file and replace all instances of "https" with "git"
"cd %s && git submodule update --quiet" % THEOS_FOLDER, #use git to download the submodules to the appropriate folders

The above lines work with both Git versions 2.13.0 and 2.8.1

===================================

Issue 4: outdated SDK URLs

The current commands to download the SDK files look like the following:

"curl -ksL \"https://sdks.website/dl/iPhoneOS8.1.sdk.tbz2\" | tar -xj -C %ssdks" % THEOS_FOLDER,
"curl -ksL \"https://sdks.website/dl/iPhoneOS9.3.sdk.tbz2\" | tar -xj -C %ssdks" % THEOS_FOLDER,

The URL "https://sdks.website" currently does not host any SDK files. The same developer of Theos currently has SDK files for 9.3 and 10.1 at the repository https://github.com/theos/sdks.

The following proposed line 153 will clone the https://github.com/theos/sdks repository into /private/var/theos/sdks:

"rm -rf %ssdks && git clone --quiet git://github.com/theos/sdks.git %ssdks" %(THEOS_FOLDER, THEOS_FOLDER)
HenryHoggard commented 6 years ago

Can you post logs/evidence of the fix working please.

Yogehi commented 6 years ago

Needle logs below showing the proposed changes work in iOS 10. The logs goes over the following:

             __   _ _______ _______ ______         _______
             | \  | |______ |______ |     \ |      |______
             |  \_| |______ |______ |_____/ |_____ |______

                   Needle v1.3.2 [mwr.to/needle]                  
  [MWR InfoSecurity (@MWRLabs) - Marco Lancini (@LanciniMarco)]   

[needle] > set debug true
DEBUG => true
[needle] > shell
[*] Spawning a shell...
[*] Checking connection with device...
[V] Connection not present, creating a new instance
[D] Setting up USB port forwarding on port 2222
[D] [LOCAL CMD] Local Subprocess Command: /root/Programs/needle/needle/libs/usbmuxd/tcprelay.py -t 22:2222
[D] [AGENT] Setting up port forwarding on port 4444
[V] [AGENT] Connecting to agent (127.0.0.1:4444)...
[+] [AGENT] Successfully connected to agent (127.0.0.1:4444)...
[D] [AGENT] Executing command: os_version
[V] [SSH] Connecting (127.0.0.1:2222)...
[+] [SSH] Connected (127.0.0.1:2222)
[D] [LOCAL CMD] Local Interactive Command: sshpass -p "<password>" ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@127.0.0.1
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
Yays-iPhone:~ root# git --version
git version 2.13.0
Yays-iPhone:~ root# uname -a
Darwin Yays-iPhone 16.3.0 Darwin Kernel Version 16.3.0: Tue Nov 29 21:40:08 PST 2016; root:xnu-3789.32.1~4/MarijuanARM64_T7000 iPhone7,2 arm64 N61AP Darwin
Yays-iPhone:~ root# ls -la /private/var/theos
total 64
drwxr-xr-x 14 root wheel   748 Feb 27 15:57 ./
drwxrwxrwx 34 root wheel  1326 Feb 27 15:57 ../
-rw-r--r--  1 root wheel   965 Feb 27 15:57 .appveyor.yml
drwxr-xr-x  9 root wheel   476 Feb 27 15:57 .git/
drwxr-xr-x  2 root wheel   170 Feb 27 15:57 .github/
-rw-r--r--  1 root wheel    71 Feb 27 15:57 .gitignore
-rw-r--r--  1 root wheel   444 Feb 27 15:57 .gitmodules
-rw-r--r--  1 root wheel   647 Feb 27 15:57 .travis.yml
-rw-r--r--  1 root wheel 35367 Feb 27 15:57 LICENSE.md
-rw-r--r--  1 root wheel   911 Feb 27 15:57 Prefix.pch
-rw-r--r--  1 root wheel   829 Feb 27 15:57 README.md
drwxr-xr-x  2 root wheel   646 Feb 27 15:57 bin/
drwxr-xr-x  4 root wheel   136 Feb 27 15:57 extras/
drwxr-xr-x  2 root wheel   102 Feb 27 15:57 include/
drwxr-xr-x  2 root wheel   102 Feb 27 15:57 lib/
drwxr-xr-x  8 root wheel   850 Feb 27 15:57 makefiles/
drwxr-xr-x  2 root wheel   102 Feb 27 15:57 mod/
-rw-r--r--  1 root wheel   655 Feb 27 15:57 package.json
drwxr-xr-x  5 root wheel   238 Feb 27 15:58 sdks/
drwxr-xr-x  3 root wheel   102 Feb 27 15:57 templates/
drwxr-xr-x  2 root wheel   102 Feb 27 15:57 toolchain/
drwxr-xr-x  7 root wheel   238 Feb 27 15:57 vendor/
Yays-iPhone:~ root# exit
logout
Connection to 127.0.0.1 closed.
[needle] > use device/dependency_installer
[needle][dependency_installer] > set theos true
THEOS => true
[needle][dependency_installer] > run
[D] Setup local output folder: /root/.needle/output
[D] Setting up issues database...
[D] [DB] QUERY: CREATE TABLE IF NOT EXISTS issues (app TEXT, module TEXT, name TEXT, content TEXT, confidence TEXT, outfile TEXT)
[*] Checking connection with device...
[+] Already connected to: 127.0.0.1
[D] Creating temp folder: /var/root/needle/
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/ ]; then echo "yes"; else echo "no" ; fi
[D] [REMOTE CMD] Remote Command: mkdir /var/root/needle/
[D] [AGENT] Executing command: os_version
[*] Checking prerequisites...
[D] [REMOTE CMD] Remote Command: which apt-get
[D] [REMOTE CMD] Remote Command: which dpkg
[V] [INSTALL] Installing COREUTILS via apt-get.
[D] [REMOTE CMD] Remote Command: apt-get install -y --force-yes coreutils
[V] [INSTALL] Installing COREUTILS via apt-get.
[D] [REMOTE CMD] Remote Command: apt-get install -y --force-yes coreutils-bin
[D] [REMOTE CMD] Remote Command: apt-get update
[*] Refreshing package list...
[D] [REMOTE CMD] Remote Command: dpkg --get-selections | grep -v "deinstall" | cut -f1
[D] [REMOTE CMD] Remote Command: apt-get update
[D] [REMOTE CMD] Remote Command: cat /etc/apt/sources.list.d/cydia.list
[*] The following tools are going to be installed: ['THEOS']
[>][QUESTION] Do you want to continue? [y/N]: y
[V] [INSTALL] Manually installing: THEOS
[D] [REMOTE CMD] Remote Command: ln -sf /usr/local/bin/perl /usr/bin/perl
[D] [REMOTE CMD] Remote Command: rm -rf /private/var/theos/
[D] [REMOTE CMD] Remote Command: GIT_SSL_NO_VERIFY=true git clone --quiet git://github.com/theos/theos.git /private/var/theos/
[D] [REMOTE CMD] Remote Command: cd /private/var/theos/ && git submodule init --quiet
[D] [REMOTE CMD] Remote Command: sed -i -- 's/https/git/g' /private/var/theos/.git/config
[D] [REMOTE CMD] Remote Command: cd /private/var/theos/ && git submodule update --quiet
[D] [REMOTE CMD] Remote Command: rm -rf /private/var/theos/sdks && git clone --quiet git://github.com/theos/sdks.git /private/var/theos/sdks
[needle][dependency_installer] > use hooking/theos/theos_tweak
[+] Resource file successfully loaded
[needle][theos_tweak] > set PROJECT_NAME yayprojectyay
PROJECT_NAME => yayprojectyay
[needle][theos_tweak] > set PACKAGE_NAME yaypackageyay
PACKAGE_NAME => yaypackageyay
[needle][theos_tweak] > set PROGRAM NANO
PROGRAM => NANO
[needle][theos_tweak] > run
[*] Checking connection with device...
[+] Already connected to: 127.0.0.1
[D] Creating temp folder: /var/root/needle/
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/ ]; then echo "yes"; else echo "no" ; fi
[*] Target app not selected. Launching wizard...
[D] [AGENT] Executing command: list_apps
[+] Apps found:
        <snip>
        12 - com.mwr.iSieve-main-view
        <snip>
[>][QUESTION] Please select a number: 12
[+] Target app: com.mwr.iSieve-main-view
[*] Retrieving app's metadata...
[D] Copying the plist to temp: /private/var/containers/Bundle/Application/3A6B1E02-ED5B-4422-8E73-34B785990807/iSieve.app/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/containers/Bundle/Application/3A6B1E02-ED5B-4422-8E73-34B785990807/iSieve.app/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/containers/Bundle/Application/3A6B1E02-ED5B-4422-8E73-34B785990807/iSieve.app/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/containers/Bundle/Application/3A6B1E02-ED5B-4422-8E73-34B785990807/iSieve.app/Info.plist" /root/.needle/tmp/plist
[D] [REMOTE CMD] Remote Command: lipo -info /private/var/containers/Bundle/Application/3A6B1E02-ED5B-4422-8E73-34B785990807/iSieve.app/iSieve
[D] [REMOTE CMD] Remote Command: if [ -d /private/var/containers/Bundle/Application/3A6B1E02-ED5B-4422-8E73-34B785990807/iSieve.app/PlugIns ]; then echo "yes"; else echo "no" ; fi
[D] No Plugins found
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/yayprojectyay ]; then echo "yes"; else echo "no" ; fi
[*] Starting wizard...
[D] [REMOTE CMD] Remote Command: cd /var/root/needle/ && printf '11\nyayprojectyay\nneedle.yaypackageyay\nNeedle\n\n-' | perl /private/var/theos/bin/nic.pl
[*] Tweak created:
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/yayprojectyay ]; then echo "yes"; else echo "no" ; fi
[D] [REMOTE CMD] Remote Command: ls  /var/root/needle/yayprojectyay
    Makefile
    Tweak.xm
    control
    yayprojectyay.plist
[*] Pulling: /var/root/needle/yayprojectyay/Tweak.xm -> /root/.needle/output/Tweak.xm
[D] Downloading: "/var/root/needle/yayprojectyay/Tweak.xm" -> /root/.needle/output/Tweak.xm
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/var/root/needle/yayprojectyay/Tweak.xm" /root/.needle/output/Tweak.xm
[D] [LOCAL CMD] Local Interactive Command: nano /root/.needle/output/Tweak.xm
[*] Uploading new Tweak to device...
[*] Pushing: /root/.needle/output/Tweak.xm -> /var/root/needle/yayprojectyay/Tweak.xm
[D] Uploading: "/root/.needle/output/Tweak.xm" -> "/var/root/needle/yayprojectyay/Tweak.xm"
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 -r "/root/.needle/output/Tweak.xm" root@127.0.0.1:"/var/root/needle/yayprojectyay/Tweak.xm"
[*] Installing the Tweak...
[D] [REMOTE CMD] Remote Interactive TTY Command: export THEOS=/private/var/theos && export PATH=$THEOS/bin:$PATH && cd /var/root/needle/yayprojectyay && make package install
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
> Making all for tweak yayprojectyay…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak yayprojectyay (armv7)…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Linking tweak yayprojectyay (arm64)…
==> Merging tweak yayprojectyay…
==> Signing yayprojectyay…
> Making stage for tweak yayprojectyay…
dpkg-deb: building package 'needle.yaypackageyay' in './packages/needle.yaypackageyay_0.0.1-1+debug_iphoneos-arm.deb'.
==> Installing…
Selecting previously unselected package needle.yaypackageyay.
(Reading database ... 4910 files and directories currently installed.)
Preparing to unpack .../needle.yaypackageyay_0.0.1-1+debug_iphoneos-arm.deb ...
Unpacking needle.yaypackageyay (0.0.1-1+debug) ...
Setting up needle.yaypackageyay (0.0.1-1+debug) ...
Connection to 127.0.0.1 closed.
[needle][theos_tweak] > shell
[*] Spawning a shell...
[*] Checking connection with device...
[+] Already connected to: 127.0.0.1
[D] [LOCAL CMD] Local Interactive Command: sshpass -p "<password>" ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@127.0.0.1
Warning: Permanently added '[127.0.0.1]:2222' (ECDSA) to the list of known hosts.
Yays-iPhone:~ root# dpkg -l | grep needle
ii  mwr.needle.agent                         1.0.5            iphoneos-arm Needle Agent
ii  needle.yaypackageyay                     0.0.1-1+debug    iphoneos-arm An awesome MobileSubstrate tweak!

===============================================================

Needle logs below showing the proposed changes work in iOS 9. The logs goes over the following:


             __   _ _______ _______ ______         _______
             | \  | |______ |______ |     \ |      |______
             |  \_| |______ |______ |_____/ |_____ |______

                   Needle v1.3.2 [mwr.to/needle]                  
  [MWR InfoSecurity (@MWRLabs) - Marco Lancini (@LanciniMarco)]   

[needle] > set debug true
DEBUG => true
[needle] > shell
[*] Spawning a shell...
[*] Checking connection with device...
[V] Connection not present, creating a new instance
[D] Setting up USB port forwarding on port 2222
[D] [LOCAL CMD] Local Subprocess Command: /root/Programs/needle/needle/libs/usbmuxd/tcprelay.py -t 22:2222
[D] [AGENT] Setting up port forwarding on port 4444
[V] [AGENT] Connecting to agent (127.0.0.1:4444)...
[+] [AGENT] Successfully connected to agent (127.0.0.1:4444)...
[D] [AGENT] Executing command: os_version
[V] [SSH] Connecting (127.0.0.1:2222)...
[+] [SSH] Connected (127.0.0.1:2222)
[D] [LOCAL CMD] Local Interactive Command: sshpass -p "<password>" ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@127.0.0.1
Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
zaks-iPad:~ root# git --version
git version 2.13.0
zaks-iPad:~ root# uname -a
Darwin zaks-iPad 15.0.0 Darwin Kernel Version 15.0.0: Thu Aug 20 13:11:14 PDT 2015; root:xnu-3248.1.3~1/RELEASE_ARM64_S5L8960X iPad4,2 arm64 J72AP Darwin
zaks-iPad:~ root# ls -la /private/var/theos
ls: cannot access /private/var/theos: No such file or directory
zaks-iPad:~ root# exit
logout
Connection to 127.0.0.1 closed.
[needle] > use device/dependency_installer
[needle][dependency_installer] > set theos true
THEOS => true
[needle][dependency_installer] > run
[D] Setup local output folder: /root/.needle/output
[D] Creating local output folder: /root/.needle/output
[D] Setting up issues database...
[D] [DB] QUERY: CREATE TABLE IF NOT EXISTS issues (app TEXT, module TEXT, name TEXT, content TEXT, confidence TEXT, outfile TEXT)
[*] Checking connection with device...
[+] Already connected to: 127.0.0.1
[D] Creating temp folder: /var/root/needle/
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/ ]; then echo "yes"; else echo "no" ; fi
[D] [REMOTE CMD] Remote Command: mkdir /var/root/needle/
[D] [AGENT] Executing command: os_version
[*] Checking prerequisites...
[D] [REMOTE CMD] Remote Command: which apt-get
[D] [REMOTE CMD] Remote Command: which dpkg
[V] [INSTALL] Installing COREUTILS via apt-get.
[D] [REMOTE CMD] Remote Command: apt-get install -y --force-yes coreutils
[V] [INSTALL] Installing COREUTILS via apt-get.
[D] [REMOTE CMD] Remote Command: apt-get install -y --force-yes coreutils-bin
[D] [REMOTE CMD] Remote Command: apt-get update
[*] Refreshing package list...
[D] [REMOTE CMD] Remote Command: dpkg --get-selections | grep -v "deinstall" | cut -f1
[D] [REMOTE CMD] Remote Command: apt-get update
[D] [REMOTE CMD] Remote Command: cat /etc/apt/sources.list.d/cydia.list
[*] The following tools are going to be installed: ['THEOS']
[>][QUESTION] Do you want to continue? [y/N]: y
[V] [INSTALL] Manually installing: THEOS
[D] [REMOTE CMD] Remote Command: ln -sf /usr/local/bin/perl /usr/bin/perl
[D] [REMOTE CMD] Remote Command: rm -rf /private/var/theos/
[D] [REMOTE CMD] Remote Command: GIT_SSL_NO_VERIFY=true git clone --quiet git://github.com/theos/theos.git /private/var/theos/
[D] [REMOTE CMD] Remote Command: cd /private/var/theos/ && git submodule init --quiet
[D] [REMOTE CMD] Remote Command: sed -i -- 's/https/git/g' /private/var/theos/.git/config
[D] [REMOTE CMD] Remote Command: cd /private/var/theos/ && git submodule update --quiet
[D] [REMOTE CMD] Remote Command: rm -rf /private/var/theos/sdks && git clone --quiet git://github.com/theos/sdks.git /private/var/theos/sdks
[needle][dependency_installer] > use hooking/theos/theos_tweak
[+] Resource file successfully loaded
[needle][theos_tweak] > set PROJECT_NAME booprojectboo
PROJECT_NAME => booprojectboo
[needle][theos_tweak] > set PACKAGE_NAME boopackageboo
PACKAGE_NAME => boopackageboo
[needle][theos_tweak] > set PROGRAM NANO
PROGRAM => NANO
[needle][theos_tweak] > run
[*] Checking connection with device...
[+] Already connected to: 127.0.0.1
[D] Creating temp folder: /var/root/needle/
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/ ]; then echo "yes"; else echo "no" ; fi
[*] Target app not selected. Launching wizard...
[D] [AGENT] Executing command: list_apps
[+] Apps found:
        <snip>
        18 - jp.naver.line
        <snip>
[>][QUESTION] Please select a number: 18
[+] Target app: jp.naver.line
[*] Retrieving app's metadata...
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/Info.plist" /root/.needle/tmp/plist
[D] [REMOTE CMD] Remote Command: lipo -info /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/LINE
[D] [REMOTE CMD] Remote Command: if [ -d /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns ]; then echo "yes"; else echo "no" ; fi
[D] [REMOTE CMD] Remote Command: if [ -d /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns ]; then echo "yes"; else echo "no" ; fi
[D] [REMOTE CMD] Remote Command: ls  /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineActionKeepExtension.appex/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineActionKeepExtension.appex/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineActionKeepExtension.appex/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineActionKeepExtension.appex/Info.plist" /root/.needle/tmp/plist
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationContentExtension.appex/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationContentExtension.appex/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationContentExtension.appex/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationContentExtension.appex/Info.plist" /root/.needle/tmp/plist
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationServiceExtension.appex/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationServiceExtension.appex/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationServiceExtension.appex/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineNotificationServiceExtension.appex/Info.plist" /root/.needle/tmp/plist
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LinePayTodayExtension.appex/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LinePayTodayExtension.appex/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LinePayTodayExtension.appex/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LinePayTodayExtension.appex/Info.plist" /root/.needle/tmp/plist
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineShareExtension.appex/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineShareExtension.appex/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineShareExtension.appex/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineShareExtension.appex/Info.plist" /root/.needle/tmp/plist
[D] Copying the plist to temp: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineTodayExtension.appex/Info.plist -> /root/.needle/tmp/plist
[*] Pulling: /private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineTodayExtension.appex/Info.plist -> /root/.needle/tmp/plist
[D] Downloading: "/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineTodayExtension.appex/Info.plist" -> /root/.needle/tmp/plist
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/private/var/mobile/Containers/Bundle/Application/FCFB8BB7-76E8-4181-BE28-2A8B95538CC6/LINE.app/PlugIns/LineTodayExtension.appex/Info.plist" /root/.needle/tmp/plist
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/booprojectboo ]; then echo "yes"; else echo "no" ; fi
[*] Starting wizard...
[D] [REMOTE CMD] Remote Command: cd /var/root/needle/ && printf '11\nbooprojectboo\nneedle.boopackageboo\nNeedle\n\n-' | perl /private/var/theos/bin/nic.pl
[*] Tweak created:
[D] [REMOTE CMD] Remote Command: if [ -d /var/root/needle/booprojectboo ]; then echo "yes"; else echo "no" ; fi
[D] [REMOTE CMD] Remote Command: ls  /var/root/needle/booprojectboo
    Makefile
    Tweak.xm
    booprojectboo.plist
    control
[*] Pulling: /var/root/needle/booprojectboo/Tweak.xm -> /root/.needle/output/Tweak.xm
[D] Downloading: "/var/root/needle/booprojectboo/Tweak.xm" -> /root/.needle/output/Tweak.xm
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 root@127.0.0.1:"/var/root/needle/booprojectboo/Tweak.xm" /root/.needle/output/Tweak.xm
[D] [LOCAL CMD] Local Interactive Command: nano /root/.needle/output/Tweak.xm
[*] Uploading new Tweak to device...
[*] Pushing: /root/.needle/output/Tweak.xm -> /var/root/needle/booprojectboo/Tweak.xm
[D] Uploading: "/root/.needle/output/Tweak.xm" -> "/var/root/needle/booprojectboo/Tweak.xm"
[D] [LOCAL CMD] Local Command: sshpass -p "<password>" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -P 2222 -r "/root/.needle/output/Tweak.xm" root@127.0.0.1:"/var/root/needle/booprojectboo/Tweak.xm"
[*] Installing the Tweak...
[D] [REMOTE CMD] Remote Interactive TTY Command: export THEOS=/private/var/theos && export PATH=$THEOS/bin:$PATH && cd /var/root/needle/booprojectboo && make package install
Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
> Making all for tweak booprojectboo…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (armv7)…
==> Linking tweak booprojectboo (armv7)…
==> Preprocessing Tweak.xm…
==> Compiling Tweak.xm (arm64)…
==> Linking tweak booprojectboo (arm64)…
==> Merging tweak booprojectboo…
==> Signing booprojectboo…
> Making stage for tweak booprojectboo…
dpkg-deb: building package 'needle.boopackageboo' in './packages/needle.boopackageboo_0.0.1-1+debug_iphoneos-arm.deb'.
==> Installing…
Selecting previously unselected package needle.boopackageboo.
(Reading database ... 12012 files and directories currently installed.)
Preparing to unpack .../needle.boopackageboo_0.0.1-1+debug_iphoneos-arm.deb ...
Unpacking needle.boopackageboo (0.0.1-1+debug) ...
Setting up needle.boopackageboo (0.0.1-1+debug) ...
Connection to 127.0.0.1 closed.
[needle][theos_tweak] > shell
[*] Spawning a shell...
[*] Checking connection with device...
[+] Already connected to: 127.0.0.1
[D] [LOCAL CMD] Local Interactive Command: sshpass -p "<password>" ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p 2222 root@127.0.0.1
Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
zaks-iPad:~ root# dpkg -l | grep needle
ii  mwr.needle.agent                         1.0.5            iphoneos-arm Needle Agent
ii  needle.boopackageboo                     0.0.1-1+debug    iphoneos-arm An awesome MobileSubstrate tweak!
Yogehi commented 6 years ago

closing PR to clean up commit clutter

see new PR https://github.com/mwrlabs/needle/pull/239