์ƒˆ์†Œ์‹

์ธ๊ธฐ ๊ฒ€์ƒ‰์–ด

๐Ÿ“  Secure

WSL ์ด์šฉํ•ด ์œˆ๋„์šฐ์—์„œ Kali Linux ์‚ฌ์šฉ๋ฒ• ๋ฐ ์„ค์น˜(+ dbus-launch ์˜ค๋ฅ˜)

  • -
๋ฐ˜์‘ํ˜•

1. WSL ์„ค์น˜

Powershell์„ ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์œผ๋กœ ์—ด๊ณ  ํ•ด๋‹น ๊ตฌ๋ฌธ ์ž…๋ ฅ ํ›„ ์™„๋ฃŒ๋˜๋ฉด ์ปดํ“จํ„ฐ๋ฅผ ์žฌ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

์žฌ์‹œ์ž‘ ํ›„ ํŒŒ์›Œ์‰˜ ์ฐฝ์„ ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์œผ๋กœ ๋‹ค์‹œ ์—ด์–ด ํ•ด๋‹น ๊ตฌ๋ฌธ์„ ์ž…๋ ฅ ํ›„ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค.

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

์ปดํ“จํ„ฐ๋ฅผ ์žฌ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค.

 

2. ์นผ๋ฆฌ ๋ฆฌ๋ˆ…์Šค ์„ค์น˜ ๋ฐ WSL ์„ธํŒ…

Microsoft Store์—์„œ 

์นผ๋ฆฌ ๋ฆฌ๋ˆ…์Šค ์„ค์น˜ ํ›„ ์—ด๊ธฐ๋ฅผ ๋ˆŒ๋Ÿฌ์ค๋‹ˆ๋‹ค. "์—ด๊ธฐ"๋ฅผ ๋ˆŒ๋Ÿฌ์„œ ์„ค์น˜๊นŒ์ง€ ํ•ด์•ผ ์นผ๋ฆฌ๋ฆฌ๋ˆ…์Šค ์„ค์น˜๊ฐ€ ์™„๋ฃŒ๋œ ๊ฒƒ ์ž…๋‹ˆ๋‹ค.

์„ค์น˜ ํ›„ ํŒŒ์›Œ์‰˜ ์ฐฝ์„ ์—ด๊ณ  ํ•ด๋‹น ๊ตฌ๋ฌธ์„ ์‹คํ–‰ ํ•ฉ๋‹ˆ๋‹ค.

wsl --set-default-version 2

๊ทธ๋ฆฌ๊ณ  ์•„๋ž˜ ๋งํฌ๋ฅผ ๋ˆŒ๋Ÿฌ Linux ์ปค๋„ ์—…๋ฐ์ดํŠธ ํŒจํ‚ค์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œ ํ•˜์—ฌ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค.

https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

 

์นผ๋ฆฌ์™€ WSL ์„ค์น˜ ์™„๋ฃŒ

 

ํŒŒ์›Œ์‰˜ ์ฐฝ์„ ์—ด๋ฉด wsl -l(์†Œ๋ฌธ์ž ์—˜) -v๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์„ค์น˜๋œ ๋ฐฐํฌํŒ ๋ฆฌ์ŠคํŠธ ํ™•์ธ ๊ฐ€๋Šฅ

์นผ๋ฆฌ ๋ฆฌ๋ˆ…์Šค ์‹คํ–‰์€ wsl -d kali-linux๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

 

3.  wsl ๊ฐ€์ƒ๋จธ์‹ ์— ๋ฆฌ์†Œ์Šค ์ œํ•œ ์„ค์ •๋ฒ•

wsl -l -v	#running ์ค‘์ธ ๊ฐ€์ƒ๋จธ์‹ ์„ ํ™•์ธ
wsl --shutdown all	#๊ฐ€์ƒ๋จธ์‹  ๋ชจ๋‘ shut down
notepad $env:USERPROFILE\.wslconfig	#์ƒˆ๋กœ์šด ์„ค์ • ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ
--wslconfig ํŒŒ์ผ

[wsl2]
#kernel=<path>	# An absolute Windows path to a custom Linux kernel.
memory=6G	# How much memory to assign to the WSL2 VM.
#processors=<number>	# How many processors to assign to the WSL2 VM.
#swap=<size>	# How much swap space to add to the WSL2 VM. 0 for no swap file.
#swapFile=<path>	# An absolute Windows path to the swap vhd.
#localhostForwarding=<bool>	# Boolean specifying if ports bound to wildcard or localhost in the WSL2 VM should be connectable from the host via localhostport(default true).

# <path> entries must be absolute Windows paths with escaped backslashes, for example C:\\Users\\Ben\\kernel
# <size> entries must be size followed by unit, for example 8GB or 512MB

 

4. kex๋กœ GUI ํ™˜๊ฒฝ ๊ตฌ์ถ•

GUI ํ™˜๊ฒฝ์ด ํ•„์š”ํ•  ๊ฒฝ์šฐ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•˜๋‹ค.

 

ํŒŒ์›Œ์‰˜์—์„œ ์นผ๋ฆฌ ๋ฆฌ๋ˆ…์Šค์— ์—ฐ๊ฒฐํ•ฉ๋‹ˆ๋‹ค.

wsl -d kali-linux
(์—ฐ๊ฒฐ ๋Š์„๋• exit)

 

์นผ๋ฆฌ์— ์—ฐ๊ฒฐํ•œ ์ƒํƒœ์—์„œ ์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค.

sudo apt update && sudo apt upgrade	# admin ๊ถŒํ•œ์œผ๋กœ apt ์—…๋ฐ์ดํŠธ์™€ ์—…๊ทธ๋ ˆ์ด๋“œ
sudo apt install kali-win-kex	# kex ์„ค์น˜
kex --win -s	# ์นผ๋ฆฌ๋ฅผ ํ’€ ์Šคํฌ๋ฆฐ์œผ๋กœ GUI ์ฐฝ์„ ๋„์šฐ๋Š” ๋ช…๋ น์–ด f8์„ ๋ˆ„๋ฅด๋ฉด ํ’€์Šคํฌ๋ฆฐ ํ•ด์ œ ๊ฐ€๋Šฅ
kex --sl -s		# Seamless ๋ชจ๋“œ๋กœ ์นผ๋ฆฌ๋ฅผ ์‹คํ–‰ํ•˜๋Š” ๋ช…๋ น์–ด. ์œˆ๋„์šฐ UI์ƒ์— ์นผ๋ฆฌ๊ฐ€ ์ƒ๋‹จ์— ํ•จ๊ป˜๋œจ๋ฉฐ ์œˆ๋„์šฐ์™€ ์นผ๋ฆฌ ๋™์‹œ์— ์‚ฌ์šฉ๊ฐ€๋Šฅ
wsl --shutdown	# ์นผ๋ฆฌ ์ข…๋ฃŒ ๋ช…๋ น์–ด

 

 

 

[๋ณด์•ˆ๋ถ„์„] WSL์„ ์ด์šฉํ•˜์—ฌ ์œˆ๋„์šฐ์—์„œ Kali Linux ์‚ฌ์šฉํ•˜๊ธฐ

์ €๋Š” Kali linux๋ฅผ ์ž์ฃผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ž์ฃผ ์‚ฌ์šฉํ•˜๋Š” Pentest ํŒจํ‚ค์ง€ ๊ตฌ์„ฑ์ด ์ž˜๋˜์–ด์žˆ๊ณ  ์„ค์น˜๊ฐ€ ์‰ฌ์›Œ ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๋ณดํ†ต ์œˆ๋„์šฐ OS์— Hyper-V๋ฅผ ์„ค์น˜ํ•˜์—ฌ Kali linux ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด๋กœ๋“œํ•˜์—ฌ VM์œผ๋กœ ๋„์›Œ์„œ ์‚ฌ

goldb.tistory.com

 

 

[๋ณด์•ˆ๋ถ„์„] Kali Linux ํŒจํ‚ค์ง€ ์„ค์น˜ ๋ฐฉ๋ฒ•

WSL๋กœ Kali Linux๋ฅผ ์„ค์น˜ํ•˜๊ฒŒ๋˜๋ฉด ํŒจํ‚ค์ง€๊ฐ€ ์—†๋Š” ์ˆœ์ˆ˜ OS๋งŒ ์„ค์น˜๋ฉ๋‹ˆ๋‹ค. ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ๋‘๊ฐ€์ง€ ๋ฐฉ๋ฒ•์ด ์žˆ์œผ๋ฉฐ Kali Linux๊ฐ€ ์ •์˜ํ•œ ๋ฉ”ํƒ€ํŒจํ‚ค์ง€ ์„ธํŠธ๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๊ณ  ์‚ฌ์šฉํ•  ํŒจํ‚ค์ง€

goldb.tistory.com

 

์›๊ฒฉ ๋ฐ์ŠคํŠธ์ฝฅ ์—ฐ๊ฒฐ๋กœ ํ™•์ธํ•œ kali-linux ip๋ฅผ ์ž…๋ ฅ ํ›„ ์—ฐ๊ฒฐ ์‹œ๋„ํ•œ๋‹ค.

Unable to contact settings server

Failded to execute child process "dbus-launch" (No such file or directory)

dbus-launch ์˜ค๋ฅ˜๊ฐ€ ๋œจ๋Š”๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

apt install dbus-x11

ํ•ด๋‹น dbus๋ฅผ ์„ค์น˜ ํ›„ ๋‹ค์‹œ ์ ‘์†ํ•˜๋ฉด ์ ‘์†์ด ์ž˜ ๋˜๋Š”๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

๋ฐ˜์‘ํ˜•
Contents

ํฌ์ŠคํŒ… ์ฃผ์†Œ๋ฅผ ๋ณต์‚ฌํ–ˆ์Šต๋‹ˆ๋‹ค

์ด ๊ธ€์ด ๋„์›€์ด ๋˜์—ˆ๋‹ค๋ฉด ๊ณต๊ฐ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค.