- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Password sniffed; hacked
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 07:00 AM
01-27-2004 07:00 AM
Sunday morning, some critical files in /etc were missing; any attempt to do anything produced only error messages on the console.
I reformatted the drives, reinstalled Redhat 7.1 and recovered the server from backups.
Now I'm looking for a way to block ftp and telnet from eth0 (the gateway) while allowing them from eth1 (my lan). I'm using IPchains. Can anyone construct and IP chains entry that would do that ??
Thanks for any help !!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 07:21 AM
01-27-2004 07:21 AM
Solutionin /etc/sysconfig/iptables
-A input -i eth0 -p tcp -m tcp --dport 21 -j DROP
This prevents ftp access
You can block services from certain ip addresses or network segments as well
-A INPUT -i eth0 -p ALL -s 192.168.0.15 -j DROP
ipchains:
in the /etc/sysconfig/ipchains file
-A input -s 0/0 23 -d 0/0-p tcp -y -j DROP
-A input -s 0/0 23 -d 0/0-p tcp -y -j DROP
That will do it.
The reason you probably got hacked was password policy.
One guessable password makes your system vulnerable. If that user has a suid capable shell or something out there then your system is someone elses slave. A word starting with a b comes to mind. Bad SEP.
I encountered a number of these attacks on my HP-9000 server. I used /var/adm/inetd.sec to stop all outside ftp and telnet access
This attack was crude, simply trying to guess the password for root. There were hundreds of attempts.
I reported the information to the relavent authorities and they promised to investigate.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 09:10 AM
01-27-2004 09:10 AM
Re: Password sniffed; hacked
I don't know if IPTables is on that server; guess I could put it on there. I'll try the Ipchains method first. It gets installed with RedHat 7.1.
-A input -s 0/0 -d 0/0 21 -p tcp -y -j ACCEPT
-A input -s 0/0 -d 0/0 23 -p tcp -y -j ACCEPT
That is the ipchains entry for telnet and ftp that gets installed with RH 7.1. If I just change the ACCEPT to DROP, how do I get connected from my LAN ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 01:14 PM
01-27-2004 01:14 PM
Re: Password sniffed; hacked
for xinetd only bind these services to the lan interface.
for inetd only allow the services to be available in /etc/hosts.allow to your local LAN This assumes that "ALL: ALL@ALL" is in /etc/hosts.deny to deny everything that falls through /etc/hosts.allow
The above will work as an extra for xinetd if you compiled xinetd from source with tcpwrappers support enabled.
I have an compiled RPM for a recent version xinetd with tcpwrappers built but was built on a 6.2 system.
Regards Ger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 01:32 PM
01-27-2004 01:32 PM
Re: Password sniffed; hacked
Prior to RH8 however, IPChains is the default.
You can easy swap these by issuing the following commands:
chkconfig --level 0123456 ipchains off
service ipchains stop
chkconfig iptables on
service iptables start
You will have to translate your firewall rules however.
I'd suggest moving to IPTables as it is by far the better option to use, in both management, and forward-planning.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 03:33 PM
01-27-2004 03:33 PM
Re: Password sniffed; hacked
You've convinced me; I'll switch over to IPTables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2004 10:27 PM
01-27-2004 10:27 PM
Re: Password sniffed; hacked
However, I happened across a firewall tool that I found so useful it's the only one I use: shorewall.
It's got very clear documentation on setting up a firewall and comes with loads of examples (including what you're after)...
http://www.shorewall.net/
On top of that, there is webmin (a web based admin interface) and it supports shorewall...
http://www.webmin.com/
(Sorry for going a little off topic).
Bottom line is, I knew little about firewalls, but now happily have my linux router up and running using shorewall and suffering almost no external attacks...
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-28-2004 02:58 AM
01-28-2004 02:58 AM
Re: Password sniffed; hacked
Also look at protecting ftp with tcpwrappers, and replacing telnet with ssh.