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

do not download dependency during installation #136

Open
blshkv opened this issue Apr 19, 2018 · 5 comments
Open

do not download dependency during installation #136

blshkv opened this issue Apr 19, 2018 · 5 comments

Comments

@blshkv
Copy link

blshkv commented Apr 19, 2018

We have discovered that the tool downloads its dependencies during installation. This is a typical behavior of malicious software and is getting blocked in a sandbox environment such as Gentoo portage.
So we have to remove the tool (pentoo/pentoo-overlay@f40dd2a).

Please add requirements.txt file with all dependencies and verify them before installing it on your own.

blshkv pushed a commit to pentoo/pentoo-overlay that referenced this issue Apr 20, 2018
@blshkv
Copy link
Author

blshkv commented Apr 20, 2018

ok, it is complicated. The issue is with .so shared library which is provided within each binary and it is different for each platform. I would be happy to compile frida-core or whatever required package but it is fails with latest capstone (and may be other libs). I'm basically hitting the old bug frida/frida#130 or capstone-engine/capstone#757

@oleavr
Copy link
Member

oleavr commented Apr 20, 2018

We do this to work around PIP's lack of support for prebuilt binaries. The .egg format supports this, so our setup.py downloads the .egg and extracts the prebuilt binding pretending it just built it. It's a pretty nasty hack.

I would however not recommend building Frida without Frida's forks of the upstream dependencies, especially GLib which we've patched to support dynamic unloading, fork()-handling, and more. We have also patched libffi with custom API to be able to keep track of the pages it allocates, so we can hide them from Process.enumerateRanges() and similar APIs. This is important for Frida-based memory dumping tools, that don't want to deal with "noise" from Frida's own allocations.

@oleavr
Copy link
Member

oleavr commented Apr 20, 2018

By the way, there's a fallback where we look in the home-directory for the prebuilt .egg if the download fails. It's not great, but perhaps we could come up with a better workaround until somebody volunteers to do proper packaging.

@blshkv
Copy link
Author

blshkv commented Apr 20, 2018

ok noted on the customisation part. That make sense, will not try to use system tools anymore.

Regarding prebuilt binaries, I can suggest to create frida-bindings package which would only distribute python code and call a system .so library installed by a relevant package (frida-core?). For example, radare2-bindings or nfqueue-bindings are designed in this way and it worked well for everybody.

The fallback is exactly the way how I patched it now. But I had to remove network part so that it won't try to connect and not to raise a warning since there is no offline option

@mhsmith
Copy link

mhsmith commented Jun 23, 2018

I see you decided in #38 not to use wheels because PyPI didn't support Linux wheels at the time. That restriction has now been lifted (https://github.com/pypa/manylinux/), so you might want to revisit the idea.

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