Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Security and Privacy
FedoraForum Search

Forgot Password? Join Us!

Security and Privacy Sadly, malware, spyware, hackers and privacy threats abound in today's world. Let's be paranoid and secure our penguins, and slam the doors on privacy exploits.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th January 2008, 02:07 AM
quacked Offline
Registered User
 
Join Date: Aug 2007
Location: Reno NV.
Posts: 92
Possible breakin attempt

In my secure logs,,, I found this

an 17 04:44:52 localhost sshd[15669]: reverse mapping checking getaddrinfo for 2.199.56.59.broad.qz.fj.dynamic.163data.com.cn [59.56.199.2] failed - POSSIBLE BREAK-IN ATTEMPT!
Jan 17 04:44:52 localhost unix_chkpwd[15672]: password check failed for user (root)
Jan 17 04:44:52 localhost sshd[15669]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=59.56.199.2 user=root
Jan 17 04:44:52 localhost sshd[15669]: pam_winbind(sshd:auth): getting password (0x00000010)
Jan 17 04:44:52 localhost sshd[15669]: pam_winbind(sshd:auth): pam_get_item returned a password
Jan 17 04:44:52 localhost sshd[15669]: pam_winbind(sshd:auth): request failed: No such user, PAM error was User not known to the underlying authentication module (10), NT error was NT_STATUS_NO_SUCH_USER
Jan 17 04:44:54 localhost sshd[15669]: Failed password for root from 59.56.199.2 port 44688 ssh2
Jan 17 12:44:54 localhost sshd[15670]: Connection closed by 59.56.199.2


First off I would like to know exactly what Password they were able to retrieve,,,

I have SElinux set to permissive to be able to allow my Lamp server to function
Denyhosts is installed and functioning to block _ All


Any help would be greatly appreciated,,,
Reply With Quote
  #2  
Old 18th January 2008, 02:19 AM
Evil_Bert's Avatar
Evil_Bert Offline
Retired Again - Administrator
 
Join Date: Nov 2007
Location: Reality
Posts: 3,034
I'd say you're right - looks like someone tried to login via SSH, but failed. Is your SSH setup for external (internet) access deliberately?

Wouldn't worry about the "get password" bit, that's just internal.
__________________
.
Marching to the beat of his own conundrum.
Reply With Quote
  #3  
Old 18th January 2008, 03:00 AM
quacked Offline
Registered User
 
Join Date: Aug 2007
Location: Reno NV.
Posts: 92
I have webmin installed and liked being able to get a shell from a remote machine ,, came in handy ,,, Just trying to decipher the logs.. and make sure no one was able to gain root access to the machine,,,

In trying to learn more, setup and administration of Linux in general,,,with the Server ,,, services it may require a little more vigilance on my part to keep up with it all,,, Hard to do ,, and learn at the same time,.

Thanks for the reply !!! After your telling me the get Password was internal that cleared up My Main question ,,, And brought a piece of enlightment !!

Localhost,,, Of Course !! ,Again Thanks,,,

Last edited by quacked; 18th January 2008 at 03:07 AM. Reason: clarification
Reply With Quote
  #4  
Old 18th January 2008, 08:42 AM
Thetargos's Avatar
Thetargos Online
Registered User
 
Join Date: May 2004
Location: Mexico City, Mexico
Age: 35
Posts: 4,418
It happened to me too, but no actual login when I carelessly left my machine as the DMZ box in the router for some months (I was originally testing some firewall policies, and then I left it on DMZ... bad for the heart, bad for the heart indeed! I had a daily over 200 ssh session attempts ! good thing I have strong passwords set on all my local users... except one "guest" account without a pssword, for obvious reasons, but ironically no one even guessed it [its actual name is different, though]).
__________________
If ain't broken, don't fix it! :eek:
If can be improved, go for it! :cool:

FedoraForum Community forums lurker.
Fedora user since RHL 5.2 :cool:

Systems: Laptop, Main System, Netbook.
Reply With Quote
  #5  
Old 18th January 2008, 09:02 AM
leigh123linux's Avatar
leigh123linux Offline
Retired Administrator
 
Join Date: Oct 2006
Posts: 21,509
Make it harder for them


Code:
su -
yum install denyhosts
chkconfig --level 345 denyhosts on
service denyhosts restart

Code:
[root@localhost ~]# yum info denyhosts
Installed Packages
Name   : denyhosts
Arch   : noarch
Version: 2.6
Release: 7.fc8
Size   : 261 k
Repo   : installed
Summary: A script to help thwart ssh server attacks
Description:
DenyHosts is a Python script that analyzes the sshd server log
messages to determine which hosts are attempting to hack into your
system. It also determines what user accounts are being targeted. It
keeps track of the frequency of attempts from each host and, upon
discovering a repeated attack host, updates the /etc/hosts.deny file
to prevent future break-in attempts from that host.  Email reports can
be sent to a system admin.
__________________
My Hardware
- CPU: AMD Phenom II X6 Hex Core 1055T 95W Edition @3.5Ghz
- Motherboard: Gigabyte GA-880GM-UD2H
- Cooler: Corsair H50 CPU Cooler
- RAM: Corsair Dominator 8GB (4x2GB) DDR3 1600MHz
- Graphics: Gigabyte GeForce GTS 450 OC 1024MB GDDR5
Reply With Quote
  #6  
Old 18th January 2008, 09:13 AM
Thetargos's Avatar
Thetargos Online
Registered User
 
Join Date: May 2004
Location: Mexico City, Mexico
Age: 35
Posts: 4,418
Which reminds me, I have to re-configure my 'newly' installed CentOS server to send root's mail to one of my 'actual' emails, to keep track on the server... Now how did I do it the last time? /me checks his notes.
__________________
If ain't broken, don't fix it! :eek:
If can be improved, go for it! :cool:

FedoraForum Community forums lurker.
Fedora user since RHL 5.2 :cool:

Systems: Laptop, Main System, Netbook.
Reply With Quote
  #7  
Old 18th January 2008, 02:03 PM
ibbo's Avatar
ibbo Offline
Registered User
 
Join Date: Jun 2005
Location: Leeds
Posts: 1,264
Nothing wrong with those logs.

If you do not wish to remotely access your machine simply disable ssh.

I use TCPWrappers to ensure only myself from certain locations can access my machine.
hosts.deny
ALL:ALL
hosts.allow
sshd: <work ip>, 192.168.
Then your log will ony contain lines like "refused connect from "::ffff:61.219.147.75 (::ffff:61.219.147.75)"
Of course if you wish to access your machine from several locations you will have to list them all.

Denyhosts is good but if I recall correctly it allows several attempts and then after these attempts have failed it blocks the offending IP.

Ibbo
__________________
A Hangover Lasts A Day, But Our Drunken Memories Last A Lifetime
--
Linux user #349545
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCfdjyzXscddzQvlhBedAcD7qfKmHo==zx0H
Reply With Quote
  #8  
Old 18th January 2008, 02:42 PM
Evil_Bert's Avatar
Evil_Bert Offline
Retired Again - Administrator
 
Join Date: Nov 2007
Location: Reality
Posts: 3,034
There's also fail2ban. Haven't used it myself but it was reviewed in the Nov '07 issue of Linux Magazine. It's similar to denyhosts, but instead of using tcpwrappers (and the hosts.deny file) it dynamically updates firewall rules, so will work for a wider range of applications (even apps that don't invoke tcpwrappers).

Fail2ban Home
__________________
.
Marching to the beat of his own conundrum.
Reply With Quote
  #9  
Old 18th January 2008, 02:46 PM
Kasper-pA- Offline
Registered User
 
Join Date: Sep 2007
Location: Houston, TX
Posts: 107
I use this little script we made here at our office

This program uses IPTables to drop IP's using invalid usernames that try to SSH into scout more than 5 times:

To run this, you need to do the following:
# Edit /etc/syslogd.conf to read
# SSH Messages to special log (FIFO) filter to /var/log/messages
local3.* |/var/log/sshcheck

# Edit /etc/ssh/sshd_config
SyslogFacility LOCAL3

Run this program in the background (it won't end until you send the magic word).

#!/usr/bin/perl

$FIFO = '/var/log/sshcheck';

$check_for="Failed password for illegal user";
$maxfail=5;
@IP_LIST="";

while (1) {
unless (-p $FIFO) {
unlink $FIFO;
system('mknod', $FIFO, 'p')
&& die "can't mknod $FIFO: $!";
}

# next line blocks until there's a reader
open (FIFO, "< $FIFO") || die "can't read $FIFO: $!";
open (FOUT, ">> /var/log/messages") || die "unable to open /var/log/messages: $!";
while(<FIFO>) {
if(m/$check_for/) {
m/$check_for.(\w+) from ([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/;
if($IP_LIST{$2}) {
if($IP_LIST{$2}>=$maxfail) {
print FOUT "*** Dropping $2 using command \"/sbin/iptables -I INPUT -s $2 -j DROP\" ***\n";
`/sbin/iptables -I INPUT -s $2 -j DROP`;
} else {
$IP_LIST{$2}++;
}
} else {
$IP_LIST{$2}=1;
}
}
if(m/STOP FIFO/) {
exit;
}
print FOUT $_;
}
close FOUT;
sleep 2;
}
Reply With Quote
  #10  
Old 18th January 2008, 03:16 PM
shamblett Offline
Registered User
 
Join Date: Jan 2008
Location: Manchester UK
Posts: 4
Roots mail

Quote:
Originally Posted by Thetargos
Which reminds me, I have to re-configure my 'newly' installed CentOS server to send root's mail to one of my 'actual' emails, to keep track on the server... Now how did I do it the last time? /me checks his notes.
Edit the /etc/aliases file, at the bottom is a line saying who gets roots mail, uncomment this and update it with your user name, save, then run 'newaliases' to recreate the alias database.
__________________
SJH :)
Reply With Quote
  #11  
Old 26th January 2008, 10:20 PM
johnnymack's Avatar
johnnymack Offline
Registered User
 
Join Date: Oct 2007
Location: Dubai UAE
Posts: 95
Hey quacked,

This attempt on your box was someone from the Far East, trying to login as root; happens all the time; is a known security weakness.

You should DISABLE ANY SSH INTO ROOT. Unfortunately, most Linux distros have lax security and release default settings to ssh server allowing users to ssh into root account. This is VERY UNSECURE practice. What you should want is to allow valid users to login as themselves, then su or sudo to execute protected commands. That way, you have logs to tell you WHO is using the root account.
Otherwise, you have root logins and you don't know really who 'that' root was. Besides, if you lockdown ssh into root, someone is trying to takeover your system needs to overcome 2 hurdles: first the local account password, THEN the necessary root exploit.

To cover this hole up, change the sshd settings to disallow root from any login. Edit the file: /etc/ssh/sshd_config and change the line:

PermitRootLogin yes

...to become:

PermitRootLogin no

Save the file and restart the sshd server with the command:

service sshd restart

And make sure that all your other user accounts have GOOD PASSWORDS, else the ever-present
hackers scanning for an easy entry to a system via ssh will nevertheless get in.

If you want even better security for ssh and other remote services into your box, look at implementing "SPA" or some variant of "portknocking". Those will hide your service from external systems unless and until they perform the magic beforehand.

http://www.linuxjournal.com/article/9565
http://www.cipherdyne.org/fwknop/
http://rahulhackingarticles.wetpaint...nocking?t=anon

HTH,

jm
__________________
Linux Counter # 52009
Reply With Quote
  #12  
Old 27th January 2008, 09:51 AM
VisezTrance Offline
Registered User
 
Join Date: Jan 2006
Posts: 39
I get that "POSSIBLE BREAK-IN ATTEMPT!" each time I want to login too. Obviously, I'm not tring to hack my own VPS. So what's happening. Well, for each account(IP in my case), the ISP creates some sort of sudomain; so I guess the server tries to look it up but fails.

Someone mentioned fail2ban a bit earlier. It's what I'm using right now. Works quite nice and it's very easy to configure.

You should probably use ssh keys though.
Reply With Quote
  #13  
Old 6th February 2008, 12:50 AM
quacked Offline
Registered User
 
Join Date: Aug 2007
Location: Reno NV.
Posts: 92
Thanks to "All " !!! It's given me quite a bit to digest,

All in all I'm seeing other attempts to find vulnerabilities in My OS , and have a lot of reading,configuring ,and work ahead,,'

61.218.31.50 - - [04/Feb/2008:19:38:47 -0800] "GET /PMA/main.php HTTP/1.0" 404 288 "-" "-"
61.218.31.50 - - [04/Feb/2008:19:38:47 -0800] "GET /dbadmin/main.php HTTP/1.0" 404 292 "-" "-"
61.218.31.50 - - [04/Feb/2008:19:38:48 -0800] "GET /PMA2006/main.php HTTP/1.0" 404 292 "-" "-"
61.218.31.50 - - [04/Feb/2008:19:38:48 -0800] "GET /pma2006/main.php HTTP/1.0" 404 292 "-" "-"
61.218.31.50 - - [04/Feb/2008:19:38:49 -0800] "GET /sqlmanager/main.php HTTP/1.0" 404 295 "-" "-"
61.218.31.

among other things !!!


and am just a little concerned that some where along the way I won't be able to keep up with it all,,, Staying ahead of it all is quite the task,,,
Reply With Quote
  #14  
Old 6th February 2008, 02:22 AM
joe.pelayo's Avatar
joe.pelayo Offline
An ape descendant
 
Join Date: Dec 2006
Location: Mexico City
Age: 29
Posts: 3,101
Quote:
Originally Posted by Thetargos
It happened to me too, but no actual login when I carelessly left my machine as the DMZ box in the router for some months (I was originally testing some firewall policies, and then I left it on DMZ... bad for the heart, bad for the heart indeed! I had a daily over 200 ssh session attempts ! good thing I have strong passwords set on all my local users... except one "guest" account without a pssword, for obvious reasons, but ironically no one even guessed it [its actual name is different, though]).
Soy hackers now use Linux!
__________________
Notebook: Acer Aspire 5536-5112.
AMD Athlon X2 QL64 @ 2.1GHz, 4GB DDR2 PC2-5300, ATI Radeon HD3200 (256MB), 250GB Toshiba HDD, HL-DT-ST DVDRAM GT20N
Fedora 16 x86_64

Netbook: Acer Aspire One A150
Intel Atom N270 @ 1.6GHz, 1.5 GB DDR2 PC2-4200, Intel Graphics (8MB?), 160GB Seagate HDD
Fedora 15 i686
Reply With Quote
  #15  
Old 6th February 2008, 11:14 AM
EtherealMonkey Offline
Registered User
 
Join Date: Oct 2007
Posts: 8
Quote:
Originally Posted by quacked
Thanks to "All " !!! It's given me quite a bit to digest,

All in all I'm seeing other attempts to find vulnerabilities in My OS , and have a lot of reading,configuring ,and work ahead,,'
Yes, you will see these things from time to time.

When you catch them in the act (remember that it is normally a script), pop open a port scanner and load up the offending IP.

Although this is not good "netiquette", I have found that it usually buys a few days of peace.

Once, I set up my XP machine to proxy SSH requests to the FC server when connecting from a known good IP. Then set the XP machine to show a false banner (TOS for a GOV) when trying to connect with SSH from any other address. Now, I just run SSH on a non-standard port.

Certain things will slow them down or cause them to quit for a while.

Accept that it will not go away and be thankful that "forewarned is forearmed."

Oh yeah, I also use DenyHosts. So far, so good

Last edited by EtherealMonkey; 6th February 2008 at 11:16 AM.
Reply With Quote
Reply

Tags
attempt, breakin

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
F10, first attempt: no X LDC Installation and Live Media 11 7th January 2009 12:40 PM
apache log question (possible breakin?) crainey69 Security and Privacy 1 15th July 2008 08:31 AM
Newbie's one last attempt........ bisctboy Servers & Networking 9 9th April 2006 04:39 PM
Break in attempt? shadus Security and Privacy 3 24th March 2006 11:26 AM
My Last Attempt for Installation carlwill Hardware & Laptops 2 20th August 2004 01:44 AM


Current GMT-time: 09:54 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat