LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-24-2017, 08:11 PM   #1
krazybob
Member
 
Registered: Oct 2009
Location: Los Angeles, CA
Distribution: Centos 5.x
Posts: 133

Rep: Reputation: 3
Help with BASH scripting


I have a server that has been hacked. I don't trust that the backups aren't compromised. mysql won't start and I'm in the middle of migrating off of a server with one failed drive in a RAID 1 setup. If I try creating a TAR of the web site databases the server load skyrockets to 500+. I don't program in BASH.

I am looking for an example that will create a for/next loop of directories of files whose names are not known and add them one at a time to a TAR. I know had to append to a TAR just not how to for/next or for i in x whatever. I'd like to add a sleep variable so that the server load stays low. What a headache this is.

Any suggestions?
 
Old 05-24-2017, 08:32 PM   #2
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
If tar is indeed the cause of the server load, you will see it when running top or ps.

If an existing tar process is causing the load, then you can use renice to adjust its priority. Or for new processes, you can launch it with nice to cap it from the beginning.
 
Old 05-24-2017, 08:46 PM   #3
krazybob
Member
 
Registered: Oct 2009
Location: Los Angeles, CA
Distribution: Centos 5.x
Posts: 133

Original Poster
Rep: Reputation: 3
Thank you but TAR isn't the reason for the load.As I wrote drive 0 in the RAID has failed and I'm petrified to power down and replace it then rebuild. I am trying to get files off for customers before going that route.

I have attempted to build a TAR and the server load skyrockets because of the RAID issue. That's why I'd like a script idea so that I may add 1 file at a time to a TAR with a sleep variable so that the server doesn't get overloaded.
 
Old 05-24-2017, 08:58 PM   #4
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Ok if nice and renice don't work for you on the process causing the load, there are several ways. Here's one that appends to a tar archive using the r option:

Code:
while read f; 
do 
        tar rf /another/path/foo.tar "$f"; 
        echo "$f"; 
        sleep 1; 
done < <( find /some/path/to/a/directory/ -type f -print );

bzip2 /another/path/foo.tar
Note that you can't compress using this method until all the files are collected into the archive.

Edit: if you want symlinks or other weird things, you'll need to modify the expression for find

Last edited by Turbocapitalist; 05-24-2017 at 09:00 PM.
 
2 members found this post helpful.
Old 05-24-2017, 09:01 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
If I try creating a TAR of the web site databases the server load skyrockets to 500+. I don't program in BASH.
1. What is the database you're wanting to tar/backup?
2. Why do you not trust your backups of the database? How do you think the DB might be corrupted?

You have read through man tar, yes? I'm not familiar with tar, except for extracting, but if you show what you'd do manually to add files to a tarball, I'm sure someone here would help with the bash scripting required.

[I hate it when crises force rapid learning. Hang in there. Good Luck!)
 
1 members found this post helpful.
Old 05-24-2017, 09:09 PM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Most databases have their own backup utilities to guarantee database integrity in your backup copy. Why not use those?
 
Old 05-24-2017, 09:10 PM   #7
krazybob
Member
 
Registered: Oct 2009
Location: Los Angeles, CA
Distribution: Centos 5.x
Posts: 133

Original Poster
Rep: Reputation: 3
Since the server was hacked we don't know when and can't trust the backups. We may have backed up the hack. Mysql is broken. It is being used to send spam.
 
Old 05-24-2017, 09:18 PM   #8
krazybob
Member
 
Registered: Oct 2009
Location: Los Angeles, CA
Distribution: Centos 5.x
Posts: 133

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Turbocapitalist View Post
Ok if nice and renice don't work for you on the process causing the load, there are several ways. Here's one that appends to a tar archive using the r option:

Code:
while read f; 
do 
        tar rf /another/path/foo.tar "$f"; 
        echo "$f"; 
        sleep 1; 
done < <( find /some/path/to/a/directory/ -type f -print );

bzip2 /another/path/foo.tar
Note that you can't compress using this method until all the files are collected into the archive.

Edit: if you want symlinks or other weird things, you'll need to modify the expression for find
Wow. I sure didn't expect you to write it for me but WOW. Thank you. It looks like what I need. I'm not sure that I know how to deal with the symlinks. I found thousands of spam files in /etc/rc.d/init.d that I can delete manually. They appear also in /etc/rc.d and rc0, etc. as symlinks. Trying to use the

Code:
find . -type f -size 315b -delete
but it refused to let me delete them. They are all 315 bytes and 323.

Everything is being moved to a new server but I am manually saving files outside of the OS directories (those in /var/www/html)

This server is toast!

pwd: /etc/rc.d/rc0.d

Code:
lrwxrwxrwx  1 root root   20 Jan  3 14:06 K90lzifubohex -> ../init.d/lzifubohex
lrwxrwxrwx  1 root root   20 Dec 29 20:57 K90lzmsjwemsb -> ../init.d/lzmsjwemsb
lrwxrwxrwx  1 root root   20 Jan  1 17:05 K90lzocvfvqar -> ../init.d/lzocvfvqar
lrwxrwxrwx  1 root root   20 Jan  6 13:01 K90lzpuintxtz -> ../init.d/lzpuintxtz
lrwxrwxrwx  1 root root   20 Jan  4 18:33 K90lzrpfgopdc -> ../init.d/lzrpfgopdc
lrwxrwxrwx  1 root root   20 Dec 29 16:33 K90lzvhkcuywr -> ../init.d/lzvhkcuywr
lrwxrwxrwx  1 root root   20 Dec 30 09:16 K90lzwtyfkjed -> ../init.d/lzwtyfkjed
lrwxrwxrwx  1 root root   20 Dec 29 21:07 K90lzxdfljwmf -> ../init.d/lzxdfljwmf
lrwxrwxrwx  1 root root   20 Jan  2 19:33 K90lzyfpjnylz -> ../init.d/lzyfpjnylz
lrwxrwxrwx  1 root root   20 Dec 29 07:47 K90lzyglqdzrx -> ../init.d/lzyglqdzrx
lrwxrwxrwx  1 root root   20 Dec 30 21:13 K90lzzxdbjnsk -> ../init.d/lzzxdbjnsk
 
Old 05-24-2017, 09:19 PM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by krazybob View Post
Since the server was hacked we don't know when and can't trust the backups. We may have backed up the hack. Mysql is broken. It is being used to send spam.
Aha! mysql!
If you can't trust the backups, how does taking a tar of the mysql files help? Wouldn't that just be another backup of the hack?

Maybe:
1. Kill mysql to prevent the spamming and/or take the server off the 'net
2. Tell us about what's happening...*how* is mysql sending spam (not sure a database can do that without a script/program running against it -- find and kill the script/program?)
2a. Is the spam being sent with your mail server, or with something like php_mail? Kill the thing that's sending the email to gain time and stop the bleeding.

[Been there...]
 
Old 05-24-2017, 09:23 PM   #10
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Yeah, the server is toast. It'll have to be reformatted. Hopefully you have an idea how they cracked it so that the new system can be configured to prevent a recurrence.


Quote:
Originally Posted by krazybob View Post
Trying to use the

Code:
find . -type f -size 315b -delete
but it refused to let me delete them. They are all 315 bytes and 323.
You'll want c instead of b for bytes instead of blocks. See the manual page for find.
 
Old 05-24-2017, 09:24 PM   #11
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Quote:
Originally Posted by krazybob View Post
pwd: /etc/rc.d/

Code:
lrwxrwxrwx  1 root root   20 Jan  3 14:06 K90lzifubohex -> ../init.d/lzifubohex
lrwxrwxrwx  1 root root   20 Dec 29 20:57 K90lzmsjwemsb -> ../init.d/lzmsjwemsb
lrwxrwxrwx  1 root root   20 Jan  1 17:05 K90lzocvfvqar -> ../init.d/lzocvfvqar
lrwxrwxrwx  1 root root   20 Jan  6 13:01 K90lzpuintxtz -> ../init.d/lzpuintxtz
lrwxrwxrwx  1 root root   20 Jan  4 18:33 K90lzrpfgopdc -> ../init.d/lzrpfgopdc
lrwxrwxrwx  1 root root   20 Dec 29 16:33 K90lzvhkcuywr -> ../init.d/lzvhkcuywr
lrwxrwxrwx  1 root root   20 Dec 30 09:16 K90lzwtyfkjed -> ../init.d/lzwtyfkjed
lrwxrwxrwx  1 root root   20 Dec 29 21:07 K90lzxdfljwmf -> ../init.d/lzxdfljwmf
lrwxrwxrwx  1 root root   20 Jan  2 19:33 K90lzyfpjnylz -> ../init.d/lzyfpjnylz
lrwxrwxrwx  1 root root   20 Dec 29 07:47 K90lzyglqdzrx -> ../init.d/lzyglqdzrx
lrwxrwxrwx  1 root root   20 Dec 30 21:13 K90lzzxdbjnsk -> ../init.d/lzzxdbjnsk
[we all be working this at the same time...cross posting...patience]
post the contents of one of those bogus init files?
Might you be able to
Code:
/etc/init.d/lzzxdbjnsk stop
?? THEN remove it.
Don't think removing the init.d file will have any effect on the process it's running...
 
Old 05-24-2017, 09:52 PM   #12
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,727

Rep: Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211Reputation: 2211
Another thought:
From /etc/init.d/
Code:
find . -name lz* -delete
...but still need to stop them first, or kill the processes they're running, first, IMO

[I'm assuming (and we all know what THAT means) that krazybob is firefighting *right now* --]

[Turbocapitalist: I like your input. I learn from almost everyone of your posts. Just sayin']
 
Old 05-24-2017, 10:05 PM   #13
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,309
Blog Entries: 3

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
Quote:
Originally Posted by scasey View Post
Code:
find . -name lz* -delete
...but still need to stop them first, or kill the processes they're running, first, IMO
I'd look inside the target of the symlink to be sure what it does and how it behaves and what it launches. I wouldn't trust it enough to run it so I'd say to use kill or pkill to zap what those scripts launched.
 
Old 05-24-2017, 11:09 PM   #14
krazybob
Member
 
Registered: Oct 2009
Location: Los Angeles, CA
Distribution: Centos 5.x
Posts: 133

Original Poster
Rep: Reputation: 3
Umm.. I'm not cross posting. I posted in Servers.

They uploaded javascript and symlinked sendmail to another MTA. I don't know how to reverse it.

Code:
lrwxrwxrwx 1 root root 21 Jan 10  2010 sendmail -> /etc/alternatives/mta
Code:
lrwxrwxrwx 1 root root 21 Jan 10  2010 sendmail -> /etc/alternatives/mta
-bash-3.2 clss03 # cd /etc/alternatives/mta
-bash: cd: /etc/alternatives/mta: Not a directory
-bash-3.2 clss03 # cd /etc/alternatives/   
-bash-3.2 clss03 # ls -lah
total 8.0K
drwxr-xr-x  2 root root 4.0K Jan 12  2010 .
drwxr-xr-x 80 root root 4.0K May 24 09:50 ..
lrwxrwxrwx  1 root root   19 Jan 12  2010 antlr -> /usr/bin/antlr-java
lrwxrwxrwx  1 root root   55 Jan 12  2010 appletviewer -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/appletviewer
lrwxrwxrwx  1 root root   56 Jan 12  2010 appletviewer.1.gz -> /usr/share/man/man1/appletviewer-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   46 Jan 12  2010 apt -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/apt
lrwxrwxrwx  1 root root   47 Jan 12  2010 apt.1.gz -> /usr/share/man/man1/apt-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   51 Jan 12  2010 extcheck -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/extcheck
lrwxrwxrwx  1 root root   52 Jan 12  2010 extcheck.1.gz -> /usr/share/man/man1/extcheck-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   40 Jan 12  2010 hibernate_jdbc_cache -> /usr/share/java/jakarta-commons-dbcp.jar
lrwxrwxrwx  1 root root   34 Jan 12  2010 jaf -> /usr/share/java/classpathx-jaf.jar
lrwxrwxrwx  1 root root   46 Jan 12  2010 jar -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jar
lrwxrwxrwx  1 root root   47 Jan 12  2010 jar.1.gz -> /usr/share/man/man1/jar-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   52 Jan 12  2010 jarsigner -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jarsigner
lrwxrwxrwx  1 root root   53 Jan 12  2010 jarsigner.1.gz -> /usr/share/man/man1/jarsigner-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   46 Jan 12  2010 java -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
lrwxrwxrwx  1 root root   48 Jan 12  2010 java.1.gz -> /usr/share/man/man1/java-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   38 Jan 12  2010 java_sdk -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   38 Jan 12  2010 java_sdk_1.6.0 -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   46 Jan 12  2010 java_sdk_1.6.0_exports -> /usr/lib/jvm-exports/java-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   46 Jan 12  2010 java_sdk_exports -> /usr/lib/jvm-exports/java-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   38 Jan 12  2010 java_sdk_openjdk -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   46 Jan 12  2010 java_sdk_openjdk_exports -> /usr/lib/jvm-exports/java-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   48 Jan 12  2010 javac -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javac
lrwxrwxrwx  1 root root   49 Jan 12  2010 javac.1.gz -> /usr/share/man/man1/javac-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   50 Jan 12  2010 javadoc -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javadoc
lrwxrwxrwx  1 root root   51 Jan 12  2010 javadoc.1.gz -> /usr/share/man/man1/javadoc-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   48 Jan 12  2010 javah -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javah
lrwxrwxrwx  1 root root   49 Jan 12  2010 javah.1.gz -> /usr/share/man/man1/javah-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   52 Jan 12  2010 javamail -> /usr/share/java/classpathx-mail-1.3.1-monolithic.jar
lrwxrwxrwx  1 root root   48 Jan 12  2010 javap -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/javap
lrwxrwxrwx  1 root root   49 Jan 12  2010 javap.1.gz -> /usr/share/man/man1/javap-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   29 Jan 12  2010 jaxp_parser_impl -> /usr/share/java/xerces-j2.jar
lrwxrwxrwx  1 root root   28 Jan 12  2010 jaxp_transform_impl -> /usr/share/java/xalan-j2.jar
lrwxrwxrwx  1 root root   51 Jan 12  2010 jconsole -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jconsole
lrwxrwxrwx  1 root root   52 Jan 12  2010 jconsole.1.gz -> /usr/share/man/man1/jconsole-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   46 Jan 12  2010 jdb -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jdb
lrwxrwxrwx  1 root root   47 Jan 12  2010 jdb.1.gz -> /usr/share/man/man1/jdb-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   47 Jan 12  2010 jhat -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jhat
lrwxrwxrwx  1 root root   48 Jan 12  2010 jhat.1.gz -> /usr/share/man/man1/jhat-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   48 Jan 12  2010 jinfo -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jinfo
lrwxrwxrwx  1 root root   49 Jan 12  2010 jinfo.1.gz -> /usr/share/man/man1/jinfo-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   47 Jan 12  2010 jmap -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jmap
lrwxrwxrwx  1 root root   48 Jan 12  2010 jmap.1.gz -> /usr/share/man/man1/jmap-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   33 Jan 12  2010 jmxri -> /usr/share/java/mx4j/mx4j-jmx.jar
lrwxrwxrwx  1 root root   46 Jan 12  2010 jps -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jps
lrwxrwxrwx  1 root root   47 Jan 12  2010 jps.1.gz -> /usr/share/man/man1/jps-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   37 Jan 12  2010 jre -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   26 Jan 12  2010 jre_1.4.2 -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx  1 root root   34 Jan 12  2010 jre_1.4.2_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
lrwxrwxrwx  1 root root   37 Jan 12  2010 jre_1.6.0 -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   45 Jan 12  2010 jre_1.6.0_exports -> /usr/lib/jvm-exports/jre-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   45 Jan 12  2010 jre_exports -> /usr/lib/jvm-exports/jre-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   26 Jan 12  2010 jre_gcj -> /usr/lib/jvm/jre-1.4.2-gcj
lrwxrwxrwx  1 root root   34 Jan 12  2010 jre_gcj_exports -> /usr/lib/jvm-exports/jre-1.4.2-gcj
lrwxrwxrwx  1 root root   37 Jan 12  2010 jre_openjdk -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   45 Jan 12  2010 jre_openjdk_exports -> /usr/lib/jvm-exports/jre-1.6.0-openjdk.x86_64
lrwxrwxrwx  1 root root   53 Jan 12  2010 jrunscript -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jrunscript
lrwxrwxrwx  1 root root   54 Jan 12  2010 jrunscript.1.gz -> /usr/share/man/man1/jrunscript-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   52 Jan 12  2010 jsadebugd -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jsadebugd
lrwxrwxrwx  1 root root   53 Jan 12  2010 jsadebugd.1.gz -> /usr/share/man/man1/jsadebugd-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   39 Jan 12  2010 jsp -> /usr/share/java/tomcat5-jsp-2.0-api.jar
lrwxrwxrwx  1 root root   49 Jan 12  2010 jstack -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jstack
lrwxrwxrwx  1 root root   50 Jan 12  2010 jstack.1.gz -> /usr/share/man/man1/jstack-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   48 Jan 12  2010 jstat -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jstat
lrwxrwxrwx  1 root root   49 Jan 12  2010 jstat.1.gz -> /usr/share/man/man1/jstat-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   49 Jan 12  2010 jstatd -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/jstatd
lrwxrwxrwx  1 root root   50 Jan 12  2010 jstatd.1.gz -> /usr/share/man/man1/jstatd-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   49 Jan 12  2010 keytool -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/keytool
lrwxrwxrwx  1 root root   51 Jan 12  2010 keytool.1.gz -> /usr/share/man/man1/keytool-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   23 Jan 12  2010 mta -> /var/qmail/bin/sendmail
lrwxrwxrwx  1 root root   55 Jan 12  2010 native2ascii -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/native2ascii
lrwxrwxrwx  1 root root   56 Jan 12  2010 native2ascii.1.gz -> /usr/share/man/man1/native2ascii-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   46 Jan 12  2010 orbd -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/orbd
lrwxrwxrwx  1 root root   48 Jan 12  2010 orbd.1.gz -> /usr/share/man/man1/orbd-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   49 Jan 12  2010 pack200 -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/pack200
lrwxrwxrwx  1 root root   51 Jan 12  2010 pack200.1.gz -> /usr/share/man/man1/pack200-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   53 Jan 12  2010 policytool -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/policytool
lrwxrwxrwx  1 root root   54 Jan 12  2010 policytool.1.gz -> /usr/share/man/man1/policytool-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   47 Jan 12  2010 rmic -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/rmic
lrwxrwxrwx  1 root root   48 Jan 12  2010 rmic.1.gz -> /usr/share/man/man1/rmic-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   46 Jan 12  2010 rmid -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/rmid
lrwxrwxrwx  1 root root   48 Jan 12  2010 rmid.1.gz -> /usr/share/man/man1/rmid-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   53 Jan 12  2010 rmiregistry -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/rmiregistry
lrwxrwxrwx  1 root root   55 Jan 12  2010 rmiregistry.1.gz -> /usr/share/man/man1/rmiregistry-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   52 Jan 12  2010 schemagen -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/schemagen
lrwxrwxrwx  1 root root   53 Jan 12  2010 schemagen.1.gz -> /usr/share/man/man1/schemagen-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   52 Jan 12  2010 serialver -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/serialver
lrwxrwxrwx  1 root root   53 Jan 12  2010 serialver.1.gz -> /usr/share/man/man1/serialver-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   52 Jan 12  2010 servertool -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/servertool
lrwxrwxrwx  1 root root   54 Jan 12  2010 servertool.1.gz -> /usr/share/man/man1/servertool-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   43 Jan 12  2010 servlet -> /usr/share/java/tomcat5-servlet-2.4-api.jar
lrwxrwxrwx  1 root root   51 Jan 12  2010 tnameserv -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/tnameserv
lrwxrwxrwx  1 root root   53 Jan 12  2010 tnameserv.1.gz -> /usr/share/man/man1/tnameserv-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   51 Jan 12  2010 unpack200 -> /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/unpack200
lrwxrwxrwx  1 root root   53 Jan 12  2010 unpack200.1.gz -> /usr/share/man/man1/unpack200-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   48 Jan 12  2010 wsgen -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/wsgen
lrwxrwxrwx  1 root root   49 Jan 12  2010 wsgen.1.gz -> /usr/share/man/man1/wsgen-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   51 Jan 12  2010 wsimport -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/wsimport
lrwxrwxrwx  1 root root   52 Jan 12  2010 wsimport.1.gz -> /usr/share/man/man1/wsimport-java-1.6.0-openjdk.1.gz
lrwxrwxrwx  1 root root   46 Jan 12  2010 xjc -> /usr/lib/jvm/java-1.6.0-openjdk.x86_64/bin/xjc
lrwxrwxrwx  1 root root   47 Jan 12  2010 xjc.1.gz -> /usr/share/man/man1/xjc-java-1.6.0-openjdk.1.gz

Last edited by krazybob; 05-24-2017 at 11:11 PM.
 
Old 05-24-2017, 11:29 PM   #15
krazybob
Member
 
Registered: Oct 2009
Location: Los Angeles, CA
Distribution: Centos 5.x
Posts: 133

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by scasey View Post
[we all be working this at the same time...cross posting...patience]
post the contents of one of those bogus init files?
Might you be able to
Code:
/etc/init.d/lzzxdbjnsk stop
?? THEN remove it.
Don't think removing the init.d file will have any effect on the process it's running...
OK. I can't reply to everyone or I will make it look messy. The files cover a-z and reside in /etc/rc.d/init.d AND in /etc/init.d. They are in /etc/rc.d/rc0..., rc1... etc as symlinks.

The server is toast. Mysql itself - the executable - has been compromised. It won't start and mysql.sock isn't created. I trust that the database files *might* be clean but not mysql itself. I am going to try and reinstall mysql from the rpm's but it seems better to save the user web site content, their mysql databases that are quote small, and I can even save their mail. Once the new server is online I can extract the tars after adding the domains back and they will run fine. Its an old trick that works.

But when it comes to symlinks I'll admit that I am an amateur. And yes, I am fighting a fire.

This is a Virtuozzo server with THREE containers compromised. Each has a small installation of Plesk on-board.

How to I remove the symlink from sendmail to stop using the "alternative MTA"? They are sending and trying to stay under the radar by not maxing out my 100Mbps connection. Some do and I lose control for a bit. We have an external fire wall appliance with good bandwidth but it cannot keep up. We're on a 10Mpbs circuit burstable to 100Mbps and I don't think they put us on a 1Gbps port. So... when we max out bandwidth we're crippled. I installed a telephone rebooter device on the firewall and that usually gets me back in. We have KVM/IP's and APC Power Switches -- that cannot be reached. I didn't set the Cisco switches up to manually turn off a port. I could have but as a rookie I didn't think it important. Plus I didn't have the password. I could have Googled it but didn't. I installed 25 servers, wired in a public IP switch and a private 192.168.x.x for back haul. It cannot be reached either.

I am a non-profit employee. I don't get paid much for this work. We used to have an actual Admin but he took a real job. As a programmer I volunteered and began learning Linux as fast as I could. But with no one to show me the ropes it is kind people such as yourself that help.

Here is the code inside each file of 315 bytes to 323 bytes. I don't see the obvious difference in file size.

Code:
-bash-3.2 clss03 # cat adsosqsdxj
#!/bin/sh
# chkconfig: 12345 90 90
# description: adsosqsdxj
### BEGIN INIT INFO
# Provides:             adsosqsdxj
# Required-Start:
# Required-Stop:
# Default-Start:        1 2 3 4 5
# Default-Stop:
# Short-Description:    adsosqsdxj
### END INIT INFO
case $1 in
start)
        /usr/bin/adsosqsdxj
        ;;
stop)
        ;;
*)
        /usr/bin/adsosqsdxj
        ;;
esac
 
  


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
LXer: Shell Scripting Part I: Getting started with bash scripting LXer Syndicated Linux News 0 04-29-2015 08:03 AM
Bash Scripting – Code Structure - Defining Multiple Points Of Entry In Bash Script carlr Programming 10 08-25-2014 02:38 AM
[To share Bash knowledge]Notes for Advanced Bash-Scripting Version 10 (Latest) jcky Programming 4 07-31-2014 09:24 AM
LXer: Bash If statements, Exit Status and Comparison Operators, A beginners guide to bash scripting LXer Syndicated Linux News 0 06-29-2014 07:35 PM
Reading a bash variable in bash scripting problem freeindy Programming 3 11-27-2008 02:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:05 PM.

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