Giter Club home page Giter Club logo

Comments (17)

lattice0 avatar lattice0 commented on June 6, 2024 1

Are the modifications still needed?

https://github.com/kmackay/android-ifaddrs

does not exists anymore

from libtins.

lattice0 avatar lattice0 commented on June 6, 2024 1

from libtins.

lattice0 avatar lattice0 commented on June 6, 2024 1

You can disable https://github.com/mfontanini/libtins/blob/master/CMakeLists.txt#L60

maybe unset(LIBTINS_ENABLE_PCAP) or set(LIBTINS_ENABLE_PCAP OFF) before add_subdirectory, I don't remember exactly

from libtins.

mfontanini avatar mfontanini commented on June 6, 2024

Good question. I guess it should, since android OS is Linux based. Of course you'd need to either compile inside an android OS, or cross-compile, but I guess it should work.

from libtins.

einarjon avatar einarjon commented on June 6, 2024

The answer is yes, but there are a couple of things that need to be done.
I've been meaning to push my changes upstream, but I'm still using libtins 2.0

  1. Add ifaddrs, because it is missing in the android NDK (or was when I last checked in jan 2014).
    https://github.com/kmackay/android-ifaddrs
    I use cmake to only include/compile that folder when building for android.
  2. Add libpcap (or at least the header files). Should be trivial.
  3. fix a compiler error in src/network_interface.cpp
--- a/src/network_interface.cpp
+++ b/src/network_interface.cpp
@@ -97,7 +97,7 @@ struct InterfaceInfoCollector {
-                        info->bcast_addr = IPv4Address(((struct sockaddr_in *)addr->ifa_ifu.ifu_broadaddr)->sin_addr.s_addr);
+                        info->bcast_addr = IPv4Address(((struct sockaddr_in *)addr->ifa_broadaddr)->sin_addr.s_addr);
  1. add a couple of includes in utils.cpp
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -43,6 +43,10 @@
+    #ifdef __ANDROID_API__
+        #include <linux/in.h>
+        #include <linux/in6.h>
+    #endif

from libtins.

dkumar1987 avatar dkumar1987 commented on June 6, 2024

Will libpcap work for non rooted devices in android?

from libtins.

einarjon avatar einarjon commented on June 6, 2024

It should be enough to add only pcap.h and pcap/bpf.h include files. That are the only includes that libtins is using*, and you don't actually need the libpcap.so binaries.

Otherwise you need to build and install the library. I'm not sure if you can do that on a non-rooted android.
*) At least for LibTins 2,0 without 802.11/WPA2 support.

from libtins.

dkumar1987 avatar dkumar1987 commented on June 6, 2024

Thanks, I try.

from libtins.

mfontanini avatar mfontanini commented on June 6, 2024

I just added those fixes to the code, so you shouldn't need to touch anything besides including the ifaddrs files.

Thanks @einarjon for the instructions! I'm going to add some tutorial on the website on how to compile it on android soon based on them.

Closing since it should compile on android now.

from libtins.

nbroeking avatar nbroeking commented on June 6, 2024

I know this issue is closed but I figured I would add another comment because I know many people will be frustrated with the information given. It will compile for android but it wont run. Android does not have the proper drivers installed to do monitor mode on their devices and thus you need to get drivers that can do that work for you. You should look into the work being done on bcmon.

from libtins.

lattice0 avatar lattice0 commented on June 6, 2024

But instead of monitoring can I craft and send packets in Android and iOS?

from libtins.

einarjon avatar einarjon commented on June 6, 2024

from libtins.

ilyasKerbal avatar ilyasKerbal commented on June 6, 2024

@lattice0 any updates?

from libtins.

ilyasKerbal avatar ilyasKerbal commented on June 6, 2024

Thanks @lattice0 #471
Can you share the steps to setup?

from libtins.

lattice0 avatar lattice0 commented on June 6, 2024

from libtins.

ilyasKerbal avatar ilyasKerbal commented on June 6, 2024

For some reason I get the following error:

  1. Could NOT find PCAP (missing: PCAP_LIBRARY PCAP_INCLUDE_DIR)

@lattice0

from libtins.

ilyasKerbal avatar ilyasKerbal commented on June 6, 2024

Thank you so much @lattice0 I just solved the problem. Your guidance helped a lot.

from libtins.

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.