From owner-freebsd-wireless@FreeBSD.ORG Thu Oct 30 16:21:26 2014 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 657E0F86; Thu, 30 Oct 2014 16:21:26 +0000 (UTC) Received: from sender1.zohomail.com (sender1.zohomail.com [74.201.84.156]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44079ECA; Thu, 30 Oct 2014 16:21:25 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version; b=JDtsWrRyS5PcteXXJUYRz7U32Vphh4f7wZF8++VsgO68QQWGEurGc7k9eV41vvov2FEUVgEnn+2u CApGkU5tKI+td7dG+h6fWlzYLi7q7QytTV3bHMUsizYIBDccbVNU Received: from [192.168.11.5] (46.229.54.117 [46.229.54.117]) by mx.zohomail.com with SMTPS id 1414686082083646.950874524199; Thu, 30 Oct 2014 09:21:22 -0700 (PDT) Subject: Re: pcap_inject() ruins my handmade packets From: clutton To: freebsd-wireless@freebsd.org In-Reply-To: References: <1414110110.1395.14.camel@eva02.mbsd> <1414285536.12280.6.camel@eva02.mbsd> <1414685517.8086.15.camel@eva02.mbsd> Content-Type: text/plain; charset="UTF-8" Date: Thu, 30 Oct 2014 18:21:18 +0200 Message-ID: <1414686078.8086.21.camel@eva02.mbsd> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-ZohoMail: Ss SS_10 UW UB ZCF-710TPL UW UB SF_TD_EXT SGR3_1_23094_82 X-ZohoMail-Owner: <1414686078.8086.21.camel@eva02.mbsd>+zmo_0_ X-ZohoMail-Sender: 46.229.54.117 X-Zoho-Virus-Status: 2 X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Oct 2014 16:21:26 -0000 On Thu, 2014-10-30 at 09:13 -0700, Adrian Chadd wrote: > Hah, what was your actual code that worked? >=20 > And hm, there are some things in the radiotap header that the raw > transmit path pays attention to. >=20 >=20 >=20 > -adrian >=20 >=20 > On 30 October 2014 09:11, clutton wrote: > > On Sat, 2014-10-25 at 19:54 -0700, Adrian Chadd wrote: > >> On 25 October 2014 18:05, clutton 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-injecti= on.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 t= he > >> > 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 =C2=ABreaver=C2=BB 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. The program I work with is [rever] https://code.google.com/p/reaver-wps I looked at aircrack-ng sources, and tools/net80211 and none of them includes radiotap headers for injection, when I do I have corrupted packets.