Re: pcap_inject() ruins my handmade packets

2014-10-30 Thread Adrian Chadd
Hah, what was your actual code that worked?

And hm, there are some things in the radiotap header that the raw
transmit path pays attention to.



-adrian


On 30 October 2014 09:11, clutton clut...@zoho.com wrote:
 On Sat, 2014-10-25 at 19:54 -0700, Adrian Chadd wrote:
 On 25 October 2014 18:05, clutton clut...@zoho.com wrote:
  On Thu, 2014-10-23 at 17:32 -0700, Adrian Chadd wrote:
  Which version of FreeBSD are you using?
 
  I only recently fixed raw frame injection in monitor mode in
  FreeBSD-11. How are you trying to do raw frame injection?
 
 
  -adrian
 
 
  Any ideas? Why this doesn't work for me using pcap and works using
  sockets?
  https://www.kernel.org/doc/Documentation/networking/mac80211-injection.txt
 
  As I understand monitor mode can be used for injections now, is it
  right?
 
  As I remember some discussion here (a long time ago) said that the
  monitor mode is for monitoring :) and people should use other modes for
  injections. But since new pcap API was introduced, we can see that the
  monitor mode is not only for monitoring.

 It should be working. I haven't coded anything up recently to use
 monitor mode and inject, but I do know it now works.



 -adrian

 I finally made the «reaver» work, I even got banned by my AP. The
 problem is the pcap library, not the source of the program.

 Before sending any patches I think I need familiarize myself with
 libpcap more. Because it's pretty scary to patch program which has
 comments like this:

 * Back in 2002, Donald Lee at Cray wanted a DLT_ for
 * IP-over-FC:
 [skip]
 * 11 years later, Christian Svensson wanted to map
 * various ARPHRD_ values to DLT_FC_2 and
 * DLT_FC_2_WITH_FRAME_DELIMS for raw Fibre Channel
 * frames:

 One more question: no radiotap headers currently can be injected. Right?
 The underlie levels just ignore DLT_IEEE802_11_RADIO dlt.


 ___
 freebsd-wireless@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
 To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org
___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org

Re: pcap_inject() ruins my handmade packets

2014-10-25 Thread clutton
On Thu, 2014-10-23 at 17:32 -0700, Adrian Chadd wrote:
 Which version of FreeBSD are you using?
 
 I only recently fixed raw frame injection in monitor mode in
 FreeBSD-11. How are you trying to do raw frame injection?
 
 
 -adrian
 

Any ideas? Why this doesn't work for me using pcap and works using
sockets?
https://www.kernel.org/doc/Documentation/networking/mac80211-injection.txt

As I understand monitor mode can be used for injections now, is it
right?

As I remember some discussion here (a long time ago) said that the
monitor mode is for monitoring :) and people should use other modes for
injections. But since new pcap API was introduced, we can see that the
monitor mode is not only for monitoring.

 On 23 October 2014 17:21, clutton clut...@zoho.com wrote:
  Hi list.
 
  I'm porting a Linux application [reaver], and have a tough time figuring
  out what is wrong.
 
  The way how Linux users use it doesn't work I mean building packet like
  radiotap_header+frame+payload and use pcap_inject() for injections.
 
  Nevertheless, using the same packets with sockets work like a charm.
  Since I didn't find any working example with packet injections
  conjugates with pcap_inject for FreeBSD, I starting think it doesn't
  work on FreeBSD platform.
 
  Right now, I started using LD_PRELOAD with my own version of libpcap,
  because after end of day it uses write(), but why it is ruins my packets
  is not obvious for me yet.
 
  May be somebody could explain me? May be it's well known not fixable
  bug, and I'm just wasting my time.
 
  I really want to do this using libpcap! Using sockets is quicker
  approach for me, but you know, fixing libpcap will bring a lot of others
  apps to FreeBSD realm.
 
 
  ___
  freebsd-wireless@freebsd.org mailing list
  http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
  To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org
 ___
 freebsd-wireless@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
 To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org



___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org


Re: pcap_inject() ruins my handmade packets

2014-10-23 Thread clutton
On Thu, 2014-10-23 at 17:32 -0700, Adrian Chadd wrote:
 Which version of FreeBSD are you using?
 
 I only recently fixed raw frame injection in monitor mode in
 FreeBSD-11. How are you trying to do raw frame injection?
 
 
 -adrian

HEAD, but I didn't update it more then month.
I'm not using monitor mode, just ordinary one when I'm connected to AP,
and ahdemo. Seems raw write works with both types well, and
pcap_inject() doesn't.

The scenario is that:

handle = pcap_open_live(dev, BUFSIZ, 1, 0, errbuf); // tried without
promisk, didn't help
pcap_set_datalink(handle, DLT_IEEE802_11_RADIO);
 // I've tried others datalinks, and also skipping setting this like
Linux users do, changing datalink here changes the way how packet is
corrupted
BUILD_PACKET_STEP()
pcap_inject(handle, packet, packet_len);




___
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to freebsd-wireless-unsubscr...@freebsd.org