WithSecureLabs / needle

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

Problem establishing connection: IndexError - tuple index out of range #209

Closed ShilpaRanganatha closed 6 years ago

ShilpaRanganatha commented 6 years ago

Unable to take SSH over USB or using IP Address

Expected behaviour

A connection should have been established successfully.

Actual behaviour

Steps to reproduce

  1. Run needle.py
  2. Launch the needle agent and start listening on PORT 4444.
  3. Type "SHELL" in the terminal where needle is running.

needle error logs

When taking SSH over USB:

screen shot 2018-02-14 at 3 55 06 pm

When taking SSH using IP Address:

screen shot 2018-02-14 at 3 59 40 pm

Needle Version

Workstation Operating System: Mac OS Sierra, 10.12.6

Python Version: 2.7.13

Python Packages (pip freeze)

AMAC02QV1SZG8WP:~ shilpa.ranganatha$ pip freeze androguard==3.1.0.dev0 anyjson==0.3.3 appnope==0.1.0 argh==0.26.2 backports-abc==0.5 backports.shutil-get-terminal-size==1.0.0 backports.ssl-match-hostname==3.5.0.1 BeautifulSoup==3.2.1 beautifulsoup4==4.4.1 billiard==3.3.0.23 biplist==0.9 blinker==1.4 brotlipy==0.6.0 bs4==0.0.1 certifi==2017.11.5 cffi==1.9.1 cheroot==5.7.0 CherryPy==11.0.0 clearbit==0.1.4 click==6.7 colorama==0.3.9 config==0.3.9 ConfigArgParse==0.11.0 configparser==3.5.0 construct==2.5.2 coreapi==2.3.0 coreschema==0.0.4 cryptography==1.5.3 cssutils==1.0.2 decorator==4.1.2 Django==1.10.5 django-rest-swagger==2.1.2 djangorestframework==3.6.2 dnspython==1.14.0 EasyProcess==0.2.3 EditorConfig==0.12.1 enum34==1.1.6 extras==1.0.0 fixtures==3.0.0 Flask==0.11.1 frida==10.0.11 funcsigs==1.0.2 future==0.15.2 fuzzywuzzy==0.15.0 h2==2.4.4 hpack==2.3.0 html2text==2016.9.19 hyperframe==4.0.2 idna==2.1 image==1.5.5 ipaddress==1.0.18 ipython==5.4.1 ipython-genutils==0.2.0 isign==1.6.15 itsdangerous==0.24 itypes==1.1.0 Jinja2==2.10 jsbeautifier==1.6.14 json2html==1.0.1 lettuce==0.2.23 linecache2==1.0.0 livereload==2.5.1 lxml==3.6.0 Markdown==2.6.10 MarkupSafe==1.0 memoizer==0.0.1 mitmproxy==0.18.3 mkdocs==0.17.2 mkdocs-material==2.2.6 mock==2.0.0 networkx==1.11 nose==1.3.7 olefile==0.44 openapi-codec==1.3.1 paramiko==2.1.2 passlib==1.6.5 pathlib2==2.3.0 pathtools==0.1.2 pbr==2.0.0 pdfkit==0.6.1 pexpect==4.2.1 pickleshare==0.7.4 Pillow==3.4.2 piplapis-python==5.1.0 portend==2.1.2 prompt-toolkit==1.0.14 protobuf==3.2.0 ptyprocess==0.5.2 pyasn1==0.1.9 pycparser==2.17 pycrypto==2.6.1 Pygments==2.2.0 pymdown-extensions==4.7 pymongo==3.3.0 pyOpenSSL==0.15.1 pyparsing==2.1.10 pyperclip==1.5.27 python-mimeparse==1.6.0 python-owasp-zap-v2.4==0.0.8 python-subunit==1.2.0 python-Wappalyzer==0.2.2 python-whois==0.6.2 pytz==2016.6.1 PyVirtualDisplay==0.2.1 PyYAML==3.12 readline==6.2.4.1 requests==2.10.0 requests-file==1.4 rsa==3.4.2 scandir==1.5 selenium==2.53.6 simplegeneric==0.8.1 simplejson==3.8.2 singledispatch==3.4.0.3 six==1.11.0 SQLAlchemy==1.2.0b1 sshtunnel==0.1.2 stevedore==1.23.0 style==1.1.0 sure==1.4.1 tempora==1.8 termcolor==1.1.0 testtools==2.2.0 tldextract==2.0.1 tornado==4.5.2 tqdm==4.7.6 traceback2==1.4.0 traitlets==4.3.2 typing==3.5.2.2 unittest2==1.1.0 update==0.0.1 uritemplate==3.0.0 urwid==1.3.1 virtualenv==15.1.0 virtualenv-clone==0.2.6 virtualenvwrapper==4.7.2 watchdog==0.8.3 wcwidth==0.1.7 web.py==0.40.dev0 Werkzeug==0.12.2

Device iOS Version: 10.2.1, 9.3.3

HenryHoggard commented 6 years ago

Can you try SSH to the device manually and see if it works.

ShilpaRanganatha commented 6 years ago

I could SSH into ipad version 9.3.3 using both USB and IP Address.

Via USB:

screen shot 2018-02-15 at 5 29 13 pm

Via IP Address:

screen shot 2018-02-15 at 5 30 01 pm

But for iPhone having version 10.2.1, could SSH only via USB.

marco-lancini commented 6 years ago

@ShilpaRanganatha:

But for iPhone having version 10.2.1, could SSH only via USB.

This is intended behaviour, as the dropbear daemon dropped by the iOS 10 jailbreak only listens on localhost

ShilpaRanganatha commented 6 years ago

I am aware of that. Here the problem is that needle is not able to ssh into the device (os- 10.2.1) with usb.

kryptoknight13 commented 6 years ago

facing same issue on iOS 11.0 while trying to install device dependency from module "device/dependency_installer".

marco-lancini commented 6 years ago

Are you still experiencing the same issue?

marco-lancini commented 6 years ago

Closed due to inactivity