From nobody Sat Feb 4 02:51:38 2023 X-Original-To: freebsd-security@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P7xqy2Rg7z3kYr1 for ; Sat, 4 Feb 2023 02:51:42 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P7xqx3QFbz45JG for ; Sat, 4 Feb 2023 02:51:41 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; dkim=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.32) smtp.mailfrom=cy.schubert@cschubert.com; dmarc=none Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id O01SpiXMZc9C4O8eSpNwfK; Sat, 04 Feb 2023 02:51:40 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id O8eRpToex3fOSO8eSpBKnD; Sat, 04 Feb 2023 02:51:40 +0000 X-Authority-Analysis: v=2.4 cv=J8G5USrS c=1 sm=1 tr=0 ts=63ddc83c a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=m04uMKEZRckA:10 a=auHYCxwYAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=ncAhmZ006X6_3sS83AwA:9 a=CjuIK1q_8ugA:10 a=67XU6oJk2Lrwzah0vfu5:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id D63D23AC; Fri, 3 Feb 2023 18:51:38 -0800 (PST) Received: by slippy.cwsent.com (Postfix, from userid 1000) id 974A212F; Fri, 3 Feb 2023 18:51:38 -0800 (PST) X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Sambuddho Chakravarty cc: freebsd-security@freebsd.org Subject: Re: help regarding IP address spoofing (when using nmap) In-reply-to: References: Comments: In-reply-to Sambuddho Chakravarty message dated "Thu, 02 Feb 2023 16:19:57 +0530." List-Id: Security issues List-Archive: https://lists.freebsd.org/archives/freebsd-security List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-security@freebsd.org X-BeenThere: freebsd-security@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 03 Feb 2023 18:51:38 -0800 Message-Id: <20230204025138.974A212F@slippy.cwsent.com> X-CMAE-Envelope: MS4xfKsYgPwkX/Us1hM3SAUNN0d70IZARWOkTepmH8DG5kQ7Sjs7HwRdaX7rGHBUlSMUnWcFLT6hvaM0r8XpBFKijf7iYckMT6910/yHySJ6gWGojXcz4s7J pEXdvOIbrWd/wVmjXK1jTOUpqmmVvAMDCT8i6QPvV/vPpSYuaHKYDY4EAgFduGihKp7OO5TAz0H5IAWOjpRgwJ2xuf7QkpNUiU5EcUge3WucdpxjWvZPAspm fRadrYiptK2VSlvDjOuAVQ== X-Spamd-Result: default: False [-1.70 / 15.00]; AUTH_NA(1.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.998]; MV_CASE(0.50)[]; RCVD_IN_DNSWL_LOW(-0.10)[3.97.99.32:from]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-security@freebsd.org]; RCPT_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[3.97.99.32:from]; RCVD_TLS_LAST(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com] X-Rspamd-Queue-Id: 4P7xqx3QFbz45JG X-Spamd-Bar: - X-ThisMailContainsUnwantedMimeParts: N In message , Sambuddho Chakravarty writes: > --0000000000000384a005f3b55664 > Content-Type: text/plain; charset="UTF-8" > > Hi All > I am a relatively newbie to FreeBSD (earlier was running > Linux). I am running FreeBSD 13.1. > > I am trying to run nmap with source IP address spoofing > (for some academic purposes). It works fine with Linux > but on FreeBSD I get the following error: > > # nmap -e re0 -S 192.168.17.92 -sS 143.110.249.18 -p 8080 -Pn > Starting Nmap 7.93 ( https://nmap.org ) at 2023-02-02 16:04 IST > NSOCK ERROR [0.0170s] mksock_bind_addr(): Bind to 192.168.17.92:0 failed > (IOD #1): Can't assign requested address (49) > NSOCK ERROR [0.0170s] mksock_bind_addr(): Bind to 192.168.17.92:0 failed > (IOD #2): Can't assign requested address (49) I tried the following from my laptop (IP 10.1.1.91) to one of my machines on my network 10.1.1.7. slippy# nmap -e lagg0 -S 192.168.17.92 -sS 10.1.1.7 -p 8080 -Pn Starting Nmap 7.93 ( https://nmap.org ) at 2023-02-03 18:43 PST Nmap scan report for bob (10.1.1.7) Host is up (0.00040s latency). PORT STATE SERVICE 8080/tcp filtered http-proxy MAC Address: xx:xx:xx:xx:xx:xx (NIC manufacturer name was here) Nmap done: 1 IP address (1 host up) scanned in 0.36 seconds slippy# tcpdump showed the following on the target system. 18:43:06.847120 ARP, Request who-has 10.1.1.7 tell 192.168.17.92, length 46 18:43:06.847143 ARP, Reply 10.1.1.7 is-at xx:xx:xx:xx:xx, length 28 18:43:06.880860 IP 192.168.17.92.33262 > 10.1.1.7.8080: Flags [S], seq 1331497492, win 1024, options [mss 1460], length 0 18:43:06.880897 IP 10.1.1.7.8080 > 192.168.17.92.33262: Flags [R.], seq 0, ack 1331497493, win 0, length 0 18:43:06.987099 IP 192.168.17.92.33264 > 10.1.1.7.8080: Flags [S], seq 1331628566, win 1024, options [mss 1460], length 0 18:43:06.987133 IP 10.1.1.7.8080 > 192.168.17.92.33264: Flags [R.], seq 0, ack 1331628567, win 0, length 0 I have nothing listening on port 8080 thus 10.1.1.7 correctly replied with a RST. > > > It works fine without the source spoofing but doesn't when I use > it. I can however use my own machine's source IP address with > the '-S' option. As you can see from above it worked fine here. Were you running it under root or some other account? Was there something else bound to that address? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=0