Info Security Memo
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org

Build Confidence

Focusing on Information Security 

Info Security Notes

Pen Test Lab - 1. Environment Setup

5/16/2021

0 Comments

 
Pen Test Lab - 1. Environment Setup

 This post is focusing on how to build a simple Pen test lab with a minimal effort and also it can provides enough practice opportunity.

It will be a series of posts for Pen Test lab since there are some typical Pen Test steps will be discussed and put into this lab as example. 


Topology




1. Set Up Environmet

1.1 VMware Workstation

You also can use ESXi / Virtual Box / Hyper-V to set up your virtual lab environment. 


1.2 Kali Linux

Download ISO image from https://ift.tt/1xv2Ev9 or download virtual machine from https://ift.tt/2D6en2N

The VM images have a default password of “kali/kali”

1.3 Metasploitable Linux 

Metasploitable is an intentionally vulnerable Linux virtual machine. This VM can be used to conduct security training, test security tools, and practice common penetration testing techniques. Download link: https://ift.tt/2jSrhGH

The default login and password is msfadmin:msfadmin.


2. Basic Configuration Environment


2.1 Network Settings Change

  • IP Change
    • Temporary Change (Immediately Take Into Effect):
ifconfig
ifconfig eth0 192.168.2.20/24 

  • Permanent Change:
    • DHCP
vim /etc/network/interfaces

auto eth0
iface eth0 inet dhcp
/etc/init.d/networking restart
networking service restart does not work, it will need a restart server (reboot). 
  • Static
vim /etc/network/interfaces


auto eth0
iface eth0 inet static
address 192.168.2.20
netmask 255.255.255.0
gateway 192.168.2.1

/etc/init.d/network restart

echo $? : echo $? will return the exit status of last command.

0 - executed successfully
1-255 - 

  • Gateway Change

route add default gw 192.168.2.1

  • DNS Change

echo nameserver 8.8.8.8 > /etc/resolv.conf

2.2 Enable Root Account and Enable SSH Remote Access

By default, in Kali version 2020+, root account is not allow to log in to system. Also SSHD service is disabled. 

  • change root password

sudo passwd root

  • change sshd configure file to allow root log in from remote ssh session
vim /etc/ssh/sshd_config

PermitRootLogin yes

  • Start SSHD service
/etc/init.d/ssh start

lsof -i :22
netstat -na | grep 22
  • Enable SSHD service in boot. 

update-rc.d ssh enable


2.3 Disable Screen Lock 

System - Power Management



2.4 Update && Upgrade

apt update -y && apt upgrade -y

  • apt-get upgrade will only upgrade currently-installed packages;
  • apt upgrade will upgrade currently-installed packages and install new packages pulled in by updated dependencies;
  • the various dist-upgrade and full-upgrade variants will upgrade currently-installed packages, install new packages introduced as dependencies, and remove packages which are broken by upgraded packages.
Command Upgrade Current Install New Remove Broken
apt-get upgrade Yes No No
apt upgrade Yes Yes No
apt-get dist-upgrade, apt full-upgrade etc. Yes Yes Yes

If update && upgrade is too slow, you might need to change your apt source to the one close to your location.

cp /etc/apt/sources.list /etc/apt/sources.list.bak

vim /etc/apt/sources.list

Choose from either "中科大kali Apt Source" or "阿里云kali Apt Source"

#中科大kali Apt Source
deb http://mirrors.ustc.edu.cn/kali sana main non-free contrib
deb http://mirrors.ustc.edu.cn/kali-security/ sana/updates main contrib non-free
deb-src http://mirrors.ustc.edu.cn/kali-security/ sana/updates main contrib non-free


#阿里云kali Apt Source
deb http://mirrors.aliyun.com/kali sana main non-free contrib
deb http://mirrors.aliyun.com/kali-security/ sana/updates main contrib non-free
deb-src http://mirrors.aliyun.com/kali-security/ sana/updates main contrib non-free

#kali Default Apt Source:
deb http://security.kali.org/kali-security/ sana/updates main contrib non-free
deb-src http://security.kali.org/kali-security/ sana/updates main contrib non-free

After configuration changed, use command "apt-get update" command to take it into effect. 


Snapshot your Kali VMware environment











via Blogger https://ift.tt/2RVY0O7
May 16, 2021 at 07:52AM Checkpoint, Threat Hunting
0 Comments



Leave a Reply.

    Categories

    All
    Architecture
    Blog
    Checkpoint
    Cisco
    Cloud
    CyberArk
    F5
    Fortigate
    Guardium
    Juniper
    Linux
    Network
    Others
    Palo Alto
    Qualys
    Raspberry Pi
    Security
    SIEM
    Software
    Vmware
    VPN
    Wireless

    Archives

    March 2024
    February 2024
    January 2024
    December 2023
    November 2023
    October 2023
    September 2023
    August 2023
    July 2023
    June 2023
    May 2023
    April 2023
    March 2023
    February 2023
    January 2023
    December 2022
    November 2022
    October 2022
    September 2022
    August 2022
    July 2022
    June 2022
    May 2022
    April 2022
    March 2022
    February 2022
    January 2022
    December 2021
    November 2021
    October 2021
    September 2021
    August 2021
    July 2021
    June 2021
    May 2021
    April 2021
    March 2021
    February 2021
    January 2021
    December 2020
    November 2020
    October 2020
    September 2020
    August 2020
    July 2020
    October 2019
    September 2019
    June 2019
    July 2018
    May 2018
    December 2017
    August 2017
    April 2017
    March 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    June 2015
    May 2015
    April 2015
    March 2015

    Print Page:

    RSS Feed

    Email Subscribe
Powered by Create your own unique website with customizable templates.
  • Blog
  • Sitemap
    • Categories
  • Contact
  • About
  • Resources
  • Tools
  • 51sec.org