Я пишу приложение ARP Spoof для Android (используя Java и C)
Приложение создает код .c и загружает его в apk lib ----.so
Когда я запускаю приложение , он не отправляет пакет ARP. https://github.com/BlackGhost0051/Nephi ... rp_spoof.c
Я пишу приложение ARP Spoof для Android (используя Java и C) Приложение создает код .c и загружает его в apk lib ----.so Когда я запускаю приложение , он не отправляет пакет ARP. https://github.com/BlackGhost0051/Nephilos/blob/master/app/src/main/cpp/arp_spoof.c [code]#include #include #include #include #include
#include #include
#include #include #include #include #include
#include // ? #include #include
struct my_arp_packet{ unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ unsigned char h_source[ETH_ALEN]; /* source ether addr */ unsigned short h_proto; /* packet type ID field */
unsigned short int ar_hrd; /* Format of hardware address. */ unsigned short int ar_pro; /* Format of protocol address. */ unsigned char ar_hln; /* Length of hardware address. */ unsigned char ar_pln; /* Length of protocol address. */ unsigned short int ar_op; /* ARP opcode (command). */ unsigned char ar_sha[ETH_ALEN]; /* Sender hardware address. */ unsigned long ar_sip; /* Sender IP address. */ unsigned char ar_tha[ETH_ALEN]; /* Target hardware address. */ unsigned long ar_tip; /* Target IP address. */ } __attribute__((packed));
void listen_arp_requests(){
}
void arp_reply_send(char *iface_name, unsigned long src_ip, unsigned char *src_mac, unsigned int dest_ip, unsigned char *dest_mac){ struct my_arp_packet arp;
system("echo 1 > /proc/sys/net/ipv4/ip_forward"); system("iptables -A FORWARD -j ACCEPT");
system("iptables -D natctrl_FORWARD -j DROP"); system("iptables -A natctrl_FORWARD -j ACCEPT");
printf("\n"); fflush(stdout);
while(1){ arp_reply_send(my_interface, src_ip, src_mac, dest_ip, dest_mac); sleep(1); } } [/code] Я тестирую этот код на своем ноутбуке с Linux, он работает, но на телефоне я вижу «Ответ ARP успешно отправлен», а [b]в Wireshark он пуст[/b].< /п>