Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
Apache/2.4.59 (Debian)
: 10.2.73.233 | : 18.226.88.18
Cant Read [ /etc/named.conf ]
5.6.40-64+0~20230107.71+debian10~1.gbp673146
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
src /
xtables-addons-2.12 /
extensions /
[ HOME SHELL ]
Name
Size
Permission
Action
ACCOUNT
[ DIR ]
drwxr-xr-x
pknock
[ DIR ]
drwxr-xr-x
Kbuild
1020
B
-rw-r--r--
Makefile
14.31
KB
-rw-r--r--
Makefile.am
910
B
-rw-r--r--
Makefile.in
13.55
KB
-rw-r--r--
Mbuild
989
B
-rw-r--r--
compat_skbuff.h
325
B
-rw-r--r--
compat_user.h
262
B
-rw-r--r--
compat_xtables.c
1.18
KB
-rw-r--r--
compat_xtables.h
2.52
KB
-rw-r--r--
compat_xtnu.h
1.97
KB
-rw-r--r--
libxt_CHAOS.c
2.56
KB
-rw-r--r--
libxt_CHAOS.man
1
KB
-rw-r--r--
libxt_DELUDE.c
1.11
KB
-rw-r--r--
libxt_DELUDE.man
286
B
-rw-r--r--
libxt_DHCPMAC.c
2.55
KB
-rw-r--r--
libxt_DHCPMAC.man
1.2
KB
-rw-r--r--
libxt_DNETMAP.c
6.62
KB
-rw-r--r--
libxt_DNETMAP.man
7.71
KB
-rw-r--r--
libxt_ECHO.c
1.03
KB
-rw-r--r--
libxt_ECHO.man
141
B
-rw-r--r--
libxt_IPMARK.c
4.71
KB
-rw-r--r--
libxt_IPMARK.man
1.99
KB
-rw-r--r--
libxt_LOGMARK.c
3.27
KB
-rw-r--r--
libxt_LOGMARK.man
312
B
-rw-r--r--
libxt_SYSRQ.c
844
B
-rw-r--r--
libxt_SYSRQ.man
3.67
KB
-rw-r--r--
libxt_TARPIT.c
2.75
KB
-rw-r--r--
libxt_TARPIT.man
2.55
KB
-rw-r--r--
libxt_condition.c
2.5
KB
-rw-r--r--
libxt_condition.man
175
B
-rw-r--r--
libxt_dhcpmac.c
2.52
KB
-rw-r--r--
libxt_dhcpmac.man
207
B
-rw-r--r--
libxt_fuzzy.c
3.37
KB
-rw-r--r--
libxt_fuzzy.man
263
B
-rw-r--r--
libxt_geoip.c
8.21
KB
-rw-r--r--
libxt_geoip.man
1
KB
-rw-r--r--
libxt_gradm.c
2.3
KB
-rw-r--r--
libxt_gradm.man
225
B
-rw-r--r--
libxt_iface.c
7.21
KB
-rw-r--r--
libxt_iface.man
1.39
KB
-rw-r--r--
libxt_ipp2p.c
7.36
KB
-rw-r--r--
libxt_ipp2p.man
1.52
KB
-rw-r--r--
libxt_ipv4options.c
4.32
KB
-rw-r--r--
libxt_ipv4options.man
1.44
KB
-rw-r--r--
libxt_length2.c
4.69
KB
-rw-r--r--
libxt_length2.man
695
B
-rw-r--r--
libxt_lscan.c
2.64
KB
-rw-r--r--
libxt_lscan.man
1.58
KB
-rw-r--r--
libxt_psd.c
5.34
KB
-rw-r--r--
libxt_psd.man
720
B
-rw-r--r--
libxt_quota2.c
4.06
KB
-rw-r--r--
libxt_quota2.man
1.6
KB
-rw-r--r--
mac.c
572
B
-rw-r--r--
xt_CHAOS.c
6.29
KB
-rw-r--r--
xt_CHAOS.h
249
B
-rw-r--r--
xt_DELUDE.c
4.96
KB
-rw-r--r--
xt_DHCPMAC.c
4.18
KB
-rw-r--r--
xt_DHCPMAC.h
311
B
-rw-r--r--
xt_DNETMAP.c
25.22
KB
-rw-r--r--
xt_DNETMAP.h
402
B
-rw-r--r--
xt_ECHO.c
6.98
KB
-rw-r--r--
xt_IPMARK.c
2.75
KB
-rw-r--r--
xt_IPMARK.h
252
B
-rw-r--r--
xt_LOGMARK.c
3.96
KB
-rw-r--r--
xt_LOGMARK.h
209
B
-rw-r--r--
xt_SYSRQ.c
9.75
KB
-rw-r--r--
xt_TARPIT.c
14.94
KB
-rw-r--r--
xt_TARPIT.h
258
B
-rw-r--r--
xt_condition.c
6.75
KB
-rw-r--r--
xt_condition.h
276
B
-rw-r--r--
xt_fuzzy.c
4.65
KB
-rw-r--r--
xt_fuzzy.h
397
B
-rw-r--r--
xt_geoip.c
8.73
KB
-rw-r--r--
xt_geoip.h
1.34
KB
-rw-r--r--
xt_gradm.h
108
B
-rw-r--r--
xt_iface.c
3.32
KB
-rw-r--r--
xt_iface.h
596
B
-rw-r--r--
xt_ipp2p.c
23.63
KB
-rw-r--r--
xt_ipp2p.h
995
B
-rw-r--r--
xt_ipv4options.c
1.96
KB
-rw-r--r--
xt_ipv4options.h
581
B
-rw-r--r--
xt_length2.c
6.99
KB
-rw-r--r--
xt_length2.h
457
B
-rw-r--r--
xt_lscan.c
7.85
KB
-rw-r--r--
xt_lscan.h
200
B
-rw-r--r--
xt_psd.c
14.2
KB
-rw-r--r--
xt_psd.h
792
B
-rw-r--r--
xt_quota2.c
9
KB
-rw-r--r--
xt_quota2.h
478
B
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : xt_geoip.c
/* iptables kernel module for the geoip match * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Copyright (c) 2004, 2005, 2006, 2007, 2008 * Samuel Jean & Nicolas Bouliane */ #include <linux/ip.h> #include <linux/ipv6.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/module.h> #include <linux/netdevice.h> #include <linux/rcupdate.h> #include <linux/skbuff.h> #include <linux/version.h> #include <linux/vmalloc.h> #include <linux/netfilter/x_tables.h> #include <asm/atomic.h> #include <asm/uaccess.h> #include "xt_geoip.h" #include "compat_xtables.h" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Nicolas Bouliane"); MODULE_AUTHOR("Samuel Jean"); MODULE_DESCRIPTION("xtables module for geoip match"); MODULE_ALIAS("ip6t_geoip"); MODULE_ALIAS("ipt_geoip"); enum geoip_proto { GEOIPROTO_IPV6, GEOIPROTO_IPV4, __GEOIPROTO_MAX, }; /** * @list: anchor point for geoip_head * @subnets: packed ordered list of ranges (either v6 or v4) * @count: number of ranges * @cc: country code */ struct geoip_country_kernel { struct list_head list; void *subnets; atomic_t ref; unsigned int count; unsigned short cc; }; static struct list_head geoip_head[__GEOIPROTO_MAX]; static DEFINE_SPINLOCK(geoip_lock); static const enum geoip_proto nfp2geo[] = { [NFPROTO_IPV6] = GEOIPROTO_IPV6, [NFPROTO_IPV4] = GEOIPROTO_IPV4, }; static const size_t geoproto_size[] = { [GEOIPROTO_IPV6] = sizeof(struct geoip_subnet6), [GEOIPROTO_IPV4] = sizeof(struct geoip_subnet4), }; static struct geoip_country_kernel * geoip_add_node(const struct geoip_country_user __user *umem_ptr, enum geoip_proto proto) { struct geoip_country_user umem; struct geoip_country_kernel *p; size_t size; void *subnet; int ret; if (copy_from_user(&umem, umem_ptr, sizeof(umem)) != 0) return ERR_PTR(-EFAULT); p = kmalloc(sizeof(struct geoip_country_kernel), GFP_KERNEL); if (p == NULL) return ERR_PTR(-ENOMEM); p->count = umem.count; p->cc = umem.cc; size = p->count * geoproto_size[proto]; if (size == 0) { /* * Believe it or not, vmalloc prints a warning to dmesg for * zero-sized allocations :-/ */ subnet = NULL; } else { subnet = vmalloc(size); if (subnet == NULL) { ret = -ENOMEM; goto free_p; } } if (copy_from_user(subnet, (const void __user *)(unsigned long)umem.subnets, size) != 0) { ret = -EFAULT; goto free_s; } p->subnets = subnet; atomic_set(&p->ref, 1); INIT_LIST_HEAD(&p->list); spin_lock(&geoip_lock); list_add_tail_rcu(&p->list, &geoip_head[proto]); spin_unlock(&geoip_lock); return p; free_s: vfree(subnet); free_p: kfree(p); return ERR_PTR(ret); } static void geoip_try_remove_node(struct geoip_country_kernel *p) { spin_lock(&geoip_lock); if (!atomic_dec_and_test(&p->ref)) { spin_unlock(&geoip_lock); return; } /* So now am unlinked or the only one alive, right ? * What are you waiting ? Free up some memory! */ list_del_rcu(&p->list); spin_unlock(&geoip_lock); synchronize_rcu(); vfree(p->subnets); kfree(p); } static struct geoip_country_kernel *find_node(unsigned short cc, enum geoip_proto proto) { struct geoip_country_kernel *p; spin_lock(&geoip_lock); list_for_each_entry_rcu(p, &geoip_head[proto], list) if (p->cc == cc) { atomic_inc(&p->ref); spin_unlock(&geoip_lock); return p; } spin_unlock(&geoip_lock); return NULL; } static inline int ipv6_cmp(const struct in6_addr *p, const struct in6_addr *q) { unsigned int i; for (i = 0; i < 4; ++i) { if (p->s6_addr32[i] < q->s6_addr32[i]) return -1; else if (p->s6_addr32[i] > q->s6_addr32[i]) return 1; } return 0; } static bool geoip_bsearch6(const struct geoip_subnet6 *range, const struct in6_addr *addr, int lo, int hi) { int mid; while (true) { if (hi <= lo) return false; mid = (lo + hi) / 2; if (ipv6_cmp(&range[mid].begin, addr) <= 0 && ipv6_cmp(addr, &range[mid].end) <= 0) return true; if (ipv6_cmp(&range[mid].begin, addr) > 0) hi = mid; else if (ipv6_cmp(&range[mid].end, addr) < 0) lo = mid + 1; else break; } WARN_ON(true); return false; } static bool xt_geoip_mt6(const struct sk_buff *skb, struct xt_action_param *par) { const struct xt_geoip_match_info *info = par->matchinfo; const struct geoip_country_kernel *node; const struct ipv6hdr *iph = ipv6_hdr(skb); unsigned int i; struct in6_addr ip; memcpy(&ip, (info->flags & XT_GEOIP_SRC) ? &iph->saddr : &iph->daddr, sizeof(ip)); for (i = 0; i < 4; ++i) ip.s6_addr32[i] = ntohl(ip.s6_addr32[i]); rcu_read_lock(); for (i = 0; i < info->count; i++) { if ((node = info->mem[i].kernel) == NULL) { printk(KERN_ERR "xt_geoip: what the hell ?? '%c%c' isn't loaded into memory... skip it!\n", COUNTRY(info->cc[i])); continue; } if (geoip_bsearch6(node->subnets, &ip, 0, node->count)) { rcu_read_unlock(); return !(info->flags & XT_GEOIP_INV); } } rcu_read_unlock(); return info->flags & XT_GEOIP_INV; } static bool geoip_bsearch4(const struct geoip_subnet4 *range, uint32_t addr, int lo, int hi) { int mid; while (true) { if (hi <= lo) return false; mid = (lo + hi) / 2; if (range[mid].begin <= addr && addr <= range[mid].end) return true; if (range[mid].begin > addr) hi = mid; else if (range[mid].end < addr) lo = mid + 1; else break; } WARN_ON(true); return false; } static bool xt_geoip_mt4(const struct sk_buff *skb, struct xt_action_param *par) { const struct xt_geoip_match_info *info = par->matchinfo; const struct geoip_country_kernel *node; const struct iphdr *iph = ip_hdr(skb); unsigned int i; uint32_t ip; ip = ntohl((info->flags & XT_GEOIP_SRC) ? iph->saddr : iph->daddr); rcu_read_lock(); for (i = 0; i < info->count; i++) { if ((node = info->mem[i].kernel) == NULL) { printk(KERN_ERR "xt_geoip: what the hell ?? '%c%c' isn't loaded into memory... skip it!\n", COUNTRY(info->cc[i])); continue; } if (geoip_bsearch4(node->subnets, ip, 0, node->count)) { rcu_read_unlock(); return !(info->flags & XT_GEOIP_INV); } } rcu_read_unlock(); return info->flags & XT_GEOIP_INV; } static int xt_geoip_mt_checkentry(const struct xt_mtchk_param *par) { struct xt_geoip_match_info *info = par->matchinfo; struct geoip_country_kernel *node; unsigned int i; for (i = 0; i < info->count; i++) { node = find_node(info->cc[i], nfp2geo[par->family]); if (node == NULL) { node = geoip_add_node((const void __user *)(unsigned long)info->mem[i].user, nfp2geo[par->family]); if (IS_ERR(node)) { printk(KERN_ERR "xt_geoip: unable to load '%c%c' into memory: %ld\n", COUNTRY(info->cc[i]), PTR_ERR(node)); return PTR_ERR(node); } } /* Overwrite the now-useless pointer info->mem[i] with * a pointer to the node's kernelspace structure. * This avoids searching for a node in the match() and * destroy() functions. */ info->mem[i].kernel = node; } return 0; } static void xt_geoip_mt_destroy(const struct xt_mtdtor_param *par) { struct xt_geoip_match_info *info = par->matchinfo; struct geoip_country_kernel *node; unsigned int i; /* This entry has been removed from the table so * decrease the refcount of all countries it is * using. */ for (i = 0; i < info->count; i++) if ((node = info->mem[i].kernel) != NULL) { /* Free up some memory if that node isn't used * anymore. */ geoip_try_remove_node(node); } else /* Something strange happened. There's no memory allocated for this * country. Please send this bug to the mailing list. */ printk(KERN_ERR "xt_geoip: What happened peejix ? What happened acidfu ?\n" "xt_geoip: please report this bug to the maintainers\n"); } static struct xt_match xt_geoip_match[] __read_mostly = { { .name = "geoip", .revision = 1, .family = NFPROTO_IPV6, .match = xt_geoip_mt6, .checkentry = xt_geoip_mt_checkentry, .destroy = xt_geoip_mt_destroy, .matchsize = sizeof(struct xt_geoip_match_info), .me = THIS_MODULE, }, { .name = "geoip", .revision = 1, .family = NFPROTO_IPV4, .match = xt_geoip_mt4, .checkentry = xt_geoip_mt_checkentry, .destroy = xt_geoip_mt_destroy, .matchsize = sizeof(struct xt_geoip_match_info), .me = THIS_MODULE, }, }; static int __init xt_geoip_mt_init(void) { unsigned int i; for (i = 0; i < ARRAY_SIZE(geoip_head); ++i) INIT_LIST_HEAD(&geoip_head[i]); return xt_register_matches(xt_geoip_match, ARRAY_SIZE(xt_geoip_match)); } static void __exit xt_geoip_mt_fini(void) { xt_unregister_matches(xt_geoip_match, ARRAY_SIZE(xt_geoip_match)); } module_init(xt_geoip_mt_init); module_exit(xt_geoip_mt_fini);
Close