Comments (17)
Are the modifications still needed?
https://github.com/kmackay/android-ifaddrs
does not exists anymore
from libtins.
from libtins.
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.
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.
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
- 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. - Add libpcap (or at least the header files). Should be trivial.
- 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);
- 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.
Will libpcap work for non rooted devices in android?
from libtins.
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.
Thanks, I try.
from libtins.
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.
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.
But instead of monitoring can I craft and send packets in Android and iOS?
from libtins.
from libtins.
@lattice0 any updates?
from libtins.
Thanks @lattice0 #471
Can you share the steps to setup?
from libtins.
from libtins.
For some reason I get the following error:
- Could NOT find PCAP (missing: PCAP_LIBRARY PCAP_INCLUDE_DIR)
from libtins.
Thank you so much @lattice0 I just solved the problem. Your guidance helped a lot.
from libtins.
Related Issues (20)
- how to call the Stream::user_data() to set and get the custom data ? HOT 1
- IPv6Address::to_string() return a local address HOT 1
- Error: live packet capture not supported on this system
- libtins.so.4.5: cannot open shared object file: No such file or directory HOT 1
- libtins 4.4 conan recipe is conan2.0 incompatible HOT 1
- Multicast packet ( specifically fieldbus) is not parsed
- Tagging a new release / fixup release with GCC 13 patch HOT 1
- 'unresolved external symbol' in Visual Studio 2022 HOT 3
- add #496 in the release notes for v4.5
- Send SYN packet failed on Windows 10 HOT 8
- Any passthru example?
- [bug] UDP::matches_response() return 0 when no inner PDU is available
- How to get gateway? HOT 1
- matches_response() implementation for EthernetII / Dot3
- DataTracker::advance_sequence removes too much data
- Seeing "android ifaddr not supported" regardless of Android version HOT 1
- failures with gtest 1.13+ HOT 1
- wrong "enum OptionTypes" definition HOT 2
- How to dump packets after streamfollower processing?
- Is there any way to get host name [domain] on the local DHCP ex{Router]??? for specific IP HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libtins.