<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Hardening on Janik von Rotz</title>
    <link>https://janikvonrotz.ch/tags/hardening/</link>
    <description>Recent content in Hardening on Janik von Rotz</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 29 Apr 2014 07:10:57 +0000</lastBuildDate>
    <atom:link href="https://janikvonrotz.ch/tags/hardening/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Install WPScan</title>
      <link>https://janikvonrotz.ch/2014/04/29/install-wpscan/</link>
      <pubDate>Tue, 29 Apr 2014 07:10:57 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2014/04/29/install-wpscan/</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is part of my &lt;a href=&#34;https://janikvonrotz.ch/your-own-virtual-private-server-hosting-solution/&#34;&gt;Your own Virtual Private Server hosting solution&lt;/a&gt; project.&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;Get the latest version of this article here: &lt;a href=&#34;https://gist.github.com/11214650&#34;&gt;https://gist.github.com/11214650&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;introduction&#34;&gt;Introduction&lt;/h1&gt;&#xA;&lt;p&gt;WPScan is a black box WordPress vulnerability scanner.&lt;/p&gt;&#xA;&lt;h1 id=&#34;requirements&#34;&gt;Requirements&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/13/deploy-ubuntu-server/&#34;&gt;Ubuntu server&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/25/install-ubuntu-development-libraries/&#34;&gt;libcurl4-gnutls-dev, libopenssl-ruby, libxml2, libxml2-dev, libxslt1-dev, ruby-dev&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/25/install-ubuntu-packages/&#34;&gt;Git&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/04/28/install-ruby-and-rubygems-with-rvm/&#34;&gt;Ruby and RubyGems with RVM&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;installation&#34;&gt;Installation&lt;/h1&gt;&#xA;&lt;p&gt;First clone the WPScan repository from GitHub.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;cd /usr/local/src/&#xA;sudo git clone https://github.com/wpscanteam/wpscan.git&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Now install the bundler gem.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo chown [current username]:[current username] wpscan/&#xA;cd wpscan/&#xA;gem install bundler&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Install the WPScan project with user priviliges.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;bundle install --without test&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Run a scan.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;ruby wpscan.rb --url [url]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h1 id=&#34;source&#34;&gt;Source&lt;/h1&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://github.com/wpscanteam/wpscan&#34;&gt;WPScan Github Repository&lt;/a&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>SSH and network hardening</title>
      <link>https://janikvonrotz.ch/2014/03/21/ssh-and-network-hardening/</link>
      <pubDate>Fri, 21 Mar 2014 18:19:12 +0000</pubDate>
      <guid>https://janikvonrotz.ch/2014/03/21/ssh-and-network-hardening/</guid>
      <description>&lt;p&gt;&lt;em&gt;This post is part of my &lt;a href=&#34;https://janikvonrotz.ch/your-own-virtual-private-server-hosting-solution/&#34;&gt;Your own Virtual Private Server hosting solution&lt;/a&gt; project.&lt;/em&gt;&lt;br&gt;&#xA;&lt;em&gt;Get the latest version of this article here: &lt;a href=&#34;https://gist.github.com/9346641&#34;&gt;https://gist.github.com/9346641&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;h1 id=&#34;requirements&#34;&gt;Requirements&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://janikvonrotz.ch/2014/03/13/deploy-ubuntu-server/&#34;&gt;Ubuntu server&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;instructions&#34;&gt;Instructions&lt;/h1&gt;&#xA;&lt;h2 id=&#34;ssh&#34;&gt;SSH&lt;/h2&gt;&#xA;&lt;p&gt;Change the default ssh port and disable root login&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo vi /etc/ssh/sshd_config&#xA;Set Port [custom ssh port number]&#xA;Set PermitRootLogin no&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Restart the ssh service&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo /etc/init.d/ssh restart&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Update firewall rules now to enable ssh connection with your custom port&lt;/p&gt;&#xA;&lt;p&gt;Reconnect your ssh host with the new port number&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;ssh -p [custom ssh port number] user@host&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;fail2ban&#34;&gt;Fail2Ban&lt;/h2&gt;&#xA;&lt;p&gt;Install Fail2Ban&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo apt-get install fail2ban&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Copy the configuration file&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Edit the config file&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo vi /etc/fail2ban/jail.local&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Make the following changes:&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[ssh]&#xA;port     = [custom ssh port number]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;And&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;[ssh-ddos]&#xA;enabled  = true&#xA;port     = [custom ssh port number]&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Finish editing and restart fail2ban service&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo service fail2ban restart&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;network&#34;&gt;Network&lt;/h2&gt;&#xA;&lt;p&gt;Edit the network configuration file&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;sudo vi /etc/sysctl.conf&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;p&gt;Paste the this configuration file to improve network security&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;#&#xA;# /etc/sysctl.conf - Configuration file for setting system variables&#xA;# See /etc/sysctl.d/ for additional system variables&#xA;# See sysctl.conf (5) for information.&#xA;#&#xA;&#xA;# Uncomment the next two lines to enable Spoof protection (reverse-path filter)&#xA;# Turn on Source Address Verification in all interfaces to&#xA;# prevent some spoofing attacks&#xA;net.ipv4.conf.default.rp_filter = 1&#xA;net.ipv4.conf.all.rp_filter = 1&#xA;&#xA;# Uncomment the next line to enable TCP/IP SYN cookies&#xA;net.ipv4.tcp_syncookies = 1&#xA;net.ipv4.tcp_max_syn_backlog = 2048&#xA;net.ipv4.tcp_synack_retries = 2&#xA;net.ipv4.tcp_syn_retries = 5&#xA;&#xA;# Do not accept ICMP redirects (prevent MITM attacks)&#xA;net.ipv4.conf.all.accept_redirects = 0&#xA;net.ipv6.conf.all.accept_redirects = 0&#xA;net.ipv4.conf.default.accept_redirects = 0 &#xA;net.ipv6.conf.default.accept_redirects = 0&#xA;&#xA;# Do not send ICMP redirects (we are not a router)&#xA;net.ipv4.conf.all.send_redirects = 0&#xA;net.ipv4.conf.default.send_redirects = 0&#xA;&#xA;# Do not accept IP source route packets (we are not a router)&#xA;net.ipv4.conf.all.accept_source_route = 0&#xA;net.ipv6.conf.all.accept_source_route = 0&#xA;net.ipv4.conf.default.accept_source_route = 0&#xA;net.ipv6.conf.default.accept_source_route = 0&#xA;&#xA;# Log Martian Packets&#xA;net.ipv4.conf.all.log_martians = 1&#xA;net.ipv4.icmp_ignore_bogus_error_responses = 1&#xA;&#xA;# Ignore ICMP broadcast requests&#xA;net.ipv4.icmp_echo_ignore_broadcasts = 1&#xA;&#xA;# Ignore Directed pings&#xA;net.ipv4.icmp_echo_ignore_all = 1&#xA;&lt;/code&gt;&lt;/pre&gt;</description>
    </item>
  </channel>
</rss>
