LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 01-14-2014, 02:27 AM   #1
veto64
LQ Newbie
 
Registered: Jan 2014
Posts: 7

Rep: Reputation: Disabled
How to block all requests from sudomains like *.dynamic-ip.hinet.net


hi,

i'm getting a massive attack requests from different subomains like
36-225-122-51.dynamic-ip.hinet.net
36-226-148-210111-249-1-88.dynamic.hinet.net
111-249-5-234.dynamic.hinet.net
111-249-1-88.dynamic.hinet.net
etc
etc....

how on a debian wheezy can i simply block all request comming from the
subdomains *.dynamic.hinet.net

or block just the root domain with its subdomains.
 
Old 01-14-2014, 02:47 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You might want to actually tell us what kind of requests these are.... HTTP requests??

At a network level you can't realistically block it by domain *name*, that's too resource intensive and never done. However, those are (presumably) home user IP ranges on that ISP, and as such will all come from a set of fixed ranges. if you look up the IP's http://wq.apnic.net/apnic-bin/whois.pl you can see the range that they come from:

Code:
inetnum:        111.249.0.0 - 111.249.127.255
netname:        HINET-NET
descr:          Taipei Taiwan
country:        TW
admin-c:        HN184-TW
tech-c:         HN184-TW
mnt-by:         MAINT-TW-TWNIC
remarks:        This information has been partially mirrored by APNIC from
remarks:        TWNIC. To obtain more specific information, please use the
remarks:        TWNIC whois server at whois.twnic.net.
changed:        network-adm@hinet.net 20100428
status:         ASSIGNED NON-PORTABLE
source:         TWNIC
so an iptables rule for 111.249.0.0/17 would cover two of those 4 examples.
 
1 members found this post helpful.
Old 01-14-2014, 04:19 AM   #3
veto64
LQ Newbie
 
Registered: Jan 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
thanks man you saved my day.
there are to to many different ip to look it up, so
i just brutally blocked temporally the complete range

iptables -I INPUT -s 36.0.0.0/8 -j DROP
iptables -I INPUT -s 118.0.0.0/8 -j DROP
iptables -I INPUT -s 114.0.0.0/8 -j DROP
iptables -I INPUT -s 111.0.0.0/8 -j DROP
 
Old 01-14-2014, 12:32 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Performance, ease of use, multiple vs one iptables rule: iptables vs ipset.
 
2 members found this post helpful.
Old 01-16-2014, 01:15 PM   #5
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Out of curiosity, since we're talking about hinet.net, are you perchance running a mail server? If so, I would recommend subscribing and using one of the RBL service as this will reject the vast majority of their attempts.
 
Old 01-16-2014, 08:43 PM   #6
veto64
LQ Newbie
 
Registered: Jan 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
yes, running a postfix/courier mail server on a Debian Wheezy mininal.
all are smtp requests, still today and never so massively, always with a new ip addresses when one get dropped, if not, they go on stubbornly knocking on.

the postfix is blocking them, i'm getting this kind of log when a client tries to send via smtp but not deliver any authentication.

Jan 17 03:03:42 postfix/smtpd[20319]: NOQUEUE: reject: RCPT from 1-171-230-239.dynamic.hinet.net[1.171.230.239]: 450 4.7.1 Helo command rejected: Host not found; from=<cvimaabj@yahoo.com> to=<a83f@yahoo.com.tw> proto=SMTP helo

i have fail2ban installed but it not cover this,i think because the hin.net crowd not even try to authenticate themselves.

RBL service:
i put those to my smtpd_recipient_restrictions

reject_rbl_client dsn.rfc-ignorant.org,
reject_rbl_client dul.dnsbl.sorbs.net,
reject_rbl_client list.dsbl.org,
reject_rbl_client sbl-xbl.spamhaus.org,
reject_rbl_client bl.spamcop.net,
reject_rbl_client dnsbl.sorbs.net,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client ix.dnsbl.manitu.net,
reject_rbl_client combined.rbl.msrbl.net,
reject_rbl_client rabl.nuclearelephant.com

not sure if this is enough. or is there any more effective way to protect the server resources.
 
Old 01-19-2014, 09:35 PM   #7
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
You could try postgrey or policyd-weight and also set connection limits, the policy servers drop connections after basic connection info is established which reduces the resource demands of accepting and processing. The conection limits also slow them down a lot, I once had a host that tried to connect every second so I limited connections to 4 a minute and only 1 at a time.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPTables: block all dns requests except to the server(s) I specify Kage_ Linux - Networking 4 08-25-2019 02:18 PM
Suspicious requests in haproxy log. Need to block. Help? jc_oo12 Linux - Security 2 04-14-2011 08:10 AM
Block all outgoing requests from IP. (iptables+OpenVZ) sappi Linux - General 3 01-10-2010 02:50 PM
how to block a domain from apache2 requests? cizzi Linux - Server 4 04-16-2008 07:32 PM
How To Block PPPOE Requests ALInux Linux - Security 2 02-04-2007 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration