Code Monkey home page Code Monkey logo

Comments (9)

kubo avatar kubo commented on June 1, 2024

@enty8080
I added MIPS support.

Well, I recommend that you use this just for fun. It may stop processes. See https://github.com/kubo/injector#caveats.

from injector.

enty8080 avatar enty8080 commented on June 1, 2024

@kubo Thanks. Your tool
is great and I hope I won't face such problems, but I do not really understand this caveat. May it stop all the processes including init or just the target process? And any ways to prevent this?

from injector.

kubo avatar kubo commented on June 1, 2024

May it stop all the processes including init or just the target process?

It may stop just the target process.

And any ways to prevent this?

It is possible in theory but it is difficult for me.

The idea is:

  1. attach to the target process.
  2. get a backtrace of the target process as gdb does.
  3. if the backtrace includes memory management functions such as malloc, calloc, strdup, free, step the target process until they disappear from the backtrace.
  4. Here is safe to inject a shared library.

If the target process holds a lock used by memory management functions, injector's library loading, which calls malloc internally, tries to hold the same lock in the same thread and stops forever.

from injector.

enty8080 avatar enty8080 commented on June 1, 2024

@kubo Thanks for description. Also, I have got a question. So your tool works only on little endian systems or big too? I have this question because in README there are only armel and mipsel, no mipsbe or armbe.

from injector.

kubo avatar kubo commented on June 1, 2024

It will work also on big endian systems though I have not tested it.

I checked that it was compiled by the following compilers on ubuntu 20.04 x86_64. However I could test only three: mipsel n32 (-mabi=n32), mipsel o32 (-mabi=32) and mips64el.

  • mips-linux-gnu-gcc (compiler option -mabi=n32)
  • mips-linux-gnu-gcc (compiler option -mabi=32)
  • mipsel-linux-gnu-gcc (compiler option -mabi=n32)
  • mipsel-linux-gnu-gcc (compiler option -mabi=32)
  • mips64-linux-gnuabi64-gcc
  • mips64el-linux-gnuabi64-gcc
  • mipsisa32r6-linux-gnu-gcc (compiler option -mabi=n32)
  • mipsisa32r6-linux-gnu-gcc (compiler option -mabi=32)
  • mipsisa32r6el-linux-gnu-gcc (compiler option -mabi=n32)
  • mipsisa32r6el-linux-gnu-gcc (compiler option -mabi=32)
  • mipsisa64r6-linux-gnuabi64-gcc
  • mipsisa64r6el-linux-gnuabi64-gcc

from injector.

enty8080 avatar enty8080 commented on June 1, 2024

@kubo I am just curious if it will work on embedded Linux. For instance, router that has Linux 2.5 with musl c library and mipsel CPU. I am gonna test this, but I also want to know if you think this will work.

BTW, have you tried to inject dylib to macho process (macOS)?

from injector.

kubo avatar kubo commented on June 1, 2024

I think that it works. Support for musl libc was contributed at #22.

BTW, how about LD_PRELOAD or /etc/ld.so.preload in order to inject libraries?

As for macOS, I won't support it. I don't know how to do it on macOS and I don't have macOS machine suitable for the latest OS. (I have macbook air mid 2013.)

from injector.

enty8080 avatar enty8080 commented on June 1, 2024

@kubo I thought LD_PRELOAD can only inject shared library to the app, that you run at the same time. I thought you can't use LD_PRELOAD for injecting .so to the running process.

from injector.

kubo avatar kubo commented on June 1, 2024

@enty8080 You are correct. It isn't in-place replacement of injector. I recommend that you have a rethink about your application design because injector have the caveat I cannot fix.

from injector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.