System Administration

This guide discusses how to Install and Use WPScan WordPress Vulnerability Scanner Ubuntu 18.04. WPScan, which is an acronym for WordPress Security Scanner, is a free black box vulnerability scanner written on Ruby programming language to help security professionals and blog maintainers to test the vulnerabilities on their WordPress sites. It helps unearth any vulnerability associated with WordPress themes, plugins, or any other security threat harbored on a WordPress site.

Installing WPScan Ubuntu 18.04

Prerequisites

Before you can install WordPress Security Scanner (WPScan), ensure that the following dependencies are installed.Also ensure that your system is up-to-date. This can be done by running the commands below;

sudo apt update
sudo apt upgrade
sudo apt install curl git libcurl4-openssl-dev make zlib1g-dev gawk g++ gcc libreadline6-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config ruby ruby-bundler ruby-dev -y

WPScan can either be installed fron RubyGem repositories or from sources. The former is simpler as it involves a one line command.

 

Install from RubyGem

To install WPScan from RubyGem repositories, run the command below;

gem install wpscan

You can at the same time uninstall WPScan by running the command;

gem uninstall wpscan

Install WPScan Sources

To install WPScan from sources, you first need to its Github repository.

git clone https:gem//github.com/wpscanteam/wpscan.git

Once the cloning is done, navigate to WPScan directory and run the commands below to do the installation.

cd wpscan/
bundle install
sudo rake install

Do you have patience? If you don’t, this is where might have to learn to have a little since it may take some few mins to complete the installation. If the installation is successful, you should see such an output.

...
  48) WPScan::Vulnerability behaves like WPScan::References references when references provided as array 
     # Temporarily skipped with xit
     # ./spec/shared_examples/references.rb:45


Finished in 8 minutes 54 seconds (files took 15.12 seconds to load)
17914 examples, 0 failures, 48 pending

Coverage report generated for RSpec to $HOME/wpscan/coverage. 1709 / 2006 LOC (85.19%) covered.
wpscan 3.4.0 built to pkg/wpscan-3.4.0.gem.
wpscan (3.4.0) installed.

Well, WPScan is successfully installed on Ubuntu 18.04. To obtain a description of various command line options used with WPScan, run wpscan command with -h/--help option;

wpscan -h
_______________________________________________________________
        __          _______   _____
        \ \        / /  __ \ / ____|
         \ \  /\  / /| |__) | (___   ___  __ _ _ __ ®
          \ \/  \/ / |  ___/ \___ \ / __|/ _` | '_ \
           \  /\  /  | |     ____) | (__| (_| | | | |
            \/  \/   |_|    |_____/ \___|\__,_|_| |_|

        WordPress Security Scanner by the WPScan Team
                       Version 3.4.0
          Sponsored by Sucuri - https://sucuri.net
      @_WPScan_, @ethicalhack3r, @erwan_lr, @_FireFart_
_______________________________________________________________

Usage: wpscan [options]
        --url URL                                 The URL of the blog to scan
                                                  Allowed Protocols: http, https
                                                  Default Protocol if none provided: http
                                                  This option is mandatory unless update or help or hh or version is/are supplied
    -h, --help                                    Display the simple help and exit
        --hh                                      Display the full help and exit
        --version                                 Display the version and exit
    -v, --verbose                                 Verbose mode
        --[no-]banner                             Whether or not to display the banner
                                                  Default: true
    -o, --output FILE                             Output to FILE
    -f, --format FORMAT                           Output results in the format supplied
                                                  Available choices: cli-no-color, json, cli, cli-no-colour
        --detection-mode MODE                     Default: mixed
                                                  Available choices: mixed, passive, aggressive
        --user-agent, --ua VALUE
        --random-user-agent, --rua                Use a random user-agent for each scan
        --http-auth login:password
<output cut>

Go through the whole output to see various options that can be used with wpscancommand.

Scanning for Vulnerabilities

In this guide, we are going to show you a few examples on how to perform WordPress blog vulnerability scanning. Ensure that you run the examples below against your OWN blog. It is illegal to scan other people’s sites.

Scan the whole WordPress blog

wpscan --url wordpress.example.com

WPScan can scan both http and https protocols. If not specified, it will scan http by default.

If you want to save the scanner output results in a file, use the -o/--output option.

wpscan --url http://wordpress.example.com -o scan-test

There are three detection modes in which wpscan can run against a WordPress site; passiveaggressivemixed(default).

  • The passive mode runs a non-intrusive detection i.e it sents a few requests to the server. It commonly scans the home page for any vulnerability. The passive mode is less likely to be detected by IDS/IPS solutions.
  • The aggressive mode on the other hand performs a more intrusive scan as it sents a thousand request to the server. It tries all the possible plugins even if the plugin has no known vulnerabilities linked to it. This may result in an increased load on the target server.
  • The mixed(default) mode uses a mixture of both aggressive and passive.

To specify detection mode;

wpscan --url wordpress.example.com -o test --detection-mode aggressive

Check for Vulnerable Plugins

To scan for vulnerable plugins on your WordPress blog, pass the -e/--enumerate [OPTS]option to the wpscan command where [OPTS] can be; vp (vulnerable plugins)ap(all plugins)(plugins). For example to scan for every plugin which has vulnerabilities linked to it,

wpscan --url wordpress.example.com -e vp

Check for Vulnerable Themes

Just like we used the -e/--enumerate [OPTS] option to check for vulnerable plugins, the same can be done when checking for vulnerable themes with the [OPTS] being any of the following; vt (Vulnerable themes)at (All themes)(Themes). For example to scan for themes with known vulnerabilities;

wpscan --url wordpress.example.com -e vt

Enumerate WordPress Users

To find out the users that can login to WordPress site, you would pass the -e/--enumerate u option to wpscan where u basically means the user IDs.

wpscan --url wordpress.example.com -e u

Test for Password Strength/Bruteforce Attack against a WordPress User

Once you have enumerated the usernames, you can try to perform a brute-force attack again them as shown below. This process may be a bit slower depending on the number of passwords specified in the password file (-P, --passwords FILE-PATH) and number of threads (-t, --max-threads VALUE) you are using. For example to brute-force an admin,

wpscan --url wordpress.example.com -P password-file.txt -U admin -t 50

To test for password strength for multiple users, you would use the same command above this time round without the specific username specified.

wpscan --url wordpress.example.com -P password-file.txt -t 50

Run WordPress scan in undetectable mode

To run wpscan in a stealthy mode which basically means (--random-user-agent --detection-mode passive --plugins-version-detection passive), specify the --stealthyoption.

wpscan --url wordpress.example.com --stealthy

That is all about WPScan. Feel free to explore this useful tool.  We hope this article was helpful.

SOURCE: https://kifarunix.com/install-use-wpscan-wordpress-vulnerability-scanner-ubuntu-18-04/

ClamAV, an open source antivirus engine for detecting and removing trojans, viruses, malware and other threats can easily be installed on Ubuntu to help protect your systems… You don’t usually hear antivirus and Linux in the same sentence… however, in today’s environments, viruses and malicious threats can live anywhere…

 

This brief tutorial shows students and new users how to install ClamAV on Ubuntu 16.04 / 17.10 and 18.04 systems…

 

ClamAV is by design, versatile…. it supports multiple file formats and multiple signature languages that most viruses use to exploit systems… It performs multi-threaded scans, and include a command-line utility for on demand file scanning and signatures updates..

 

When you’re ready to install ClamAV, continue with the steps below

 

On Uubntu desktop, open your terminal by press the Ctrl — Alt — T keys on your keyboard… this should open the terminal…

 

When the terminal opens, type the commands below to install ClamAV

 

sudo apt install clamav clamav-daemon

 

Now that ClamAV is installed, you can use the command line terminal to scan for viruses and malware…. to test out, run the commands below to scan your home folder…

 

clamscan --infected --remove --recursive /home

 

You should get a summary after a successful scan…

 

----------- SCAN SUMMARY -----------

Known viruses: 6541075

Engine version: 0.99.4

Scanned directories: 136

Scanned files: 401

Infected files: 0

Data scanned: 63.20 MB

Data read: 43.88 MB (ratio 1.44:1)

Time: 23.938 sec (0 m 23 s)

To scan for infected files and folder on the entire sysstem, you can run the commands below

 

sudo clamscan --infected --remove --recursive /

 

For downloading Clamav virus definitions..

sudo freshclam

The PassivePorts directive is used in the file /etc/proftpd.conf to specify a passive ports range.

  1. Connect to the Plesk server via SSH.

  2. Create /etc/proftpd.d/55-passive-ports.conf file using the following command:

    # touch /etc/proftpd.d/55-passive-ports.conf

  3. Edit file /etc/proftpd.d/55-passive-ports.conf in any text editor and place the content below as follows:

    <Global>
    PassivePorts 49152 65535 
    </Global>

    Note: Remove PassivePorts directive from /etc/proftpd.conf file if the directive is defined inside.

  4. Specify ports in /etc/proftpd.d/* files as well, if needed. See the ProFTPd documentation for more information regarding the PassivePorts directive.

  5. Next, the nf_conntrack_ftp module should be loaded into the system:

    # /sbin/modprobe nf_conntrack_ftp

    # lsmod | grep conntrack_ftp 
    nf_conntrack_ftp 13696 0 
    nf_conntrack 61684 1 nf_conntrack_ftp

  6. If Plesk Firewall is installed and enabled, specify the port range according to the KB article Unable to connect to FTP in passive mode.

    If another firewall is used to manage iptables rules, use it to allow the passive ports range.

    Otherwise, make sure that the following line exists in the iptables settings:

    # iptables -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

  7. If a server is behind the NAT, the nf_nat_ftp module should be loaded:

    # /sbin/modprobe nf_nat_ftp

    In case if FirewallD on CentOS 7 is installed, NAT modules should be added into /etc/modules-load.d/iptables.conf

    # echo nf_nat_ftp >> /etc/modules-load.d/iptables.conf
    # echo nf_conntrack_ftp >> /etc/modules-load.d/iptables.conf

    Note: the action which involves kenel modules configuration should be performed on the barebone hardware or in the virtual machine with full hardware emuation.
    It the container is used, the same actions should be performed on a hardware node side.

  8. To keep the changes after a system reboot, the modules should be added to the IPTABLES_MODULES line in the file /etc/sysconfig/iptables-config as follows:

    # cat /etc/sysconfig/iptables-config | grep IPTABLES_MODULES
    IPTABLES_MODULES="nf_conntrack_ftp nf_conntrack ip_nat_ftp"

    Note: Because the FTP helper modules must read and modify commands being sent over the command channel, they will not work when the command channel is encrypted through use of TLS/SSL.

  9. If it is required to use TLS/SSL for FTP, the only way is to open required ports. Use Plesk Firewall extension for this, or add the rules using iptables:

    # iptables -I INPUT 2 -p tcp --match multiport --dports 49152:65535 -j ACCEPT
    # service iptables save

    Note: Ports should be opened on all firewalls in the network.

  10. Restart the xinetd service to apply changes:

    # service xinetd restart

From: https://support.plesk.com/hc/en-us/articles/213902285

 

Friday, 01 March 2019 21:23

(Plesk for Linux) Configuring Passive FTP Mode

Written by

By default, Plesk allows only active FTP connections. This may result in customers being unable to connect to the server via FTP. To avoid this, we recommend enabling passive FTP. This topic explains how to enable passive FTP mode in Plesk for Linux.

To enable passive FTP mode in Plesk for Linux:

  1. Log in to your server via SSH as the root user.
  2. Create the /etc/proftpd.d/55-passive-ports.conf file, add the following lines to it, and then save the changes:

    <Global>

    PassivePorts 49152 65535

    </Global>

  3. Run the following command:

    systemctl restart xinetd

Now your Plesk server accepts passive FTP connections. If you have installed the Plesk Firewall and switched on its default configuration, you need to add a firewall rule allowing passive FTP:

  • Direction: Incoming
  • Action: Allow
  • Ports: TCP 49152-65535
  • Sources: (any host)

 

Symptoms

Plesk server has IPv6 address. When an email message is sent from the server to a Gmail account it fails to deliver.

In /usr/local/psa/var/log/maillog on Linux or in C:\Program Files (x86)\Parallels\Plesk\Mail Servers\Mail Enable\Logging\SMTP\SMTP-Debug.log on Windows the following error appears:

ipv6_failed_after_I_sent_the_message./Remote_host_said:_550-5.7.1_[ipv6______16]_Our_system_has_detected_that_this/550-5.7.1_message_does_not_meet_IPv6_sending_guidelines_regarding_PTR_records/550-5.7.1_and_authentication._Please_review/550-5.7.1_https://support.google.com/mail/?p=ipv6_authentication_error_for_more/550_5.7.1_information._hg7si388602wjb.61_-_gsmtp/

Wednesday, 09 May 2018 21:07

How to install ioncube loader in Ubuntu 16.04?

Written by

1. Download the necessary archive and unpack it:

# wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.zip

# unzip ioncube_loaders_lin_x86-64.zip

 

2. Find the extension directory:

# php -i | grep extension_dir

extension_dir => /usr/lib/php/20151012 => /usr/lib/php/20151012

 

Make sure and checked the following: 

mail preferences -> viewing -> And check "display unread messages with bold font"? 

also, this may help: Try to "rebuild" mailbox (in this case the inbox)? 

Why not try to "disable" mail? or delete its' preference file? 

Wednesday, 10 January 2018 21:39

SPF record, preventing mailing spam

Written by

What is a SPF record?

The Sender Policy Framework (SPF) is an anti-spam system built on top of the existing DNS and Email Internet Infrastructure.

Spammers were impersonating domains to make offers look like they were coming from Amazon or other reputable places, but when you would click through they’d steal your credit card and run up a bill at the local Chuck E Cheese (which is where I presume mob members go to eat).

What does a SPF record do?

An SPF record defines which IP addresses are allowed to send email on behalf of a particular domain. This is tricker than it sounds as many companies have multiple different Email Service Providers for different purposes.

Common different uses:

Transactional emails from mailing systems

Internal notifications

Internal email

External email

PR/Marketing emails

Further complicating the situation is that while a company might have a name like SafeEmailSender, there is nothing stopping them from having an email sending domain like wookie-fighter.com.

What does a SPF record prevent?

Having strict SPF rules allows you to control who can send email on behalf of your domain. A good way to think of this is the reverse: who would gain by sending email on behalf of your domain.

See SPF record examples

http://www.openspf.org/SPF_Record_Syntax

On Linux mailboxes are stored in directory specified in value to parameter PLESK_MAILNAMES_D in configuration file /etc/psa/psa.conf. By default the path is /var/qmail/mailnames (for both Qmail and Postfix). 

Thursday, 02 February 2017 21:23

Disable Spam Assassin Centos

Written by

chkconfig spamassassin off