Comments (15)
Can you SSH into the device manually? (without using needle)
from needle.
from needle.
@mehadhe weird question, but is your device set so the screen doesn't turn off automatically? the screen needs to be on while needle is running
from needle.
from needle.
can you post the full terminal log? i know you set "debug true" but i want to see the exact commands needle is running, which means i need to see the full terminal log
from needle.
@bshieh: from your error (#260) I can see:
connection refused
Are you sure you disconnected every other connection before trying to connect with needle?
from needle.
@marco-lancini Yes, I tried rebooting my macbook to be sure. Something to note is that when I used "shell" in Needle, it worked only the very first time I ran it. All subsequent attempts failed with the same error message as when running a module.
from needle.
@Yogehi , PFA the screenshots for your reference. Hope this helps...
from needle.
can you run ps ax | grep needle
in another terminal while running needle?
the application definitely thinks there is already a connection to the device before attempting to run the module.
another option: i see that you're running osx. could you try sudo -H python ./needle.py
and see if that works, but also do NOT run iproxy 2222 22
or whatever you are running that sets up the port forwarding.
if you run needle with sudo, it should automatically setup a port forward for you.
my logs below showing this:
Yays-Mac:needle yayusernameyay$ system_profiler SPSoftwareDataType | grep System
System Software Overview:
System Version: macOS 10.13.6 (17G65)
System Integrity Protection: Enabled
Yays-Mac:needle yayusernameyay$ sudo -H python ./needle.py
__ _ _______ _______ ______ _______
| \ | |______ |______ | \ | |______
| \_| |______ |______ |_____/ |_____ |______
Needle v1.3.2 [mwr.to/needle]
[MWR InfoSecurity (@MWRLabs) - Marco Lancini (@LanciniMarco)]
[needle] > set debug true
DEBUG => true
[needle] > use binary/info/metadata
[needle][metadata] > run
[D] Setup local output folder: /var/root/.needle/output
[?] Attention! The folder chosen to store local output is not empty: /var/root/.needle/output
[?] Do you want to back it up first?
[?] Y: the content will be archived in a different location, then the folder will be emptied
[?] N: no action will be taken (destination files might be overwritten in case of filename clash)
[y/n]: n
[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...
[V] Connection not present, creating a new instance
[D] Setting up USB port forwarding on port 2222
[D] [LOCAL CMD] Local Subprocess Command: /Users/yayusernameyay/Desktop/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] 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
[*] Target app not selected. Launching wizard...
[D] [AGENT] Executing command: list_apps
[+] Apps found:
[>][QUESTION] Please select a number:
The device I used in the above log was running OS 11.3.1 with electra jailbreak
from needle.
from needle.
@mehadhe: were you trying to connect over WiFi before?
from needle.
from needle.
In the screenshot above you obscured the IP setting. Are you able to share the full config (unobfuscated)?
from needle.
@Yogehi I tried running ps ax | grep needle
in another terminal while running needle and got this output:
User-MacBook-Pro:~ username$ ps ax | grep needle
715 s001 S+ 0:00.04 sudo -H python needle.py
716 s001 S+ 0:00.54 /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python needle.py
719 s002 S+ 0:00.00 grep needle
I have actually been running needle with sudo -H python needle.py
. I tried unloading the com.usbmux.iproxy.plist file with launchctl unload ~/Library/LaunchAgents/com.usbmux.iproxy.plist
which enables me to SSH over USB, and got the same error as before
2018-07-27 11:19:35,181| ERROR | Could not open connection to gateway
[!] Problem establishing connection: BaseSSHTunnelForwarderError -
[!] BaseSSHTunnelForwarderError: Could not establish session to SSH gateway
from needle.
@Yogehi, The connection establishment problem resolved by connecting the device via USB cable and configured the file as below.
Automated Configuration file
set AGENT_PORT 4444
set APP
set DEBUG True
set HIDE_SYSTEM_APPS False
set IP 127.0.0.1
set PORT 2222
set OUTPUT_FOLDER /Users/mehadhe_sameer/needle/needle/output
set PASSWORD my_password
set SKIP_OUTPUT_FOLDER_CHECK True
set USERNAME root
set VERBOSE True
from needle.
Related Issues (20)
- No Valid Connections
- Unable to SSH with wifi or USB using Needle HOT 1
- prereq for installation HOT 3
- [!] IOError: [Errno 2] No such file or directory: '/var/root/.needle/tmp/plist' HOT 8
- [!] HandlerSSHTunnelForwarderError: An error occurred while opening tunnels. HOT 1
- [!] Exception: An error occurred and it was not possible to restore it (3 attempts failed) and [!] [Errno 54] Connection reset by peer HOT 6
- lipo: can't open input file: /private/var/containers/Bundle/Application/....app(No such file or directory)
- dependency_installer breaks on invalid GPG signature
- dependency_installer does not work HOT 8
- Documentation/wiki dead link
- Dependencies installer Not Working
- Installing Dependencies - Ran Out Of Allocation Pools Error
- Many modules dont work with chimera jail break HOT 1
- Mac&Kali: SSH Connection Dropped. No handlers could be found for logger "paramiko.transport" HOT 4
- Downloading agent file without Cydia HOT 2
- NeedleAgent installation fails/doesn't show up HOT 2
- Cydia repository is down HOT 6
- I GET THIS?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from needle.