pcap

Processing incorrect mac addresses from 802.11 frames with pcap

浪子不回头ぞ 提交于 2019-12-08 02:06:09
问题 I'm working throurgh a project with pcap and wireless. Following an example posted in response to oe of my earlier questions I am trying to extract the mac addresses from wireless frames. I have created structures for the radiotap header and a basic management frame. For some reason when it comes to trying to output the mac addresses I am printing out the wrong data. When I compare to wireshark I don't see why the radio tap data is printing out correctly but the mac addresses are not. I don't

How can I edit a js file sent by the server before it gets to my browser?

为君一笑 提交于 2019-12-07 23:01:45
问题 During a normal browsing session I want to edit a specific javascript file before the browser receives since once it gets there it's impossible to edit. Is there are any tool for this? For what I need it I can't just save it and edit it on my disk. I'm ready to learn how to program it myself but if anyone can point out more or less what I have to do I'd be very grateful. I'd have to intercept the packets until I have the whole file while blocking the browser from receiving it any part of it,

How do I create a new thread to make pcap_loop() and gtk_main() compatible?

荒凉一梦 提交于 2019-12-07 17:40:43
问题 These two functions are both infinite loops, and the programe hangs once called in the same thread. gtk_main(); ... pcap_loop(adhandle, 0, packet_handler, NULL); When I click the "start" button,I want pcap to start working;And if I press the "stop" button, pcap stop . How do I create a child thread and run pcap_loop(adhandle, 0, packet_handler, NULL); instead? 回答1: Unless I am missing something, your problem is that both GTK+ and libpcap are organized around events fired from a main loop.

Get IP address of interface in Linux using pcap

…衆ロ難τιáo~ 提交于 2019-12-07 15:52:14
问题 Is there a way how to get an IP address of an interface in Linux using libpcap? I have found this, Get IP address of an interface on Linux, but that doesn't use pcap. Also, in the pcap examples it is said that something like this should get your IP but it gives you your network address. 回答1: Using the pcap_findalldevs function: #include <pcap/pcap.h> #include <arpa/inet.h> static char errbuf[PCAP_ERRBUF_SIZE]; int main() { pcap_if_t *alldevs; int status = pcap_findalldevs(&alldevs, errbuf);

How to install PCAP for ruby on Windows

末鹿安然 提交于 2019-12-07 11:02:37
问题 This must be a relatively newb question but I am still stuck. I know there is a simple solution to this. I've done some googling but could not find an exact answer. Here is the error I get... C:\Ruby193\include\ruby-1.9.1\i386-mingw32>gem install pcap Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing pcap: ERROR: Failed to build gem native extension. C:/Ruby193/bin/ruby.exe extconf.rb checking for socket() in

Scapy and rdpcap function

醉酒当歌 提交于 2019-12-07 02:30:15
问题 I'm using rdpcap function of Scapy to read a PCAP file. I also use the module described in a link to HTTP support in Scapy which is needed in my case, as I have to retrieve all the HTTP requests and responses and their related packets. I noticed that parsing a large PCAP file the rdpcap function takes too much time to read it. Is there a solution to read a pcap file faster? 回答1: Scapy has another method sniff which you can use to read the pcap files too: def method_filter_HTTP(pkt): #Your

Writing an http sniffer (or any other application level sniffer) [closed]

和自甴很熟 提交于 2019-12-06 16:03:22
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed last year . I am trying my hands understanding PCAP libraries. I am able to apply a filter and get the TCP payload at port 80. But what next ? How can I read the HTTP data - suppose I want to know the "User Agent" field value in the http header..how should I proceed ? I have searched the website (and googled a lot too), and could find a related thread here : writing a http sniffer . But this

How can I edit a js file sent by the server before it gets to my browser?

*爱你&永不变心* 提交于 2019-12-06 11:07:41
During a normal browsing session I want to edit a specific javascript file before the browser receives since once it gets there it's impossible to edit. Is there are any tool for this? For what I need it I can't just save it and edit it on my disk. I'm ready to learn how to program it myself but if anyone can point out more or less what I have to do I'd be very grateful. I'd have to intercept the packets until I have the whole file while blocking the browser from receiving it any part of it, then edit it manually and forward it to the same port. I don't think I can do this by just using pcap,

Processing incorrect mac addresses from 802.11 frames with pcap

ⅰ亾dé卋堺 提交于 2019-12-06 10:17:04
I'm working throurgh a project with pcap and wireless. Following an example posted in response to oe of my earlier questions I am trying to extract the mac addresses from wireless frames. I have created structures for the radiotap header and a basic management frame. For some reason when it comes to trying to output the mac addresses I am printing out the wrong data. When I compare to wireshark I don't see why the radio tap data is printing out correctly but the mac addresses are not. I don't see any additional padding in the hex dump that wireshark displays when i look at the packets and

How do I create a new thread to make pcap_loop() and gtk_main() compatible?

感情迁移 提交于 2019-12-06 00:35:25
These two functions are both infinite loops, and the programe hangs once called in the same thread. gtk_main(); ... pcap_loop(adhandle, 0, packet_handler, NULL); When I click the "start" button,I want pcap to start working;And if I press the "stop" button, pcap stop . How do I create a child thread and run pcap_loop(adhandle, 0, packet_handler, NULL); instead? Unless I am missing something, your problem is that both GTK+ and libpcap are organized around events fired from a main loop. Without looking through the documentation, I don't know about GTK+, but there is another mode of operation for