LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-11-2004, 08:55 PM   #1
laminar1
LQ Newbie
 
Registered: Sep 2004
Location: Wisconsin, USA
Distribution: Libranet 2.8.1 (Debian)
Posts: 17

Rep: Reputation: 0
Have I Been Rooted via SSH?


I have Libranet 2.8.1, kind of a mix of Sarge and testing Debian. This linux machine is on a cable modem behind a hardware firewall with all ports to drop incoming except (occasionally) 22. When enabled, Port 22 is forwarded to LN, where sshd and Firestarter are running. Firestarter allows only ssh to be publicly available. I use ssh to log in from work and check e-mail via a remote X session. [My workplace has all e-mail protocols disallowed for non-internal pop and smtp servers, and they also block access to all web-based email sites like mail2web.com. Thus I really need ssh.]

Three days ago Firestarter picked up the following hits,
Code:
Time: Sep  8 11:25:31 Source: server-1.eqch.doubleclick.net Destination: 192.168.xxx.xxx In IF: eth0 Out IF:  Port: 33270 Length: 44 ToS: 0x00 Protocol: tcp Service: trinity v3
A few prior to that I had port 22 forwarded to my LN box, but Firestarter was NOT running. My bad. In that case, the default Libranet Adminmenu Firewall would be the default. Unfortunately, it was set to allow public access to the following services: dhcp, ssh, smtp, www, samba, and https, all on their standard ports. Yikes. So bottom line, my security was briefly let down. Please note that telnet and remote ssh root login have long been disabled on my linux box.

I ran chkrootkit, which came out clean. I checked the system logs, especially auth.log, and found only a couple ssh login attempts that were correctly refused. No big deal.

Yesterday, I ran ethereal in NON-promiscuous mode for about half an hour to see what was coming in. When I stopped the capture, a warning box came up. It said "Loading etherXXXXD82Ymm, 588 KB of 2334 KB. Do you wish to continue?" Obviously not. (That file name is exact, BTW.)

Here's what I've done so far: turned off all port forwarding from my Linksys router. Disconnected the suspect machine from the internet. Searched my machine for the component files of trinity v3. These are: uucico (altered version of standard linux file) fsflush and idle.so. Nothing has turned up. There's an excellent link to the whitepaper on trinity v3: I can't post it unfortunatley due to the "5-posts rule." Unless you append 3w's ahead of .findarticles.com/p/articles/mi_m0NEW/is_2000_Sept_5/ai_65024645

So, did someone root my LN box? How can I check, and are there any tools to remove trinity v3? How did they route the packet to an unrouteable 192.168.x.x.address through a router with only port 22 open and sshd listening on that port?

Does the above info mean my machine is now zombified to DDOS doubleclick on some future date? Or is doubleclick infected and trying to access my linux macine looking for trinity v3 clients?

Sorry for the long post and many questions. Any help appreciated.
 
Old 09-11-2004, 11:51 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
is there any way you could post the regular kernel log entry from /var/log/syslog??

that firestarter entry you posted isn't very clear...

also, run rootkit hunter:

http://www.rootkit.nl


Last edited by win32sux; 09-12-2004 at 12:54 AM.
 
Old 09-12-2004, 12:46 AM   #3
laminar1
LQ Newbie
 
Registered: Sep 2004
Location: Wisconsin, USA
Distribution: Libranet 2.8.1 (Debian)
Posts: 17

Original Poster
Rep: Reputation: 0
win32sux, thanks for your reply. At the risk of offending someone due to length, I will post the relevant syslog entries. The first six (total) were the incoming ones picked up by Firestarter, on Sep. 8, 1125 am. Then on Sep. 9 there are many OUTBOUND packets going to the same address, a server at doubleclick. It looks to me like part of a SYN flood, but please tell me what you think. Seems like my machine has been rooted and recruited to be part of a DDoS.

Code:
Sep  8 11:25:31 Libranet kernel: IN=eth0 OUT= MAC=00:07:e9:ba:c8:16:00:0c:41:ac:75:78:08:00 SRC=65.59.207.51 DST=192.168.1.101 LEN=44 TOS=0x00 PREC=0x80 TTL=57 ID=0 DF PROTO=TCP SPT=80 DPT=33270 WINDOW=5840 RES=0x00 ACK SYN URGP=0 
Sep  8 11:25:42 Libranet last message repeated 4 times
Sep  8 11:26:02 Libranet kernel: IN=eth0 OUT= MAC=00:07:e9:ba:c8:16:00:0c:41:ac:75:78:08:00 
SRC=65.59.207.51 DST=192.168.1.101 LEN=40 TOS=0x00 PREC=0x80 TTL=57 ID=0 DF PROTO=TCP 
SPT=80 DPT=33270 WINDOW=6853 RES=0x00 ACK URGP=0 

Sep  9 00:12:05 Libranet kernel: device eth0 entered promiscuous mode
Sep  9 00:19:50 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=10767 PROTO=TCP SPT=44364 DPT=1524 WINDOW=4096 RES=0x00 SYN URGP=0

Sep  9 00:19:50 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=46158 PROTO=TCP SPT=44364 DPT=12345 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:50 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=45551 PROTO=TCP SPT=44365 DPT=1524 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:50 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=33255 PROTO=TCP SPT=44365 DPT=12345 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:51 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=19161 PROTO=TCP SPT=44366 DPT=1524 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:51 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=3273 PROTO=TCP SPT=44366 DPT=12345 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:52 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=47034 PROTO=TCP SPT=44364 DPT=12346 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:53 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=29578 PROTO=TCP SPT=44365 DPT=12346 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:54 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=19639 PROTO=TCP SPT=44364 DPT=135 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:54 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=2169 PROTO=TCP SPT=44365 DPT=135 WINDOW=4096 RES=0x00 SYN URGP=0

Sep  9 00:19:54 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=28507 PROTO=TCP SPT=44364 DPT=31337 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:55 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=52461 PROTO=TCP SPT=44366 DPT=135 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:55 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=32695 PROTO=TCP SPT=44365 DPT=31337 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:55 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=12519 PROTO=TCP SPT=44366 DPT=31337 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:56 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=64158 PROTO=TCP SPT=44364 DPT=27665 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:56 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=25210 PROTO=TCP SPT=44365 DPT=27665 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:56 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=1529 PROTO=TCP SPT=44364 DPT=1234 WINDOW=4096 RES=0x00 SYN URGP=0 

Sep  9 00:19:57 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=17630 PROTO=TCP SPT=44366 DPT=27665 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:57 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=56152 PROTO=TCP SPT=44365 DPT=1234 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:57 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=64749 PROTO=TCP SPT=44366 DPT=1234 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=13951 PROTO=TCP SPT=44367 DPT=1234 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=48436 PROTO=TCP SPT=44367 DPT=27665 WINDOW=4096 RES=0x00 SYN URGP=0

Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=57621 PROTO=TCP SPT=44367 DPT=31337 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=9021 PROTO=TCP SPT=44367 DPT=135 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=52724 PROTO=TCP SPT=44367 DPT=1524 WINDOW=4096 RES=0x00 SYN URGP=0

Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=31190 PROTO=TCP SPT=44368 DPT=1234 WINDOW=4096 RES=0x00 SYN URGP=0 

Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=62037 PROTO=TCP SPT=44368 DPT=27665 WINDOW=4096 RES=0x00 SYN URGP=0

Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=14679 PROTO=TCP SPT=44368 DPT=31337 WINDOW=4096 RES=0x00 SYN URGP=0
 
Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=55248 PROTO=TCP SPT=44368 DPT=135 WINDOW=4096 S=0x00 SYN URGP=0 

Sep  9 00:19:58 Libranet kernel: IN= OUT=eth0 SRC=192.168.1.101 DST=65.59.207.51 LEN=40 
TOS=0x00 PREC=0x00 TTL=39 ID=17965 PROTO=TCP SPT=44368 DPT=1524 WINDOW=4096 RES=0x00 SYN URGP=0
I will be getting that rootkit detector from the link you provided. I'll tell you if it finds anything.

Thanks,
laminar1
 
Old 09-12-2004, 01:11 AM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
it looks like the box was used to portscan 65.59.207.51 for common backdoors...

if you didn't do that, i think it's very possible you've been OWNED...

if you've been OWNED, you'll need to re-install...

i can help you harden the linux box's firewall if you want... for a setup like that, a simple iptables script is much better than using firestarter...

good luck...
 
Old 09-12-2004, 02:38 AM   #5
laminar1
LQ Newbie
 
Registered: Sep 2004
Location: Wisconsin, USA
Distribution: Libranet 2.8.1 (Debian)
Posts: 17

Original Poster
Rep: Reputation: 0
I did not do any portscanning recently. I use snort just for local purposes and that not very well, it seems.

Remote root login in ssh has long been disabled on my machine. I just tuned it up today to also allow no password auth (only public-private keys) and only protocol 2. (It used to be 2,1).

I downloaded and ran RootKit Hunter as per your suggestion. Sweet little app. It found one vulnerability in PHP 4.3.4, but not anything else. No rootkits, no backdoors. I don't know what PHP does; perhaps that's how they got in.

How sure are you that I really got cracked? It bothers me that I might have to reinstall without ever finding the evidence. I have looked at my crontab and found a lot of automated running of programs, including 5snort. I have disabled the crontab entries and will check tomorrow for any strange activity on the linux machine. For instance, snort was set to check a range of ip addresses to find new AOL AIM servers. Something is not adding up quite yet. Perhaps I should grep every file on my machine to find where that doubleclick IP address is located.

If this was trinity v3, someone is using a very old technique from late 2000, to access my machine and doing it without my detecting exactly how. Trinity was a DDoS tool, not a port scanner, though. Probably more than one hack has taken place or the trinity label was spoofed.

I appreciate very much your offer to help me set up iptables; I will take you up on that in a few days. Do you have a favorite GUI front end for iptables?

laminar1
 
Old 09-12-2004, 03:37 AM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally posted by laminar1
I don't know what PHP does; perhaps that's how they got in.
php is hypertext preprocessor... basically, it let's you serve dynamic web pages by interfacing your web server with your database server... unless you are running a web server, i don't think this is the entry point (if there is one)... you're sure your apache wasn't running, right??

http://www.php.net

Quote:
How sure are you that I really got cracked?
well, i'm not 100% sure, if that's what you're asking... the portscan thing is indeed suspicious, though... is it possible that your IDS has some kinda "portscanning reaction" when a weird packet arrives?? like, maybe that dropped packet made the IDS want to find-out more about the host that sent it or something?? i'm just thinking out loud here...

Quote:
It bothers me that I might have to reinstall without ever finding the evidence.
you can copy your root partition to a cd or another partition or something (using a live cd, of course) and then you'll be able to perform an autopsy and other forensics on your current install whenever you want, even after re-installing...

Quote:
Something is not adding up quite yet.
i agree...

Quote:
If this was trinity v3, someone is using a very old technique from late 2000, to access my machine and doing it without my detecting exactly how. Trinity was a DDoS tool, not a port scanner, though. Probably more than one hack has taken place or the trinity label was spoofed.

Sep 8 11:26:02 Libranet kernel: IN=eth0 OUT= MAC=00:07:e9:ba:c8:16:00:0c:41:ac:75:78:08:00
SRC=65.59.207.51 DST=192.168.1.101 LEN=40 TOS=0x00 PREC=0x80 TTL=57 ID=0 DF PROTO=TCP
SPT=80 DPT=33270 WINDOW=6853 RES=0x00 ACK URGP=0
i'm not sure what to think about this packet... the hardware router was running when this happened??

looks like it could have been part of a prior connection or something... but i'm not sure, i'm just saying that cuz it's an ACK packet and it looks like it came from a web server (SPT=80), don't take that observation too seriously... i'm sleepy... =)

Quote:
I appreciate very much your offer to help me set up iptables; I will take you up on that in a few days.
cool, just let me know...

Quote:
Do you have a favorite GUI front end for iptables?
no, i just use a regular iptables script... i think it's simpler, more effective, and more educational...

Last edited by win32sux; 09-12-2004 at 03:39 AM.
 
Old 09-12-2004, 03:39 AM   #7
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
It cerntainly does look like someone used the box to portscan someone for common backdoors. If you had HTTP access to your box open,
and you were running a vulnerable version of PHP, it's possible that someone exploited it. Try looking in the Apache (httpd) logs to see if
anyone was making requests for strange pages or if there are odd errors. Also, does anyone else have an account on your box,
or access to the keyboard? It's possible that it was just used without your knowledge for the port scan, but no actual cracking of your
machine was involved.
 
Old 09-13-2004, 12:48 AM   #8
laminar1
LQ Newbie
 
Registered: Sep 2004
Location: Wisconsin, USA
Distribution: Libranet 2.8.1 (Debian)
Posts: 17

Original Poster
Rep: Reputation: 0
Well how strange can things get? The win2000 laptop that I used last night to post the previous messages was kaputt when I turned it on this morning. No sign of ntldr, ntdetect or the ever-popular ntoskrnl.exe. Holy cow. But I'm back on that machine now using my knoppix disk, which is working extremely well. I have no explanation of what happened to my Win2K laptop. I doubt just corruption of the files, since all those mentioned files were flat out GONE. The important data has already been backed via Samba. Without linux, I'd be in a world of serious hurt right now. BTW, this laptop had up-to-date ZoneAlarm Pro and McAfee antivrus running continuously, and it sits behind the hardware firewall with all ports closed. Figure that one out for me.

Anyway, back to the Linux box issues.

chort-- I checked the apache logs, and found nothing unusual. As it turns out, I WAS running apache, without knowing it, since it was part of the original install and it ran until I disabled it in July. The logs are clean, however, and I don't have any evidence of anyone ever attempting access. There are no other users on this machine except my kids, age 5 and under, who are much more interested in sesameworkshop.org than in portscanning servers on the internet. And finally, I have not found any odd errors.

win32sux--as above, no apache running. Your comment on that one packet was on target: it was ACK, but the ones previous to it were ACK SYN. Does that imply anything? I was checking my snort directory, including the many rules files. The portscan and backdoor rules files are very similar to the output I saw in syslog. I have disabled cron and will run a test in the next few days to see if perhaps the activity disappears. snort was running essentially unconfigured when I captured these data. For instance, the HOME_NET variable was not set. Could this have caused the crontab running 5snort to scan for backdoors? What is 5snort, anyway, as opposed to snort?

As ususal, too many questions, but I appreciate your helpful comments.
 
  


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
rooted, can we salvage files ciscohead Linux - Security 7 11-21-2005 12:31 AM
Have I been rooted? schteelhead Linux - Security 2 12-24-2004 08:46 PM
So... Toshiba just rooted my machine. steyr Linux - Security 3 09-01-2004 06:33 AM
I thin I have been rooted ProtoformX Linux - Security 9 05-31-2004 02:16 PM
opinions if this server has been rooted Jusitn S Linux - Security 2 11-04-2003 10:00 AM

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

All times are GMT -5. The time now is 12:28 AM.

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