HN user

oleavr

384 karma

[ my public key: https://keybase.io/oleavr; my proof: https://keybase.io/oleavr/sigs/8qaXkpzIEMxpYSBm-mWsi2ihbO3dOz9rtuL6zCJ1k2Q ]

Posts43
Comments34
View on HN
luma.frida.re 25d ago

Show HN: Luma – A New Workspace for Frida

oleavr
1pts0
frida.re 3y ago

Frida can now inject Rust and inline hooks into OS kernels and embedded targets

oleavr
1pts0
github.com 4y ago

Amiga emulator instrumentation using Frida

oleavr
2pts0
frida.re 5y ago

Frida 15 Is Out

oleavr
13pts1
frida.re 5y ago

Frida 12.11 is out with macOS 11 and Apple silicon support

oleavr
3pts0
github.com 6y ago

CryptoShark 0.2.0 Is Out

oleavr
1pts0
frida.re 6y ago

How the Stalker code tracing engine works

oleavr
1pts0
frida.re 6y ago

Frida 12.7 is out with fast inline C in JavaScript

oleavr
1pts0
github.com 6y ago

AirSpy: Tool for tracking the evolution of Apple's AirDrop implementations

oleavr
1pts0
frida.re 7y ago

Frida 12.6 is out with major stability improvements on all platforms

oleavr
2pts0
frida.re 7y ago

Frida 12.5 Released

oleavr
4pts0
www.frida.re 8y ago

Frida 10.5 is out with user-defined machine code transforms per thread

oleavr
3pts0
github.com 9y ago

Ssl_logger: Decrypts and Logs a Process's SSL Traffic on Linux and MacOS

oleavr
5pts0
www.nowsecure.com 9y ago

Cycript on steroids: Pumping up portability and performance with Frida

oleavr
1pts0
github.com 9y ago

Comparison of function hooking libraries

oleavr
2pts0
www.youtube.com 10y ago

Peeking under the hood with Frida

oleavr
2pts0
gist.github.com 10y ago

CydiaSubstrate vs. Frida on function hooking performance

oleavr
1pts0
www.frida.re 10y ago

How to LD_PRELOAD JavaScript into native apps

oleavr
1pts0
www.nowsecure.com 10y ago

iOS Instrumentation without Jailbreak

oleavr
16pts0
www.youtube.com 10y ago

How to trace and modify closed-source code

oleavr
1pts0
www.nowsecure.com 10y ago

iOS 9 Reverse Engineering with JavaScript

oleavr
2pts0
www.nowsecure.com 10y ago

Reverse Engineering with JavaScript

oleavr
1pts0
www.youtube.com 10y ago

Frida: a deep dive from UI instrumentation to instruction-level tracing [video]

oleavr
2pts0
www.youtube.com 11y ago

Frida: Putting the open back into closed software [video]

oleavr
1pts0
github.com 11y ago

Taking the pain out of front-end build systems

oleavr
2pts0
www.frida.re 11y ago

Inject JavaScript into native apps from Node.js

oleavr
2pts0
www.frida.re 11y ago

Frida 2.0.0 released

oleavr
1pts0
medium.com 11y ago

DIY: kernel panic OS X and iOS in 10 LOC

oleavr
117pts49
medium.com 11y ago

Anatomy of a code tracer

oleavr
54pts2
blog.senko.net 11y ago

Junk Social: How I Accidentally Quit Twitter and Facebook

oleavr
1pts0

Hey,

and thanks for checking it out! The currently released version of Frida, 1.6.8, doesn't have the work-around and triggers the kernel panic described in the blog post. The work-around landed in git last night and will be part of 1.6.9 to be released soon; hopefully by tomorrow if all goes to plan. Feel free to clone and build Frida yourself if you'd like to play with it in the meantime (or make sure you never attach more than once to any process). Sorry for the inconvenience!

Feel free to drop by #frida on irc.freenode.net, btw!

Cheers!

Oops, in retrospect I should have resisted my OCD-fueled urge to link every single reference to be consistent. :p

Speaking as its creator and maintainer, it's been a pet project for the last 5 years (7 if you start from frida-gum, the code instrumentation engine), but to this day it's still rather obscure considering its potential. I regret not spending more time marketing the project over the years, so these days I'm doing my best to make up for that. :)

Is it a 64-bit device? Does the program crash or exit gracefully? If it crashes, try bumping the library index argument here:

library = (char *) _dyld_get_image_header (1);

If you're unlucky library at index 1 contains mach_vm_read_overwrite and is suddenly no longer executable (since we change its second memory page from R-X to RW- due to stock kernels not allowing RWX pages).

Where does it crash? Try bumping the argument on line 21 – if you're unlucky library at index 1 contains mach_vm_read_overwrite and is suddenly no longer executable (since we change its second memory page from R-X to RW- due to stock kernels not allowing RWX pages).

I only tested it on 64-bit systems, where it triggers the kernel panic from both 32- and 64-bit processes (i386, x86_64, arm, and arm64). Hardware-wise it crashes every single device I've tried (MacBook Pro, iMac, iPhone 6, etc.), so this is not tied to any specific hardware.

Interesting, that's potentially very good news! To be sure, could you try again with the latest code snippet? I forgot to remove the VM_PROT_EXECUTE flag for non-jailbroken devices.

The mach_vm.h header has been replaced with a dummy version in recent iOS SDKs, so you’ll have to copy it from your OS X SDK and adjust the include. Just updated the post, and also removed VM_PROT_EXECUTE from the mach_vm_protect call for compatibility with non-jailbroken devices.

Location: Stavanger, Norway

Remote: Yes

Willing to relocate: No

Technologies: Polyglot software development for desktop, mobile, web, and backend.

Résumé/CV: https://no.linkedin.com/in/oleavr

Email: oleavr at gmail dot com

---

I'm the founding author of several open source projects like http://www.frida.re, https://github.com/frida/cryptoshark, and https://code.google.com/p/ospy/. Extremely passionate about reverse-engineering, which started with libmimic, where I reverse-engineered a proprietary video codec from scratch (see: http://tech.slashdot.org/story/05/04/05/0240236/logitech-msn...). Have a diverse background spanning IM protocols, video conferencing, codecs, automotive hacking, dynamic binary instrumentation, GUI toolkits, web technologies, and most recently the music industry (Soundrop.fm and Show.co).

As you can see from the source code in the projects mentioned, I master C, C++, C#, Vala, Python, JavaScript, etc., and I'm also fluent in assembly for several architectures (IA-32, x86-64, ARM, AArch64, etc.). I also have years of experience building GUI apps for Windows, Mac, Linux, iOS and Android, and did a lot of backend development in Erlang. Through my experience building Frida I implemented features ranging from dynamic rewriting of function prologues for x86 and ARM 32- and 64-bit, dynamic trampolines, all the way to building a code tracer based on dynamic recompilation (see: https://medium.com/@oleavr/anatomy-of-a-code-tracer-b081aadb...)

I am available for both individual projects and long-term positions, but I can only work remotely.

Thanks a lot! This appears to be an issue with the Frida build system and the Linux buildbot slave. We're investigating and will hopefully have a bugfix release out in the next few hours.

Hope we'll get the pip issue sorted in the near future, need to do some more research into what's possible when not relying on eggs for binary releases (ran into issues when we tried to use bdist_dumb, so we postponed it for later).

Ahh yes, exposing registers is planned and very trivial to implement, as it's available at the C code level, just needs to be exposed to the script runtime (V8). Future versions may also allow specifying an ABI, so args[0] maps to ecx for thiscall in 32-bit mode.

My explanation of the hooking was a bit oversimplified, there is indeed support for hooking the return. Just implement onLeave(retval) in addition to onEnter(args), and you'll have access to the return value (coming from EAX/RAX).

Feedback is most appreciated, so please let me know if there's any issues. :)

Oops, that's a silly bug in frida-gum (sorry!), it should strip off the "L" suffix when calling toString() on a NativePointer object. As a band-aid you can either try with a 32-bit target process or locally hack it in your installed frida/core.py (just strip off the trailing "L" anywhere there's an int(a, 16) call. Expect a bugfix release tomorrow evening to fix this proper, so don't hesitate to let me know of any other issues.

No worries, the Frida website could definitely have explained things better!

Regarding the number of function arguments it doesn't know that, so that's something you need to know at the higher level. It is however safe to access arguments out of bounds, just expect "garbage" values if you access values beyond the Nth argument of an N argument function. Also, using Frida's Memory API (Memory.readUtf8String() for example) you'll get a JS exception thrown if you attempt to access an invalid address.

As for IAT, Frida is agnostic as far as hooking goes, it only needs the address of the function in memory (which you can obtain through for example Module.enumerateExports("kernel32.dll", ...)). How it works is that it dynamically rewrites/relocates the start of the function with a JMP to a trampoline that executes your JS hook, then the overwritten instruction(s) and finally jumps back to the next instruction after the overwritten ones.

Regarding functions in static libraries you can use Process.enumerateRanges() or Module.enumerateRanges() and Memory.scan() together to find the functions you're interested in, and then just Interceptor.attach() to them.

Hope this makes things a bit clearer!

It sounds like Frida and Cycript have similar goals - REPL and other cool applications are planned and meant to be built on top of the core that is currently exposed to Python, .NET and a browser plugin (I built a cheesy WebGL network sniffeer running in the browser, the basic idea was to build an online collaborative reverse-engineering app where users with the plugin installed can live stream data and everybody collaborates on analyzing it online. Pure crack, I know, but I would personally love to have such a tool).