You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Security Question

Yesterday I connected my iMac (OSX 10.9.5) directly to my cable modem as part of a debugging exercise. It seems I had left the SSH port open (but all IDs have a strong password, guest and root are disabled) . I was interrupted, and upon my return it appeared from the system log the iMac had been subjected to an attack from 103.41.124.30 in Kowloon, Hong Kong.


From details below it looks like an amateur tried a brute force attack against the root ID but was unsuccessful. I suppose I should consider the possibility that another attack at the same time was successful.


My Question: What other logs or information should I be checking? Can anyone recommend a SW tool to check for a keylogger or other Trojan?


Details

After an absence of 3 hours, I found 9000 of these records in the system log (all identical)


2014-11-29 8:03:24.076 PM sshd[1141]: error: PAM: authentication error for root from 103.41.124.30 via 23.233.25.220

to

2014-11-29 9:04:46.648 PM sshd[12559]: error: PAM: authentication error for root from 103.41.124.30 via 23.233.25.220


They had appeared over the course of the last hour anywhere from 200ms to 2 seconds apart, and were still appearing as I disconnected the Mac from the net. I powered down the Mac, it is now back behind the firewall, and firewall has been configured to prevent inbound or outbound traffic from this box while I figure out what to do with it.


The 103.41.124.30 address is from Kowloon, Hong Kong, and the 23.233.25.220 address belongs to my ISP.


It looks to me that something or somebody (bot?) in Kowloon was trying to bruteforce root access, but wasn't successful - it seems a bit amateurish since any experienced hacker should have seen that this was a Mac by scanning a few ports, and most Macs have root disabled.


I also see TCP connections happening in the appfirewall log but these are continuous before, during and after the direct connection to modem, and don't seem to be synchronized with the UDP connection attempts


Nov 29 21:08:14 Mainlobe.local socketfilterfw[138] <Info>: hasplmd: Deny UDP CONNECT (in:2 out:0)

Nov 29 21:08:14 Mainlobe.local socketfilterfw[138] <Info>: sshd-keygen-wrapper: Allow TCP CONNECT (in:22 out:0)

Nov 29 21:08:44 Mainlobe.local socketfilterfw[138] <Info>: sshd-keygen-wrapper: Allow TCP CONNECT (in:21 out:0)

Nov 29 21:09:14 Mainlobe.local socketfilterfw[138] <Info>: hasplmd: Deny UDP CONNECT (in:2 out:0)

Nov 29 21:09:14 Mainlobe.local socketfilterfw[138] <Info>: sshd-keygen-wrapper: Allow TCP CONNECT (in:11 out:0)

Nov 29 21:09:14 Mainlobe.local socketfilterfw[138] <Info>: hasplmd: Deny UDP CONNECT (in:2 out:0)

Nov 29 21:09:14 Mainlobe.local socketfilterfw[138] <Info>: sshd-keygen-wrapper: Allow TCP CONNECT (in:11 out:0)

Nov 29 21:10:44 Mainlobe.local socketfilterfw[138] <Info>: hasplmd: Deny UDP CONNECT (in:2 out:0)

Nov 29 21:11:14 Mainlobe.local socketfilterfw[138] <Info>: hasplmd: Deny UDP CONNECT (in:2 out:0)

Nov 29 21:11:44 Mainlobe.local socketfilterfw[138] <Info>: hasplmd: Deny UDP CONNECT (in:2 out:0)

iMac, OS X Mavericks (10.9.5), 2.66GHz Core i5, 16GB RAM

Posted on Nov 30, 2014 5:35 PM

Reply
Question marked as Top-ranking reply

Posted on Nov 30, 2014 5:45 PM

In all likelihood, you have nothing to worry about so long as you've disconnected it from the direct connection and have a NAT router in place. The attack is/was undoubtedly an automated attack, probably propagated by the Chinese government/military.


You may want to report the attack to your ISP.

4 replies

Dec 4, 2014 7:49 PM in response to ericnepean

Thanks for the advice Tim & Eric. I made sure my router was using NAT, I blocked the entire subnet of both attacking addresses shown in the log, reported this to my ISP. I checked the logs carefully, and no connection was reported during this interval. I closed the SSH port since I don't need it open.

I rechecked the system and firewall logs a few times but I don't see any strange activity - I think I'm OK.

Security Question

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.