Git Product home page Git Product logo

Comments (10)

RackunSec avatar RackunSec commented on July 20, 2024 1

Yes! absolutely- that should help! I always use RFMON using airmon-ng to start the device in montor mode.

from libpcap-80211-c.

RackunSec avatar RackunSec commented on July 20, 2024

Hello, I have never seen this error before. Have you modified the code before compiling? Can you try to recompile without the GNU Debugging symbols? What version of Libpcap are you using? According to the Libpcap (TCPDump) developer site: (http://www.tcpdump.org/manpages/pcap-filter.7.html), the filter, "If the specified wlan_type is mgt, then valid wlan_subtypes are: assoc-req, assoc-resp, reassoc-req, reassoc-resp, probe-req, probe-resp, beacon, atim, disassoc, auth and deauth." is correct.

from libpcap-80211-c.

evanlu14 avatar evanlu14 commented on July 20, 2024

Hello, I did not change the code. And recompiling without the debugging symbols, the result is the same. And my Libpcap version is 0.8

from libpcap-80211-c.

RackunSec avatar RackunSec commented on July 20, 2024

I wonder if that may be the cause of the issue. Whey are you using such an old version? Id that part of the Ubuntu package manager? It looks like that version ended in 2012 (http://www.tcpdump.org/release/). I am using version 1.7.4 in Weakerthan Linux. Can you try a newer version of libpcap for me? I'd like to find out why exactly you get this warning.

from libpcap-80211-c.

RackunSec avatar RackunSec commented on July 20, 2024

Can you try the pcap_geterr() or pcap_perror() functions to possibly show what exactly went wrong in the calls to pcap_compile() and pcap_setFilter() ? This may give us more clues!

from libpcap-80211-c.

RackunSec avatar RackunSec commented on July 20, 2024

Oh, and you'll have to pass handle to those functions also, here is a simple usage: http://linux.die.net/man/3/pcap_geterr They print to stderr text strings. Thanks!

from libpcap-80211-c.

evanlu14 avatar evanlu14 commented on July 20, 2024

Thanks. I add one line to the code

if(pcap_compile(handle,&fp,filter,0,netp)==-1) {// -1 means failed
    fprintf(stderr,"Error compiling Libpcap filter, %s\n",filter);
    fprintf ("%s\n", pcap_geterr (handle));
}
if(pcap_setfilter(handle,&fp)==-1) // -1 means failed - but we don't exit(1)
    fprintf(stderr,"Error setting Libpcap filter, %s\n",filter); // same as above

and now the result is

lzc@ubuntu:~/Workspace/Git/libpcap-80211-c$ sudo ./a.out wlan0
Error compiling Libpcap filter, type mgt subtype beacon
802.11 link-layer types supported only on 802.11
Error setting Libpcap filter, type mgt subtype beacon

I am trying to upgrade my Libpcap now. And I am also wondering whether I should change my wireless card to moniter mode, will this cause the problem?

from libpcap-80211-c.

evanlu14 avatar evanlu14 commented on July 20, 2024

It seems my laptop wireless card is incompatible with the airmon-ng and I can not start the device in monitor mode.
And finally I bought a new USB wireless card and problem solved!
Thanks for suggestions and codes!

from libpcap-80211-c.

RackunSec avatar RackunSec commented on July 20, 2024

Ah, that's great news! If you have any more issues in the future, I'd be glad to help!

from libpcap-80211-c.

RackunSec avatar RackunSec commented on July 20, 2024

Issue is resolved!

from libpcap-80211-c.

Related Issues (1)

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.