From owner-freebsd-net@FreeBSD.ORG Sun Jun 11 12:52:25 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DD33D16A41F for ; Sun, 11 Jun 2006 12:52:25 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 33E8E43D45 for ; Sun, 11 Jun 2006 12:52:25 +0000 (GMT) (envelope-from max@love2party.net) Received: from [88.64.176.255] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis), id 0MKwtQ-1FpPQQ0u56-0000se; Sun, 11 Jun 2006 14:52:20 +0200 From: Max Laier Organization: FreeBSD To: "Shaun Colley" Date: Sun, 11 Jun 2006 14:52:05 +0200 User-Agent: KMail/1.9.1 References: <52706.81.107.58.115.1149986191.squirrel@webmail.rsc.cx> <200606111308.28468.max@love2party.net> <52332.81.107.58.115.1150028941.squirrel@webmail.rsc.cx> In-Reply-To: <52332.81.107.58.115.1150028941.squirrel@webmail.rsc.cx> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1859497.ntLraXUpWu"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200606111452.17556.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de login:61c499deaeeba3ba5be80f48ecc83056 Cc: freebsd-net@freebsd.org Subject: Re: Unexpected behavior after altering inetsw[] switch table X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jun 2006 12:52:25 -0000 --nextPart1859497.ntLraXUpWu Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 11 June 2006 14:29, Shaun Colley wrote: > Hi Max & group, > > > As you can see in netinet/in_proto.c, tcp does not use pr_output, but > > calls > > tcp_output() directly where needed. Depending on what you want to achi= ve > > it > > might be enough to hack up tcp_usr_send() and replace > > tcp_usrreqs.pru_send instead. Replaceing tcp_output() is not easily > > possible. You could start with telling us what you *really* want to do = so > > we can point you to a workable option. > > Right, I'll start by telling you what I'm actually trying to achieve. > Everytime an IP datagram with a TCP header is sent, I want to mangle (i.e. > modify) part of the TCP packet and it's payload with 'random' data. > Although this may sound a bit pointless, I want to do this to implement a > form of dumb fuzzing, which is a form of stress testing used a lot in > computer security. Does that make a bit of sense? > > So I was attempting to modify the pr_output hook for TCP (which I now know > isn't possible) and replace it with a ptr to my own hacked tcp_output > routine. > > Can you see a way to do what I'm trying to achieve? You should tap into the generic IP packet filter hook and modify the packet= =20 from there. Look in netinet/ip_fw_pfil.c or contrib/pf/net/pf_ioctl.c for= =20 examples how to place a hook in there. The PFIL_OUT hook is what you want= =20 and lets you see every packet sent outbound after IP header has been=20 prepended. You will have to do some parsing of the IP header to get to the= =20 TCP part, but ip_fw2.c and pf.c should offer enough information on how to d= o=20 that. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart1859497.ntLraXUpWu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQBEjBIBXyyEoT62BG0RAnX4AJ9WnxdBXqthanMDWslKxWt/A1uUVwCeOjip MxKykqr51/Mx+i0eqn0fqVQ= =7ehD -----END PGP SIGNATURE----- --nextPart1859497.ntLraXUpWu--