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.\" 13*a45a9e61SMichael Tuexen.Dd May 22, 2024 14849d3459SGeoff Rehmet.Dt BLACKHOLE 4 153d45e180SRuslan Ermilov.Os 16849d3459SGeoff Rehmet.Sh NAME 178b8f358eSMike Pritchard.Nm blackhole 18849d3459SGeoff Rehmet.Nd a 19849d3459SGeoff Rehmet.Xr sysctl 8 207245b843SAllan JudeMIB for manipulating behaviour in respect of refused SCTP, TCP, or UDP connection 2159322008SRuslan Ermilovattempts 22849d3459SGeoff Rehmet.Sh SYNOPSIS 237245b843SAllan Jude.Cd sysctl net.inet.sctp.blackhole Ns Op = Ns Brq "0 | 1 | 2" 247245b843SAllan Jude.Cd sysctl net.inet.tcp.blackhole Ns Op = Ns Brq "0 | 1 | 2" 253ea9a7cfSGleb Smirnoff.Cd sysctl net.inet.tcp.blackhole_local Ns Op = Ns Brq "0 | 1" 267245b843SAllan Jude.Cd sysctl net.inet.udp.blackhole Ns Op = Ns Brq "0 | 1" 273ea9a7cfSGleb Smirnoff.Cd sysctl net.inet.udp.blackhole_local 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 337245b843SAllan Judeare received on SCTP, TCP, or UDP ports where there is no socket listening. 34849d3459SGeoff Rehmet.Pp 357245b843SAllan JudeThe blackhole behaviour is useful to slow down an attacker who is port-scanning 367245b843SAllan Judea system in an attempt to detect vulnerable services. 377245b843SAllan JudeIt might also slow down an attempted denial of service attack. 383ea9a7cfSGleb Smirnoff.Pp 393ea9a7cfSGleb SmirnoffThe blackhole behaviour is disabled by default. 403ea9a7cfSGleb SmirnoffIf enabled, the locally originated packets would still be responded to, 413ea9a7cfSGleb Smirnoffunless also 423ea9a7cfSGleb Smirnoff.Va net.inet.tcp.blackhole_local 433ea9a7cfSGleb Smirnoff(for TCP) and/or 443ea9a7cfSGleb Smirnoff.Va net.inet.udp.blackhole_local 453ea9a7cfSGleb Smirnoff(for UDP) are enforced. 467245b843SAllan Jude.Ss SCTP 477245b843SAllan JudeSetting the SCTP blackhole MIB to a numeric value of one 487245b843SAllan Judewill prevent sending an ABORT packet in response to an incoming INIT. 497245b843SAllan JudeA MIB value of two will do the same, but will also prevent sending an ABORT packet 507245b843SAllan Judewhen unexpected packets are received. 517245b843SAllan Jude.Ss TCP 52849d3459SGeoff RehmetNormal behaviour, when a TCP SYN segment is received on a port where 53849d3459SGeoff Rehmetthere is no socket accepting connections, is for the system to return 54*a45a9e61SMichael Tuexena RST segment, and drop the incoming SYN segment. 55b5e7e999SRuslan ErmilovThe connecting system will 56b5e7e999SRuslan Ermilovsee this as a 57b5e7e999SRuslan Ermilov.Dq Connection refused . 58b5e7e999SRuslan ErmilovBy setting the TCP blackhole 59235a25a6SDima DorfmanMIB to a numeric value of one, the incoming SYN segment 6045a033b1SGeoff Rehmetis merely dropped, and no RST is sent, making the system appear 61b5e7e999SRuslan Ermilovas a blackhole. 62b5e7e999SRuslan ErmilovBy setting the MIB value to two, any segment arriving 63b5e7e999SRuslan Ermilovon a closed port is dropped without returning a RST. 64b5e7e999SRuslan ErmilovThis provides some degree of protection against stealth port scans. 657245b843SAllan Jude.Ss UDP 667245b843SAllan JudeEnabling blackhole behaviour turns off the sending 67849d3459SGeoff Rehmetof an ICMP port unreachable message in response to a UDP datagram which 68b5e7e999SRuslan Ermilovarrives on a port where there is no socket listening. 69b5e7e999SRuslan ErmilovIt must be noted that this behaviour will prevent remote systems from running 70849d3459SGeoff Rehmet.Xr traceroute 8 71235a25a6SDima Dorfmanto a system. 72849d3459SGeoff Rehmet.Sh WARNING 737245b843SAllan JudeThe SCTP, TCP, and UDP blackhole features should not be regarded as a replacement 7476de453cSDaniel Gerzofor firewall solutions. 7576de453cSDaniel GerzoBetter security would consist of the 7676de453cSDaniel Gerzo.Nm 7776de453cSDaniel Gerzo.Xr sysctl 8 78b06cfd40SJoel DahlMIB used in conjunction with one of the available firewall packages. 79849d3459SGeoff Rehmet.Pp 80235a25a6SDima DorfmanThis mechanism is not a substitute for securing a system. 81235a25a6SDima DorfmanIt should be used together with other security mechanisms. 828b8f358eSMike Pritchard.Sh SEE ALSO 838b8f358eSMike Pritchard.Xr ip 4 , 847245b843SAllan Jude.Xr sctp 4 , 858b8f358eSMike Pritchard.Xr tcp 4 , 868b8f358eSMike Pritchard.Xr udp 4 , 8776de453cSDaniel Gerzo.Xr ipf 8 , 888b8f358eSMike Pritchard.Xr ipfw 8 , 8976de453cSDaniel Gerzo.Xr pfctl 8 , 90849d3459SGeoff Rehmet.Xr sysctl 8 91849d3459SGeoff Rehmet.Sh HISTORY 92849d3459SGeoff RehmetThe TCP and UDP 93849d3459SGeoff Rehmet.Nm 94849d3459SGeoff RehmetMIBs 95849d3459SGeoff Rehmetfirst appeared in 968b8f358eSMike Pritchard.Fx 4.0 . 977245b843SAllan Jude.Pp 987245b843SAllan JudeThe SCTP 997245b843SAllan Jude.Nm 1007245b843SAllan JudeMIB first appeared in 1017245b843SAllan Jude.Fx 9.1 . 1029cbda590SRuslan Ermilov.Sh AUTHORS 1039cbda590SRuslan Ermilov.An Geoffrey M. Rehmet 104