Page 1 of 2 12 LastLast
Results 1 to 15 of 24

Thread: CentOS IPTables

  1. #1
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default CentOS IPTables

    Hi all,
    Don't suppose anyone knows how to set up IPTables on CentOS? I know it's installed, just not a clue which rules I should and shouldn't be using! It's a dedicated server, off site and I don't have physical access to it

    Thanks in advance
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  2. #2
    Not to be trusted with your Jaffa Smifis's Avatar
    Join Date
    May 2010
    Location
    Great Yarmouth, Norfolk
    Posts
    5,498
    Thanks
    1,004
    Thanked 455 Times in 398 Posts
    Rep Power
    2

    Default

    What are you running on it?


  3. #3
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default

    On the server? It's a web server Also planning on having a TS3 server on it.
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  4. #4
    Not to be trusted with your Jaffa Smifis's Avatar
    Join Date
    May 2010
    Location
    Great Yarmouth, Norfolk
    Posts
    5,498
    Thanks
    1,004
    Thanked 455 Times in 398 Posts
    Rep Power
    2

    Default

    So just apache?

    What port for TS3.

    Do you need FTP SSH etc?


  5. The Following User Says Thank You to Smifis For This Useful Post:


  6. #5
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default

    Ah, sorry! Yes, Apache, TS3, FTP, SSH and POP/IMAP mail. (Now that I've decided I may as well have everything)

    TS3 on port 11175

    Thanks!
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  7. #6
    Moderator Spaceboy's Avatar
    Join Date
    Aug 2010
    Location
    Leicester
    Posts
    14,810
    Thanks
    3,251
    Thanked 3,124 Times in 2,318 Posts
    Rep Power
    8

    Default

    total overkill, but open this in wordpad...
    http://www.spaceboy.co.uk/general/firewall2.sh

    that was for a rig with 4 network interfaces, public, dmz, development, internal, with specific rules between each interface.

    Hopefully you can follow it, strip out what you don't need, and change the ports for the ones you need
    Quote Originally Posted by nft99 View Post
    They dont let me in the shop
    If you open your mind too much, your brain will fall out
    ---------------------------------------------------------------
    Fractal R3, Core i5 3570k, z77x-d3h, 8gb exceleram, GTX460

  8. The Following User Says Thank You to Spaceboy For This Useful Post:


  9. #7
    /dev/null Plan9's Avatar
    Join Date
    Aug 2011
    Location
    /root/
    Posts
    2,291
    Thanks
    315
    Thanked 253 Times in 197 Posts
    Rep Power
    1

    Default

    You can also set iptables to do adaptive firewalling against port scans, fake TCP/IP packets (eg where the TCP packet has been rewritten with localhost as the originating IP to circumvent the firewall) and all sorts. I'm quite a n00b at configuring it though, but there's plenty of guides online (all I ever do is google it myself)

    I'd also recommend installing fail2ban to prevent brute force attacks against your password controlled daemons.

  10. The Following User Says Thank You to Plan9 For This Useful Post:


  11. #8
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default

    Cheers guys Before my server died I got a friend to do it, he's currently in Croatia on his honeymoon!

    I think I've set IPTables up now, I'll post the rules I've got tomorrow
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  12. #9
    Military Grade Tester DoubleTop's Avatar
    Join Date
    Nov 2009
    Location
    In a lamp
    Posts
    11,610
    Thanks
    123
    Thanked 1,906 Times in 1,180 Posts
    Rep Power
    9

    Default

    Quote Originally Posted by ChrisGlobe View Post
    Cheers guys Before my server died I got a friend to do it, he's currently in Croatia on his honeymoon!

    I think I've set IPTables up now, I'll post the rules I've got tomorrow
    make sure if you post the rules, you remove references to where the server is, just in case

    Oh too late - you've posted your wordpress install!!! I'll be good, I promise
    Please see thread, here for how post reports are dealt with.
    Forum Guidelines here

  13. #10
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default

    Oh, good point Maybe I won't post the rules then!

    Thanks for the help all
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  14. #11
    /dev/null Plan9's Avatar
    Join Date
    Aug 2011
    Location
    /root/
    Posts
    2,291
    Thanks
    315
    Thanked 253 Times in 197 Posts
    Rep Power
    1

    Default

    Quote Originally Posted by ChrisGlobe View Post
    Oh, good point Maybe I won't post the rules then!

    Thanks for the help all
    You can post the rules, just hide any references to your own IP.

    Though, to be frank, it would only take 5 minute Google for anyone to find your IP (217.xxx.xxx.xxx) given your choice of domain name and personal content you've put on both Aria and your site.

    Which also just goes to re-enforce a point I always make: security through obscurity is no security at all. ie lock your box down because if people really care, they can and will find your IP easily enough.

    [edit]

    I've just noticed you've posted your domain name on here anyway. So that's as good as publishing your IP
    Last edited by Plan9; 11-06-12 at 10:14.

  15. #12
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default

    You say that as if I should be hiding everything
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  16. #13
    Military Grade Tester DoubleTop's Avatar
    Join Date
    Nov 2009
    Location
    In a lamp
    Posts
    11,610
    Thanks
    123
    Thanked 1,906 Times in 1,180 Posts
    Rep Power
    9

    Default

    lock the doors, blackout blinds and turn off all communication devices and we'll still be watching you
    Please see thread, here for how post reports are dealt with.
    Forum Guidelines here

  17. #14
    Best viewed in moderation
    Join Date
    Mar 2012
    Posts
    5,864
    Thanks
    1,455
    Thanked 1,057 Times in 759 Posts
    Rep Power
    5

    Default

    You don't work for Google, do you?
    Quote Originally Posted by Mr. Strawberry View Post
    Yes thats right I LOST my i7. It is MIA!
    Corsair 600T | Asus Sabertooth Z77 ATX | Intel i5-3570k @ 4200MHz | Corsair H100i | Corsair Vengeance LP Black 16GB @ 1600MHz 9-9-9-24 | EVGA GTX670 2GB @ 980MHz | Mushkin Chronos 240GB

  18. #15
    /dev/null Plan9's Avatar
    Join Date
    Aug 2011
    Location
    /root/
    Posts
    2,291
    Thanks
    315
    Thanked 253 Times in 197 Posts
    Rep Power
    1

    Default

    Quote Originally Posted by ChrisGlobe View Post
    You say that as if I should be hiding everything
    Sorry, what I meant is that you should put server security above secrecy as your data can always be found.

    eg, I can tell you're running SSH on a non-standard port and I know exactly what that port it. So by changing it, you've not slowed me down in the slightest (well, you did, but literally only by 5 minutes as that's the time it took nmap to run). So make sure you have some decent security against SSH (eg disable password log ins and only use SSH keys, or install fail2ban and auto ban brute force attacks).

    Incidentally, that 5 minute nmap scan also highlighted a number of other services such as FTP (disable that and make people use SFTP - just be sure you chroot user accounts). I can also tell what server management portal you're running, the webserver (though you have turned off server signatures in your Apache config - which was a smart move) and even what mail daemon you're running.

    And if I can dig all that out in 5 minutes running a standard pre-set on a common tool, then just imagine what a determined hacker might achieve.

    I know this might sound like tin-hat paranoid speak, but VPS's like yours are a popular target for cyber criminals wanting to set up a spam server. So a couple of hours of pain now could potentially save you days of headache further down the line. Setting up iptables is a great move, but just make sure you have something like fail2ban installed as well as it can monitor the logs for all your daemons and automatically blacklist repeated failed logins (ie the hallmarks of a brute force attack). It can also monitor for some other known hacks such as PHP's injection attacks.

    Sorry if you've already done all of the above and if I'm coming across preachy. This is just a subject of personal interest.

  19. The Following User Says Thank You to Plan9 For This Useful Post:


Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •