exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

nmap-freak-patch

nmap-freak-patch
Posted Feb 19, 2002
Authored by jaguar

This is a kernel patch to prevent stealth, fin, and rst scans. Also slows down the tcp connect scan. Tested on debian potato running 2.4.16. Tested with nmap and queso - Changes OS fingerprint.

tags | kernel, tcp, patch
systems | linux, unix, debian
SHA-256 | 34dc5fef83c2a347dc0f9e61a28b304f44dd7ead8a44a36b2bf875b32880c4a0

nmap-freak-patch

Change Mirror Download
This is a patch to prevent  stealth,fin,rst scans and slows
down the tcp connect scan. well on the 2.4.16 kernel it doesnt
Fingerprint the remote os . tested on debian potato running 2.4.16
Tested with nmap and queso .
well you have to recompile your kernel with the nmap-freak-patch option
checked
and to turn on the antiscan feature you can set it using proc

echo 1 > /proc/sys/net/ipv4/tcp_restrict
echo 1 > /proc/sys/net/ipv4/icmp_restrict



jaguar@vcert.org








----------------cut here------------------------

Only in linux-2.4.16/net/ipv4/: .depend
diff -uxr kernel-source-2.4.16/net/ipv4/Config.in linux-2.4.16/net/ipv4/Config.in
--- kernel-source-2.4.16/net/ipv4/Config.in Sat Sep 29 08:13:17 2001
+++ linux-2.4.16/net/ipv4/Config.in Mon Jan 28 05:59:51 2002
@@ -48,6 +48,7 @@
bool ' IP: disable ECN support by default' CONFIG_INET_ECN_DISABLED
fi
bool ' IP: TCP syncookie support (disabled per default)' CONFIG_SYN_COOKIES
+bool ' IP: NMAP freak patch ' NMAP_FREAK_PATCH
if [ "$CONFIG_NETFILTER" != "n" ]; then
source net/ipv4/netfilter/Config.in
fi
diff -uxr kernel-source-2.4.16/net/ipv4/icmp.c linux-2.4.16/net/ipv4/icmp.c
--- kernel-source-2.4.16/net/ipv4/icmp.c Thu Nov 8 04:09:36 2001
+++ linux-2.4.16/net/ipv4/icmp.c Mon Jan 28 05:47:52 2002
@@ -143,6 +143,10 @@
int sysctl_icmp_echo_ignore_all;
int sysctl_icmp_echo_ignore_broadcasts;

+#ifdef NMAP_FREAK_PATCH
+int sysctl_icmp_restrict = 0;
+#endif
+
/* Control parameter - ignore bogus broadcast responses? */
int sysctl_icmp_ignore_bogus_error_responses;

@@ -783,7 +787,10 @@
icmp_param.offset=0;
icmp_param.data_len=0;
icmp_param.head_len=sizeof(struct icmphdr)+12;
+#ifdef NMAP_FREAK_PATCH
+ if(!sysctl_icmp_restrict)
icmp_reply(&icmp_param, skb);
+#endif
}


Common subdirectories: kernel-source-2.4.16/net/ipv4/netfilter and linux-2.4.16/net/ipv4/netfilter
diff -uxr kernel-source-2.4.16/net/ipv4/sysctl_net_ipv4.c linux-2.4.16/net/ipv4/sysctl_net_ipv4.c
--- kernel-source-2.4.16/net/ipv4/sysctl_net_ipv4.c Wed Oct 31 04:38:12 2001
+++ linux-2.4.16/net/ipv4/sysctl_net_ipv4.c Mon Jan 28 06:13:38 2002
@@ -35,6 +35,11 @@
extern int sysctl_icmp_ratelimit;
extern int sysctl_icmp_ratemask;

+#ifdef NMAP_FREAK_PATCH
+extern int sysctl_icmp_restrict;
+extern int sysctl_tcp_restrict;
+#endif
+
/* From igmp.c */
extern int sysctl_igmp_max_memberships;

@@ -153,6 +158,11 @@
{NET_TCP_SYNCOOKIES, "tcp_syncookies",
&sysctl_tcp_syncookies, sizeof(int), 0644, NULL, &proc_dointvec},
#endif
+#ifdef NMAP_FREAK_PATCH
+ {NET_IPV4_ICMP_RESTRICT , "icmp_restrict", &sysctl_icmp_restrict, sizeof(int), 0644, NULL, &proc_dointvec},
+ {NET_IPV4_TCP_RESTRICT , "tcp_restrict", &sysctl_tcp_restrict, sizeof(int), 0644,NULL, &proc_dointvec},
+#endif
+
{NET_TCP_TW_RECYCLE, "tcp_tw_recycle",
&sysctl_tcp_tw_recycle, sizeof(int), 0644, NULL, &proc_dointvec},
{NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow",
diff -uxr kernel-source-2.4.16/net/ipv4/tcp_ipv4.c linux-2.4.16/net/ipv4/tcp_ipv4.c
--- kernel-source-2.4.16/net/ipv4/tcp_ipv4.c Mon Nov 5 23:16:12 2001
+++ linux-2.4.16/net/ipv4/tcp_ipv4.c Mon Jan 28 05:56:33 2002
@@ -63,6 +63,10 @@
#include <linux/stddef.h>
#include <linux/ipsec.h>

+#ifdef NMAP_FREAK_PATCH
+int sysctl_tcp_restrict = 0;
+#endif
+
extern int sysctl_ip_dynaddr;

/* Check TCP sequence numbers in ICMP packets. */
@@ -1038,6 +1042,12 @@
struct tcphdr *th = skb->h.th;
struct tcphdr rth;
struct ip_reply_arg arg;
+
+#ifdef NMAP_FREAK_PATCH
+if(sysctl_tcp_restrict)
+return;
+#endif
+

/* Never send a reset in response to a reset. */
if (th->rst)
-----------------------------------------------------------------



Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    69 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close