Kali linux penetration test study notes-kali linux installation

Kali linux penetration test study notes-kali linux installation

I wrote a blog a long time ago,,,, after thinking about it, let’s post it


Hard disk installation, virtual machine installation

Hard disk installation:

  • Download and install the mirror
    https://www.kali.org/downloads/
  • Verify hash value: verify that the downloaded image file is complete
  • Make bootable CD
    live
  • Make a bootable USB flash drive: prepare a USB flash drive larger than 4G, and use the unetbootin tool
  • Set the BIOS boot sequence
  • Start the installation

DOCKER:

  • Virtualization and Docker
  • kali Docker image:
    http://www.kali.org/news/official-kali-linux-docker-images/
    http://github.com/offensive-security/kali-linux-docker

Virtual machine installation:

  • The official VM image seems to be available after downloading (I didn’t try):
    http://www.offensive-security.com/kali-linux-vmware-arm-image-download/
  • vmware workstation
  • virtualbox
    -download, install, expand tools, basic use
    -win8 system needs to uninstall a patch (kb3045999) to run
    -install kali: see the detailed installation process at the back of this blog
    -install tools: see the detailed installation process at the back of this blog

The detailed installation process of virtualbox kali (iso file installation):

First go to the official website to download the virtualbox, and download the expansion pack:
Insert picture description here
Install the expansion pack:
Insert picture description here
click on the new virtual machine, and select the corresponding option: the
Insert picture description here
next step is to allocate the memory size, it is recommended to run 4G, 4G, my computer is not good, just Two Gs are given:
Insert picture description here
Continue to the next step. If you have a virtual hard disk file, you can choose the third option:
Insert picture description here
I am using the default option VDI: The
Insert picture description here
next step is to set the hard disk size, preferably 25G or more, otherwise it may appear later System installation error:
Insert picture description here
Next, proceed to the installation of the ios file. First add:
Insert picture description here
click run, select graphical installation, or select character installation install, depending on your choice:
Insert picture description here
choose the language you use, and also your personal hobbies. ,,,
Insert picture description here
Choose country, China! ! ! !
Insert picture description here
Chinese! ! ! ! ! !
Insert picture description here
Take the host name whatever you want! ! ! Next step ~
Insert picture description here
If the domain name is available, fill in, if not, continue,,,,
Insert picture description here
set the password, for safety, set a little more complicated as possible.
Insert picture description here
Next, generally choose the wizard to assign:
Insert picture description here
Next,,,,
Insert picture description here
Next,,,,, ,
Insert picture description here
Or the next step,,,,,
Insert picture description here
choose yes,,, next step: the
Insert picture description here
installation time is a bit long, and then enter this step:
Insert picture description here
next step: the
Insert picture description here
next step installation duration may be longer:
Insert picture description here
next step: the
Insert picture description here
next step is a manual, a dev , Select dev,,,,, I
forgot to take a screenshot here,,,,,
After proceeding, it will show that it can be restarted, and then continue to the next step:
Insert picture description here
The installation is complete:
Insert picture description here

Virtualbox kali Tools installation detailed process

First check whether the linux header has been installed~~ If you
don’t have it, you need to update: apt-get update
Insert picture description here
Continue:
Insert picture description here
Then you can see that there is a CD, and then drag this file to the desktop:
Insert picture description here
Then cd to the desktop in the terminal~~
Check that VBoxLinuxAddidions.run has no execution permission,
through chmod Give it permission, green means it is an executable file.
Insert picture description here
Execution file:
Insert picture description here
restart, ok! !
note:
Insert picture description here

Persistent encrypted USB installation

Persistent encrypted USB installation (the installation process description is slightly rough, there is no picture, record the process):

  • LUKS: An excellent encryption standard for linux Unified Key Setup! ! !
    1. Disk partition encryption specification
    2. Disk-level encryption that does not depend on the operating system
    3. Window——DoxBox
    4. Back-end: dm-crypt
    5. Front-end: cryptsetup
    6. Microsoft bitlocker

  • Burn the image to a USB flash drive.
    First make a live USB flash drive.
    Since you are operating in a virtual machine, you need to let the virtual machine load the USB flash drive.
    Use the GParted tool in the system tool to
    enter the USB flash drive into this directory under /dev/sdb , Uninstall first, then delete ~~ Then exit the tool and
    copy the iso file to the desktop and
    run dd on the console if=kali-linux-1.1.0-amd64.iso of=/dev/sdb bs=1M based on block and file Copy
    (note that the file name is different) Use watch -n 5 killall -USR1 dd to view the progress of dd copying~~

  • To create an additional partition for the U disk, use the parted command! !

root@kali:~# parted
GNU Parted 3.2
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print devices       查看设备
                                             
/dev/sda (32.2GB)
/dev/sdb (31.0GB)
(parted) select /dev/sdb                                                  
Using /dev/sdb

(parted) print     查看当前分区
                                                       
Model: Kingston DataTraveler 3.0 (scsi)
Disk /dev/sdb: 31.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.8kB  3352MB  3352MB  primary               boot, hidden
 2      3352MB  3353MB  754kB   primary

(parted) mkpart primary 3353 7353    创建新的分区,4个G
                                             
(parted) print         
                                                   
Model: Kingston DataTraveler 3.0 (scsi)
Disk /dev/sdb: 31.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      32.8kB  3352MB  3352MB  primary               boot, hidden
 2      3352MB  3353MB  754kB   primary
 3      3353MB  7353MB  3999MB  primary               lba
  • Use LUKS to encrypt the partition
root@kali:~# cryptsetup --verbose --verify-passphrase  luksFormat  /dev/sdb3

WARNING!
========
这将覆盖 /dev/sdb3 上的数据,该动作不可取消。

Are you sure? (Type uppercase yes): YES
输入 /dev/sdb3 的口令:
确认密码:
Key slot 0 created.
命令成功。											
  • Open encrypted partition
root@kali:~# cryptsetup luksOpen /dev/sdb3 usb		//打开加密的分区
输入 /dev/sdb3 的口令:
root@kali:~# ls /dev/mapper/usb
/dev/mapper/usb
  • Format encrypted partition + volume label
//格式化
root@kali:~# mkfs.ext4 /dev/mapper/usb 
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 975872 4k blocks and 244320 inodes
Filesystem UUID: 5b3261d7-f646-4796-9bbf-0dffe0db8438
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done 

//指定卷标
root@kali:~# e2label /dev/mapper/usb persistence
  • Mount the encrypted partition and create the persistence.conf file
root@kali:~# e2label /dev/mapper/usb persistence
root@kali:~# mkdir -p /mnt/usb
root@kali:~# mount /dev/mapper/usb  /mnt/usb
root@kali:~# echo "/ union" > /mnt/usb/persistence.conf
root@kali:~# umount /dev/mapper/usb
root@kali:~# cryptsetup luksClose /dev/mapper/usb
  • The USB installation with persistent encryption is now complete! ! !

Shared folder creation

Insert picture description here
Add settings:
Insert picture description here
OK!
Insert picture description here

Modify the font:

Insert picture description here

Familiar with BASH commands

Green means executable file, red means compressed file, blue means folder, white normal file

ls List the contents of the current directory, -l for viewing permissions, -a for viewing hidden files, -h for easy reading of file sizes
cd Enter a directory, the same as cd under windows
pwd View current working directory
cat View the content of text file, read the file from beginning to end, if the content is large, the reading time is long and it is not convenient
more View the content of the text type file, read the file from beginning to end, but when the current window is full, press Enter to check the following content, press q to exit
less Similar to more, except that the percentage will not be displayed
tail View the content of a text file, the last ten lines are displayed by default, tail -20 file name, you can view 20 lines
watch watch -n how often to execute the following commands
cp Copy files, similar to the copy command under Windows, add the -r parameter to the directory copy
rm Delete file, add -r parameter to delete directory
top Commands for monitoring Linux system performance, CPU information, number of users, process information, etc. are used frequently
ps Specially view the process information, usually use the -ef parameter to view more detailed information, the aux parameter column information is different
grep Only content with specific content is displayed in the view file (grep specific content file)
egrep Similar to grep, more advanced, -v filters out specific content
ifconfig View the current configuration information, ifconfig ech0 down, turn off the network card dwon, and start up
netstat View network connection information, generally use -pantu parameter
awk awk'{print $5}' displays the contents of the fifth column
cut Block, cut -d'characteristic characters'
sort Sort
uniq Only show once
mount A command to mount a directory
find Find a file or directory, find the directory -name needs to find the file name, -i is not case sensitive
whereis Find a file or directory, the search range is not as large as find, but it is faster than find, -b searches for binary files
echo Display certain information in the terminal window
we Text editor, :set nu displays the line number, :wq saves and exits, a powerful tool

Pipeline: Multiple commands can be executed on the same line (|,> (overwrite), >> (append))

shell script

  • Generally ask the suffix with .sh

The following is a simple shell, according to the input and display:

#!/bin/bash
echo -n "input your IP : "
read ip
echo "your ip is :" $ip

Insert picture description here
99 multiplication table:

#!/bin/bash
for i in `seq 9`
do
	for j in `seq $i`
	do
		echo -n "$i*$j="`expr $i \* $j`" "
	done
	echo
done

Insert picture description here
pingIP address:

#!/bin/bash
for i in `seq 254`
do
	ping 192.168.1.$i -c 1 | grep ttl | awk '{print $4}' | awk -F: '{print $1}'
done

Guess you like

Origin blog.csdn.net/qq_42967398/article/details/97697894