Category Archives: Uncategorized

Virus, Malware Master Note

11/21/2017
Malware Bytes 3.3.1
Download and scan
AdwCleaner
Farbar

ESET

Download esetsmartinstaller_enu.exe and save it to your Desktop
Double click the icon
Check YES, I accept the Terms of Use
Click the Start button
Accept any security warnings from your browser
Click Advanced settings
Check the following items

Enable detection of potentially unwanted applications
Remove found threats
Scan archives
Scan for potentially unsafe applications
Enable Anti-Stealth technology

Click Start
ESET will then download updates and begin scanning your computer
If no threats are found simply click Uninstall application on close and hit Finish
If threats are found click List of found threats
Click Export to text file
Save the file on your Desktop as ESET.txt
Click Back
Review the list of entries and if there are any you want to keep stop and copy/paste the ESET.txt report in your reply for my review
If you do not wish to keep any of the entries check Uninstall application on close and Delete quarantined files
Click Finish
Close the ESET Online Scanner window
Copy and paste the contents of ESET.txt in your reply
—————————————————————————————————–

Security Analysis by Rocket Grannie

——————–

Please download Security Analysis by Rocket Grannie and save it to your Desktop
Right click on the icon and select Run as admnistrator
Click OK on the disclaimer and ignore any security warnings that may appear
In your reply, please copy and paste the contents of the Notepad document that will appear on your desktop
——————————————————————————————————-

Process Explorer
Open Resource Manager

WordPress Master Notes MRC Consulting

These notes will help with modifying wordpress, these are just observations and notes I have played with over time to get the theme to do what I think is useful to me. Play with these items at you own risk.!

Some will say that a child theme should not be modified, but that is up to you.

sp_who.sql

/* ####################################################################### */
/*                                                                         */
/* FILENAME: sp_who.sql                                                    */
/*                                                                         */
/* Purpose: Shows who is in the database                                   */
/*                                                                         */
/* Parameters: None                                                        */
/*                                                                         */
/*                     *** DO NOT HAND EDIT THIS FILE ***                  */
/* ####################################################################### */
/*                                                                         */
/* Revision History:                                                       */
/*                                                                         */
/* REV   DATE         BY        DESCRIPTION                                */
/* ---  ------  --------------  ------------------------------------------ */
/* 1.0                          INFRASTRUCTURE Initial Relase              */
/*                                                                         */
/*                     *** DO NOT HAND EDIT THIS FILE ***                  */
/*                                                                         */
/* ####################################################################### */
set pages 30 head off feed off

select 'User Status for Oracle Database is ', name from v\$database;
set head on

prompt
prompt All currently running processes
prompt ===============================

set pages 60 lines 132

col sid      format 999 heading "SID"
col Typ      format a3
col process  format a10 heading "Client PID"
col spid     format a10 heading "Server PID"
col username format a10 heading "ORA User"
col osuser   format a8  heading "OS User"
col term     format a7  heading "TTY"
col stat     format a2  heading "ST"
col lw       format a2  heading "LK"
col com      format a8  heading "Command"
col mach     format a10 heading "Host"
col latchw   format a2  heading "LA"

select  s.sid,
        s.serial#,
        nvl(decode(s.sql_hash_value,0,' ','*'),'?')||nvl(s.process,'?') process,
        nvl(p.spid,'?') spid,
        s.username username, nvl(substr(s.osuser,1,8),'?') osuser,
        replace(replace(nvl(substr(s.terminal,1,7),'?'),'PC',''),'tty','') term,
        decode(s.status,'ACTIVE','R','INACTIVE','W','KILLED','Z') stat,
        decode(s.lockwait,NULL,'N','Y') lw,
        nvl(decode(s.command,1,'CRT TABL',2,'INSERT',3,'SELECT',4,'CRT CLST',
                5,'ALT CLST',6,'UPDATE',7,'DELETE',8,'DROP',9,'CRT INDX',
                10,'DRP INDX',11,'ALT INDX',12,'DRP TABL',15,'ALT TABL',
                17,'GRANT',18,'REVOKE',19,'CRT SYNM',20,'DRP SYNM',21,
                'CRT VIEW',22,'DRP VIEW',26,'LOC TBLE',27,'NOTHING',28,
                'RENAME',29,'COMMENT',30,'AUDIT',31,'NOAUDIT',32,'CRT XTDB',
                33,'DRP XTDB',34,'CRT DBSE',35,'ALT DBSE',36,'CRT RSEG',
                37,'ALT RSEG',38,'DRP RSEG',39,'CRT TBSP',40,'ALT TBSP',
                41,'DRP TBSP',42,'ALT SESS',43,'ALT USER',44,'COMMIT',
                45,'ROLLBACK',46,'SVEPOINT','IDLE'),'?') com,
        substr(nvl(s.machine,'?'),1,9) mach,
        decode(p.latchwait,NULL,'N','Y') latchw,
        decode(least(instr(p.program,'TCP'),1),1,'TCP',
        decode(least(instr(p.program,'TNS'),1),1,'TNS',
        decode(least(instr(p.program,'Pip'),1),1,'Pip','   '))) Type
 from v\$session s, v\$process p
where addr = paddr
  and p.background is NULL
union
select  s.sid,
        s.serial#,
        nvl(decode(s.sql_hash_value,0,' ','*'),'?')||nvl(s.process,'?') process,
        nvl(p.spid,'?') spid,
        p.username username, nvl(substr(s.osuser,1,8),'?') osuser,
        replace(replace(substr(p.terminal,1,7),'PC',''),'tty','') term,
        decode(s.status,'ACTIVE','R','INACTIVE','W','KILLED','Z') stat,
        decode(s.lockwait,NULL,'N','Y') lw,
        nvl(decode(s.command,1,'CRT TABL',2,'INSERT',3,'SELECT',4,'CRT CLST',
                5,'ALT CLST',6,'UPDATE',7,'DELETE',8,'DROP',9,'CRT INDX',
                10,'DRP INDX',11,'ALT INDX',12,'DRP TABL',15,'ALT TABL',
                17,'GRANT',18,'REVOKE',19,'CRT SYNM',20,'DRP SYNM',21,
                'CRT VIEW',22,'DRP VIEW',26,'LOC TBLE',27,'NOTHING',28,
                'RENAME',29,'COMMENT',30,'AUDIT',31,'NOAUDIT',32,'CRT XTDB',
                33,'DRP XTDB',34,'CRT DBSE',35,'ALT DBSE',36,'CRT RSEG',
                37,'ALT RSEG',38,'DRP RSEG',39,'CRT TBSP',40,'ALT TBSP',
                41,'DRP TBSP',42,'ALT SESS',43,'ALT USER',44,'COMMIT',
                45,'ROLLBACK',46,'SVEPOINT'),'?') com,
        substr(nvl(s.machine,'?'),1,9) mach,
        decode(p.latchwait,NULL,'N','Y') latchw,
        decode(least(instr(p.program,'TCP'),1),1,'TCP',
        decode(least(instr(p.program,'TNS'),1),1,'TNS',
        decode(least(instr(p.program,'Pip'),1),1,'Pip','   '))) Type
from v\$session s, v\$process p
where addr = paddr
and p.background is not NULL
order by 1;

prompt
prompt Rollback Segment Usage
prompt ======================

set lines 150

col name    format a10
col usn     format 99
col sid     format 999
col xacts   format 9999
col extents format 999999
col extends format 99999
col waits   format 9999
col wraps   format 9999999
col shrnk   format 999999
col name    format a12
col osusr   format a6
col status  format a9
col writes  format 9999999999999

select r.usn, r.name, s.osuser osusr,
       s.sid, x.extents, x.xacts,
       x.extends, x.waits, x.shrinks shrnk,
       x.wraps, x.writes, x.status
from   v\$rollstat x,
       v\$rollname r,
       v\$session s,
       v\$transaction t
where  t.addr = s.taddr (+)
  and  x.usn (+) = r.usn
  and  t.xidusn (+) = r.usn
order by r.usn;
exit;

HSTCREATE

Host common is a library of functions that will help to create, maintain, hosts involved with Oracle databases as well as other types of servers

This file should also have the

List of functions

HSTCREATE => hst_common.ksh
HSTCREATE – Library of creation scripts for creating and maintaining hosts
Linux_common.ksh should be used in this capacity to link in the necessary low-level scripts to perform

/oracle/admin/scripts/hstcreate – current production copy of the scripts
/oracle/admin/scripts/hstcreate/dev – development stuff

Using DBAdmin there are several functions that can be utilized for these purposes

hst_create.ksh –

initapex()
{

}

This function shows the banner of the script and the script name along with the arguments file
disp_banner_hst_cr ()
{
echo
echo "Host create script..........: hst_create.ksh"
echo "Host create arguments file..: hst_create.args"
echo
}


function next_menu
{
echo
echo "# ----------------------------------------------------------------------- #"
echo "[ ...  Press any key to continue ... ]"
read next
}

init_apex ()
{

# Initialize the database access to DBAdmin
# Set this up on a separate database
export BRAIN1D='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=49125))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DBADMD01)))'
export DBADM='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=49125))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=DBADMD01)))'
export DBADM42='(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=49125))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=BRAIN1D)))'

export UsrPwd='hc_core/somepassword'
export UsrPwd2='dba01/somepassword'

}

host_apex_chk ()
{
####################################################################
# prereq is init_apex function should be included
# Set the hostname then search for the host record in APEX
# once you get the DBAdmin host record in mach_id
####################################################################
# grab the hostname
hst_nm=`hostname`

# echo $hst_nm
mach_id=`${ORACLE_HOME}/bin/sqlplus -s $UsrPwd2@$BRAIN1D <<EOF
        set head off feed off pages 0 trimspool on
        select MCH_ID from dba01.machine where MCH_NM=upper('$hst_nm');
--        select MCH_ID from dba01.machine;
--        exit;
EOF`

mch_nm=`${ORACLE_HOME}/bin/sqlplus -s $UsrPwd2@$BRAIN1D <<EOF
        set head off feed off pages 0 trimspool on
        select MCH_NM from dba01.machine where MCH_NM=upper('$hst_nm');
--        exit;
EOF`

# Uncomment the next line for debugging purposes
# echo "DBAdmin record no...: "$mach_id

}


This is a directory checking function, if the directory doesn't exists it creates it

chk_gen_dir ()
{
############################################################################
# Check to see if the directory to generate the files exists
# added /scripts to the end of the gendir to check
############################################################################
if [ ! -d $gendir/scripts ] ; then
#   echo "Directory "${gendir}" does not exist"
   print "\nDirectory ${gendir}/scripts does not exist"
   print "\nDirectory ${gendir}/scripts needs to be created "
   ans=
   while [ -z $ans ]
   do
      echo -n "Create directory? ${gendir}/scripts "
      read ans
   done
   if [[ $ans =~ ^[Yy]$ ]]
   then
      print "\n...Creating directory...."
#      mkdir ${gendir}/scripts
#      mkdir ${gendir}/scripts
      print "\n...Not Creating directory in test mode...."
   else
      print "\n...Not Creating directory...."
      print "\nExiting program"
      exit
   fi
else
   print "\nDirectory ${gendir}scripts exists"
   echo
   ls ${gendir}/scripts

   ans=
   while [ -z $ans ]
   do
      echo -n "Do you wish to overwrite what is already generated? "
      read ans
   done

   if [[ $ans =~ ^[Yy]$ ]]
    then
      print "\n...Continuing..............................."
   else
      print "\n....Exiting program without creating scripts"
      exit
   fi

   ans=
   while [ -z $ans ]
   do
      echo -n "Proceed to script creation? "
      read ans
   done

   if [[ $ans =~ ^[Yy]$ ]]
    then
      print "\n............................................"
   else
      print "\n....Exiting program without creating scripts"
      exit
   fi

fi


if [ ! -d $gendir/logs ] ; then
#  echo "Directory "${gendir}/logs" does not exist"
   print "\nDirectory ${gendir}/logs does not exist"
   print "\nDirectory ${gendir}/logs needs to be created "
   ans=
   while [ -z $ans ]
   do
      echo -n "Create directory? ${gendir}/logs "
      read ans
   done
   if [[ $ans =~ ^[Yy]$ ]]
   then
      print "\n...Creating directory...."
#      mkdir ${gendir}/logs
#      mkdir ${gendir}/logs
      print "\n...Not Creating directory in test mode...."
   else
      print "\n...Not Creating directory...."
      print "\nExiting program"
      exit
   fi
else
   print "\nDirectory ${gendir}/logs exists"
   echo
   ls ${gendir}/logs

   ans=
   while [ -z $ans ]
   do
      echo -n "Do you wish to overwrite what is already generated? "
      read ans
   done

   if [[ $ans =~ ^[Yy]$ ]]
    then
      print "\n...Continuing..............................."
   else
      print "\n....Exiting program without creating scripts"
      exit
   fi

   ans=
   while [ -z $ans ]
   do
      echo -n "Proceed to script creation? "
      read ans
   done

   if [[ $ans =~ ^[Yy]$ ]]
    then
      print "\n............................................"
   else
      print "\n....Exiting program without creating scripts"
      exit
   fi

fi

pauseit
clear
}




cr_hst_crontab ()
{
############################################################################
# Create the crontab entries
############################################################################

echo "...Creating crontab file entries......."
echo > crontab_${db_assn_name}.txt
cat << EOS >> crontab_${db_assn_name}.txt
Text goes here
EOS
}


cr_sysctl ()
{
echo "...Creating sysctl.conf recommendations......."
####################################################################################################
# Create the cr_<database name>_dbca.ksh script /oracle/admin/scripts/rspfiles
####################################################################################################
# echo > cr_${host_name}_sysctl.ksh
cat << EOS > cr_${host_name}_sysctl.conf
#!/bin/ksh
############################################################################
# Script Name..:
# Description..:
# Author.......: $auth
# Date.........: $use_date
# Version......:
# Modified By..:
# Date Modified:
# Comments.....:
# Schema owner.:
#              : alter session set current should be used to change schemas
# Login User...:
# Run Order....:
# Dependent on.:
# Script type..:
############################################################################

# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
# Kernel sysctl configuration file for Red Hat Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 1

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
net.ipv4.icmp_echo_ignore_broadcasts = 1
net.ipv4.icmp_ignore_bogus_error_responses = 1
net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.all.log_martians = 0
net.ipv4.conf.default.log_martians = 0
net.ipv4.tcp_keepalive_time = 3600
kernel.panic_on_oops = 1
kernel.panic = 5
#ORACLE CONFIG
#fs.aio-max-nr = 1048576
fs.aio-max-nr = 3145728
kernel.shmmax = 17179869184
kernel.shmmni = 4096
kernel.shmall = 8388608
#kernel.sem = 250 32000 100 128
kernel.sem = 250 64000 100 256
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
net.ipv4.tcp_rmem = 4194304 4194304 4194304
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.ip_local_port_range = 1024 65000
vm.swappiness = 0
vm.dirty_background_ratio = 3
vm.dirty_ratio = 15
vm.dirty_expire_centisecs = 500
vm.dirty_writeback_centisecs = 100
vm.hugetlb_shm_group = 0
vm.nr_hugepages = 2048
net.ipv4.ip_local_port_range = 9000 65500
fs.file-max = 6815744

EOS

# Move previous file to the correct directory
# cp cr_${db_assn_name}_dbca.ksh /oracle/admin/scripts/rspfiles

}


ck_cls ()
{

############################################################################
# This will check the cluster
############################################################################

if [[ "$database_id" = "Database Not In APEX" ]]; then
   ans=
   while [ -z $ans ]
   do
      echo
      echo -n "Add database record to APEX? "
         read ans
   done
   if [[ $ans =~ ^[Yy]$ ]]
   then
      echo
      print "\n....Adding APEX database record....."

${ORACLE_HOME}/bin/sqlplus -s $UsrPwd2@$BRAIN1D <<EOF
      insert into dba01.database
         (DB_ID,
          DB_NM,
          DB_DSCR,
          DB_CRT_DT,
          DB_UNQ_NM)
      values
         (DB_ID.NEXTVAL,
          '$db_assn_name',
          'Database added by DBAdmin ddl_create please update columns ',
          sysdate,
          '$db_assn_nm');
      commit;
EOF
      print "\n....APEX database record added....."
database_id=`${ORACLE_HOME}/bin/sqlplus -s $UsrPwd2@$BRAIN1D <<EOF
        set head off feed off pages 0 trimspool on
        select DB_ID from dba01.database where DB_NM='$db_assn_name';
        exit;
EOF`
        echo $database_id
   else
      echo
      print "\n....Continuing without adding record to APEX........."
      # exit
   fi
fi


# Check to see if the directory to generate the files exists
############################################################################
if [ ! -d $gendir ] ; then
   print "\nDirectory ${gendir} does not exist"
   print "\nDirectory ${gendir} needs to be created "
   ans=
   while [ -z $ans ]
   do
      echo -n "Create directory? ${gendir} "
      read ans
   done
   if [[ $ans =~ ^[Yy]$ ]]
   then
      print "\n...Creating directory...."
      mkdir ${gendir}
      mkdir ${gendir}/scripts
   else
      print "\n...Not Creating directory...."
      print "\nExiting program"
      exit
   fi
else
   print "\nDirectory ${gendir} exists"
   echo
   ls ${gendir}/scripts

   ans2=
   while [ -z $ans2 ]
   do
      echo -n "Do you wish to overwrite what is already generated? "
      read ans2
   done

   if [[ $ans2 =~ ^[Yy]$ ]]
    then
      print "\n...Continuing..............................."
   else
      print "\n....Exiting program without creating scripts"
      exit
   fi


   ans2=
   while [ -z $ans2 ]
   do
      echo -n "Proceed to script creation? "
      read ans2
   done

   if [[ $ans2 =~ ^[Yy]$ ]]
    then
      print "\n............................................"
   else
      print "\n....Exiting program without creating scripts"
      exit
   fi

fi

gendir=${gendir}/scripts

echo " "
echo " "


# You can bale out here for whatever reason
#########################################################################
ans=
while [ -z $ans ]
do
   echo -n "Really Proceed with script creation ? "
      read ans
done
if [[ $ans =~ ^[Yy]$ ]]
then
   print "\n....Creating scripts....."
else
   print "\n....Exiting program without creating scripts"
   exit
fi
############################################################################

############################################################################
# Create the directory /oracle/admin/<database name>/scripts
#
# Create the directory for this to all go into
# mkdir -p /oracle/admin/$db/scripts
# mkdir -p /oracle/admin/$db/scripts/logs
# cd /oracle/admin/scripts/mrc/ddltest/$appabrl
# /oracle/admin/scripts/mrc/ddltest/testddlcr
############################################################################

print "\n.....Changing to directory ${gendir} "
cd ${gendir}
}



cr_tmplt ()
{
echo "...Creating template file......."
# Create the
############################################################################
echo > template.ksh
cat << EOS >> template.ksh

EOS
}

function next_menu
{
echo
echo "# ----------------------------------------------------------------------- #"
echo "[ ...  Press any key to continue ... ]"
read next
}

test sql

connect / as sysdba
spool moreinfo.log
col username format a15
col account_status format a20
select username, account_status from dba_users
where username = ‘ANONYMOUS’;
set long 100000 pagesize 0
select XDBUriType(‘/xdbconfig.xml’).getXML() from dual;
spool off