You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.9 KiB

  1. # Copyright (C) 2019 Diana Dragusin <diana.dragusin@nccgroup.com>
  2. # Copyright (C) 2019 Etienne Champetier <champetier.etienne@gmail.com>
  3. #
  4. # This is free software, licensed under the GNU General Public License v3.
  5. # See <http://www.gnu.org/licenses/> for more information.
  6. include $(TOPDIR)/rules.mk
  7. PKG_NAME:=phantap
  8. PKG_RELEASE:=1
  9. PKG_SOURCE_PROTO:=git
  10. PKG_SOURCE_URL:=https://github.com/nccgroup/phantap
  11. PKG_SOURCE_DATE:=2019.07.30
  12. PKG_SOURCE_VERSION:=dccee924f005213c8b1c84e05900ed0bbfac5736
  13. PKG_MIRROR_HASH:=456adfcc0147f3b47d2fad26938e2896096919f053f871c1319218e7d37c6d27
  14. PKG_MAINTAINER:=Diana Dragusin <diana.dragusin@nccgroup.com>, \
  15. Etienne Champetier <champetier.etienne@gmail.com>
  16. PKG_LICENSE:=GPL-3.0-only
  17. include $(INCLUDE_DIR)/package.mk
  18. include $(INCLUDE_DIR)/cmake.mk
  19. CMAKE_SOURCE_SUBDIR:=src
  20. define Package/phantap/Default
  21. SECTION:=net
  22. CATEGORY:=Network
  23. URL:=https://github.com/nccgroup/phantap
  24. endef
  25. define Package/phantap
  26. $(call Package/phantap/Default)
  27. TITLE:=PhanTap
  28. PKGARCH:=all
  29. DEPENDS:=+ebtables +tcpdump +ip-full +kmod-br-netfilter +kmod-ebtables-ipv4
  30. endef
  31. define Package/phantap/conffiles
  32. /etc/config/phantap
  33. endef
  34. define Package/phantap/description
  35. PhanTap or Phantom tap is a small set of scripts that allow you to setup a network tap
  36. that automatically impersonate a victim device, allowing you to access internet using
  37. the IP & MAC of the victim. To speak to machines in the same L2, see PhanTap learn
  38. endef
  39. define Package/phantap-learn
  40. $(call Package/phantap/Default)
  41. TITLE:=PhanTap-learn
  42. DEPENDS:=+libpcap +ip-full
  43. endef
  44. define Package/phantap-learn/description
  45. PhanTap learn listens to multicast / broadcast / arp traffic to fill the arp table
  46. and add routes to the discovered IPs.
  47. endef
  48. define Package/phantap/install
  49. $(INSTALL_DIR) $(1)/etc/config
  50. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/etc/config/phantap $(1)/etc/config/
  51. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  52. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/etc/hotplug.d/iface/00-phantap $(1)/etc/hotplug.d/iface/
  53. $(INSTALL_DIR) $(1)/etc/hotplug.d/net
  54. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/etc/hotplug.d/net/00-phantap $(1)/etc/hotplug.d/net/
  55. $(INSTALL_DIR) $(1)/etc/init.d
  56. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/phantap $(1)/etc/init.d/
  57. $(INSTALL_DIR) $(1)/etc/sysctl.d
  58. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/etc/sysctl.d/12-phantap.conf $(1)/etc/sysctl.d/
  59. $(INSTALL_DIR) $(1)/usr/bin
  60. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/usr/bin/phantap $(1)/usr/bin/
  61. endef
  62. define Package/phantap-learn/install
  63. $(INSTALL_DIR) $(1)/etc/hotplug.d/iface
  64. $(INSTALL_DATA) $(PKG_BUILD_DIR)/files/etc/hotplug.d/iface/00-phantap-learn $(1)/etc/hotplug.d/iface/
  65. $(INSTALL_DIR) $(1)/etc/init.d
  66. $(INSTALL_BIN) $(PKG_BUILD_DIR)/files/etc/init.d/phantap-learn $(1)/etc/init.d/
  67. $(INSTALL_DIR) $(1)/usr/sbin
  68. $(INSTALL_BIN) $(PKG_BUILD_DIR)/phantap-learn $(1)/usr/sbin/
  69. endef
  70. $(eval $(call BuildPackage,phantap))
  71. $(eval $(call BuildPackage,phantap-learn))