xref: /freebsd/share/man/man4/blackhole.4 (revision 7245b843bbf713f529d62f4dfba7c6e392abd9b0)
1849d3459SGeoff Rehmet.\"
2849d3459SGeoff Rehmet.\" blackhole - drop refused TCP or UDP connects
3849d3459SGeoff Rehmet.\"
4849d3459SGeoff Rehmet.\" Redistribution and use in source and binary forms, with or without
5849d3459SGeoff Rehmet.\" modification, are permitted provided that the following conditions
6849d3459SGeoff Rehmet.\" are met:
7849d3459SGeoff Rehmet.\" 1. Redistributions of source code must retain the above copyright
8849d3459SGeoff Rehmet.\"    notice, this list of conditions and the following disclaimer.
9849d3459SGeoff Rehmet.\" 2. Redistributions in binary form must reproduce the above copyright
10849d3459SGeoff Rehmet.\"    notice, this list of conditions and the following disclaimer in the
11849d3459SGeoff Rehmet.\"    documentation and/or other materials provided with the distribution.
12849d3459SGeoff Rehmet.\"
13849d3459SGeoff Rehmet.\"
147f3dea24SPeter Wemm.\" $FreeBSD$
15*7245b843SAllan Jude.Dd September 6, 2015
16849d3459SGeoff Rehmet.Dt BLACKHOLE 4
173d45e180SRuslan Ermilov.Os
18849d3459SGeoff Rehmet.Sh NAME
198b8f358eSMike Pritchard.Nm blackhole
20849d3459SGeoff Rehmet.Nd a
21849d3459SGeoff Rehmet.Xr sysctl 8
22*7245b843SAllan JudeMIB for manipulating behaviour in respect of refused SCTP, TCP, or UDP connection
2359322008SRuslan Ermilovattempts
24849d3459SGeoff Rehmet.Sh SYNOPSIS
25*7245b843SAllan Jude.Cd sysctl net.inet.sctp.blackhole Ns Op = Ns Brq "0 | 1 | 2"
26*7245b843SAllan Jude.Cd sysctl net.inet.tcp.blackhole Ns Op = Ns Brq "0 | 1 | 2"
27*7245b843SAllan Jude.Cd sysctl net.inet.udp.blackhole Ns Op = Ns Brq "0 | 1"
28849d3459SGeoff Rehmet.Sh DESCRIPTION
29849d3459SGeoff RehmetThe
30849d3459SGeoff Rehmet.Nm
31849d3459SGeoff Rehmet.Xr sysctl 8
32849d3459SGeoff RehmetMIB is used to control system behaviour when connection requests
33*7245b843SAllan Judeare received on SCTP, TCP, or UDP ports where there is no socket listening.
34849d3459SGeoff Rehmet.Pp
35*7245b843SAllan JudeThe blackhole behaviour is useful to slow down an attacker who is port-scanning
36*7245b843SAllan Judea system in an attempt to detect vulnerable services.
37*7245b843SAllan JudeIt might also slow down an attempted denial of service attack.
38*7245b843SAllan Jude.Ss SCTP
39*7245b843SAllan JudeSetting the SCTP blackhole MIB to a numeric value of one
40*7245b843SAllan Judewill prevent sending an ABORT packet in response to an incoming INIT.
41*7245b843SAllan JudeA MIB value of two will do the same, but will also prevent sending an ABORT packet
42*7245b843SAllan Judewhen unexpected packets are received.
43*7245b843SAllan Jude.Ss TCP
44849d3459SGeoff RehmetNormal behaviour, when a TCP SYN segment is received on a port where
45849d3459SGeoff Rehmetthere is no socket accepting connections, is for the system to return
46b5e7e999SRuslan Ermilova RST segment, and drop the connection.
47b5e7e999SRuslan ErmilovThe connecting system will
48b5e7e999SRuslan Ermilovsee this as a
49b5e7e999SRuslan Ermilov.Dq Connection refused .
50b5e7e999SRuslan ErmilovBy setting the TCP blackhole
51235a25a6SDima DorfmanMIB to a numeric value of one, the incoming SYN segment
5245a033b1SGeoff Rehmetis merely dropped, and no RST is sent, making the system appear
53b5e7e999SRuslan Ermilovas a blackhole.
54b5e7e999SRuslan ErmilovBy setting the MIB value to two, any segment arriving
55b5e7e999SRuslan Ermilovon a closed port is dropped without returning a RST.
56b5e7e999SRuslan ErmilovThis provides some degree of protection against stealth port scans.
57*7245b843SAllan Jude.Ss UDP
58*7245b843SAllan JudeEnabling blackhole behaviour turns off the sending
59849d3459SGeoff Rehmetof an ICMP port unreachable message in response to a UDP datagram which
60b5e7e999SRuslan Ermilovarrives on a port where there is no socket listening.
61b5e7e999SRuslan ErmilovIt must be noted that this behaviour will prevent remote systems from running
62849d3459SGeoff Rehmet.Xr traceroute 8
63235a25a6SDima Dorfmanto a system.
64849d3459SGeoff Rehmet.Sh WARNING
65*7245b843SAllan JudeThe SCTP, TCP, and UDP blackhole features should not be regarded as a replacement
6676de453cSDaniel Gerzofor firewall solutions.
6776de453cSDaniel GerzoBetter security would consist of the
6876de453cSDaniel Gerzo.Nm
6976de453cSDaniel Gerzo.Xr sysctl 8
70b06cfd40SJoel DahlMIB used in conjunction with one of the available firewall packages.
71849d3459SGeoff Rehmet.Pp
72235a25a6SDima DorfmanThis mechanism is not a substitute for securing a system.
73235a25a6SDima DorfmanIt should be used together with other security mechanisms.
748b8f358eSMike Pritchard.Sh SEE ALSO
758b8f358eSMike Pritchard.Xr ip 4 ,
76*7245b843SAllan Jude.Xr sctp 4 ,
778b8f358eSMike Pritchard.Xr tcp 4 ,
788b8f358eSMike Pritchard.Xr udp 4 ,
7976de453cSDaniel Gerzo.Xr ipf 8 ,
808b8f358eSMike Pritchard.Xr ipfw 8 ,
8176de453cSDaniel Gerzo.Xr pfctl 8 ,
82849d3459SGeoff Rehmet.Xr sysctl 8
83849d3459SGeoff Rehmet.Sh HISTORY
84849d3459SGeoff RehmetThe TCP and UDP
85849d3459SGeoff Rehmet.Nm
86849d3459SGeoff RehmetMIBs
87849d3459SGeoff Rehmetfirst appeared in
888b8f358eSMike Pritchard.Fx 4.0 .
89*7245b843SAllan Jude.Pp
90*7245b843SAllan JudeThe SCTP
91*7245b843SAllan Jude.Nm
92*7245b843SAllan JudeMIB first appeared in
93*7245b843SAllan Jude.Fx 9.1 .
949cbda590SRuslan Ermilov.Sh AUTHORS
959cbda590SRuslan Ermilov.An Geoffrey M. Rehmet
96