LinuxQuestions.org
Help answer threads with 0 replies.
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 06-01-2015, 11:37 AM   #1
HardenedCriminal
Member
 
Registered: May 2015
Posts: 104

Rep: Reputation: Disabled
Hardening PROFTP


The Proftp server is set only to allow certain login user and from only certain IP addresses.

<Limit LOGIN>
Order Allow,Deny
Allow 104.235.22.123, 123.123.123.123, etc,
DenyAll
</Limit>

Question 1:
Is there a way to use xxx.noip.com, yyy.noip.com addressing vs. IP's?

Question 2:
If a NO on question 1 then how to I break the very long line of IP addresses into multiple lines.

I tried the usual backslash \ and no luck.

(What I am attempting is to create host look up and put only those IP addresses into the "Allow" line for all my clients. As is now that is going to be a nightmare.)

Thanks to all in advances.
 
Old 06-01-2015, 06:12 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
I have not played with ProFTP but looks like you have to setup a class. It appears that you can use names with each one being on a separate line.

http://www.proftpd.org/docs/howto/Limit.html
www.proftpd.org/docs/howto/Classes.html

Last edited by michaelk; 06-01-2015 at 09:47 PM.
 
1 members found this post helpful.
Old 06-01-2015, 08:53 PM   #3
HardenedCriminal
Member
 
Registered: May 2015
Posts: 104

Original Poster
Rep: Reputation: Disabled
Each IP address on one line is a good fix.

Allow 123.123.123.123
Allow 11.11.1.11
etc.

I can easily make a program to replace those who are on dynamic ISP connections when IP's change.


Thanks.
 
Old 06-02-2015, 06:12 AM   #4
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 268

Rep: Reputation: 25
You could also program the iptables firewall to allow incoming connections to the port that proftpd is listening on only from specific IP addresses. I'm not sure, if you can get it to work on a dynamic dns service, but if you're paranoid you could try setting up a technique called port knocking.
 
1 members found this post helpful.
Old 06-02-2015, 07:28 AM   #5
HardenedCriminal
Member
 
Registered: May 2015
Posts: 104

Original Poster
Rep: Reputation: Disabled
thanks. The "denyall" works nicely for all the others now that I can limit this down to a specific IP vs. ISP IP range for those dynamic users.
 
Old 06-04-2015, 03:45 PM   #6
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
I would also suggest to double up on this security with the /etc/hosts.deny /etc/hosts.deny capabilities. This way if an update allows one function to be exploited, it will have a second layer of security.

using /etc/hosts.allow and /etc/hosts.deny to secure unix
https://jamalahmed.wordpress.com/201...o-secure-unix/
 
1 members found this post helpful.
Old 06-04-2015, 07:36 PM   #7
HardenedCriminal
Member
 
Registered: May 2015
Posts: 104

Original Poster
Rep: Reputation: Disabled
Agreed; plus 3 other programs in use already... gotta keep those RIPE network hackers out.
 
Old 06-06-2015, 05:20 AM   #8
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by joec@home View Post
I would also suggest to double up on this security with the /etc/hosts.deny /etc/hosts.deny capabilities. This way if an update allows one function to be exploited, it will have a second layer of security.
Proper hardening should always consist of multiple layers but please don't present tcp_wrappers as a cure-all (note).
 
2 members found this post helpful.
Old 06-06-2015, 12:32 PM   #9
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
Quote:
Originally Posted by unSpawn View Post
Proper hardening should always consist of multiple layers but please don't present tcp_wrappers as a cure-all (note).
Your correct, it is a bad habit by itself. I need to remember to state specifically that I have a preference to work with dynamic firewalls and tend to use hosts.deny for specific ports. Interesting though, did not know the part about the software requirements of libwrap.
 
1 members found this post helpful.
Old 06-06-2015, 03:08 PM   #10
HardenedCriminal
Member
 
Registered: May 2015
Posts: 104

Original Poster
Rep: Reputation: Disabled
I never knew this till I read your note.

Our new servers are going to use both ways. But if you could be so kind or someone else, what would be the IPTABLES rule to stop all but 2 single IP addresses on EHT0 from getting in.


What I tried stops both WAN ETH0 & LAN ETH1 side which is nice once in a while but not always.

Say port 21 for the example & 123.123.123.124/30

Thanks to you experts.
 
Old 06-06-2015, 03:18 PM   #11
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
25 Most Frequently Used Linux IPTables Rules Examples
http://www.thegeekstuff.com/2011/06/...ules-examples/

Take a look at example #5
 
Old 06-06-2015, 03:40 PM   #12
HardenedCriminal
Member
 
Registered: May 2015
Posts: 104

Original Poster
Rep: Reputation: Disabled
I did this and I could still get in from the outside world on a different IP address on at least our servers.

Last edited by HardenedCriminal; 06-06-2015 at 04:05 PM. Reason: Mistake
 
Old 06-06-2015, 06:19 PM   #13
joec@home
Member
 
Registered: Sep 2009
Location: Galveston Tx
Posts: 291

Rep: Reputation: 70
You are getting a lot of different iptables information from a lot of different people, so I am guessing you might have a chained tables setup. Some people run a flat table which is easier to understand but very limited. For more advanced tables they run a chained tables to which I am not the most suited person to answer your question. I would though suggest to read up specifically on chained tables.

Linux Firewall Tutorial: IPTables Tables, Chains, Rules Fundamentals
http://www.thegeekstuff.com/2011/01/...-fundamentals/
 
1 members found this post helpful.
  


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
Linux hardening and mysql hardening sagar666 Linux - Server 3 06-18-2014 11:47 PM
Hardening FC-6 tied2 Linux - Security 7 06-26-2007 09:07 PM
RHEL 3 OS Hardening brucelye Linux - Security 2 01-09-2007 02:06 AM
I need some ideas for hardening Bill Johns Linux - Security 2 05-01-2005 03:11 PM
Hardening RH 9 velan Red Hat 4 06-16-2004 07:40 AM

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

All times are GMT -5. The time now is 03:54 PM.

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