Quy Trình Set Up Kali Cho Penetration Tester
robinhood (Whitehat)
------------------------------------------------------------------------------
Tạo ra một OVA file và một Live CD (USB) mang theo mỗi khi pen test,
Lưu ý 1: máy Kali chưa cài bất cứ một phần mềm nào khác.
Lưu ý 2: xếp các tools download vào /opt/ cho dễ quản lý
1.Đổi default password (nếu bạn download VM từ Internet)
passwd
2.Update:
apt-get update
apt-get dist-upgrade
3.Set up Metasploit database
service postgresql start
update-rc.d postgresql enable
msfdb init
4.Đổi hostname
gedit /etc/hostname => đổi tên Kali thành tên nào khác. Mình hay dùng android-xxxxx…
gedit /etc/hosts => đổi tên kali thành tên bạn chọn phía trên
reboot
Cài tools:
1.Veil-Evasion: tool dùng để tạo payload
apt-get install veil-evasion
2.Backdoor Factory: tool này được cài sẵn trong Kali, nếu bạn nào chưa có thì có thể cài bằng command sau:
apt-get install backdoor-factory
3.HTTPScreenShot: tool này dùng để chụp screenshot cho một lượng lớn các website cùng lúc. Quy trình cài đặt:
pip install selenium
git clone https://github.com/breenmachine/httpscreenshot.git /opt/httpscreenshot
cd /opt/httpscreenshot
chmod +x install-dependencies.sh
./install-dependencies.sh
Nếu bạn dùng Kali 32-bit thì phải google để tìm hướng dẫn cách cho HTTPScreenshot hoạt động sau những bước trên.
4.SMBExec: môt tool dùng để tấn công vào các SMB service với cách thức tương tự như PSExec cho PowerShell. Quy trình cài đặt:
git clone https://github.com/pentestgeek/smbexec.git /opt/smbexec
cd /opt/smbexec
./install.sh
Chọn 1
./install.sh
Chọn 4
Chọn 5 để kết thúc.
5.Masscan: là một port scanner mà mình nghĩ là nhanh nhất hiện nay. Tool này được cài đặt sẵn trong Kali.
apt-get install masscan
6.Gitrob: một tool dùng để scan các Git repo của các công ty (Github, Gitlab). Tool này cần phải set up database cho nó. Quy trình cài đặt:
git clone https://github.com/michenriksen/gitrob.git /opt/gitrob
gem install bundler
service postgresql start
su postgres
createuser -s gitrob --pwprompt
Nhập password
createdb –O gitrob gitrob
exit
cd /opt/gitrob/bin
gem install gitrob
7.CMSmap: tool dùng để scan website. Mình thấy rất hữu dụng khi scan WordPress framework. Quy trình cài đặt:
git clone https://github.com/Dionach/CMSmap /opt/CMSmap
8.WPScan: tool dùng để scan các website dùng WordPress framework
apt-get install wpscan
9.Eyewitness: tool dùng để chụp screenshot và server header
apt-get install eyewitness
10.Praedasploit: tool dùng để khai thác các lỗ hỗng của các printer phổ biến như HP, Dell, Canon, Xerox
git clone https://github.com/MooseDojo/praedasploit /opt/praedasploit
11.SQLMap: tool để khai thác các lỗ hổng trong SQL database. Tool này được cài đặt sẵn trong Kali.
apt-get install sqlmap
12.Recon-ng: một tool rất hữu ích cho giai đoạn gathering information. Tool này được cài đặt sẵn trong Kali
apt-get install recon-ng
13.Discover Script: tool này theo mình thấy là hữu dụng nhất trong giai đoạn gathering information. Mình dùng cái này nhiều nhất. Quy trình cài đặt:
git clone https://github.com/leebaird/discover.git /opt/discover
cd /opt/discover/
./update.sh
14.BeEF: tool dùng cho XSS
apt-get install beef
15.Responder: dùng cho NTLM challenge/response hashes
apt-get install responder
16.Một vài script hữu dụng từ cuốn The Hacker Playbook:
git clone https://github.com/cheetz/Easy-P /opt/Easy-P
git clone https://github.com/cheetz/Password_Plus_One /opt/ Password_Plus_One
git clone https://github.com/cheetz/PowerShell_Popup /opt/PowerShell_Popup
git clone https://github.com/cheetz/icmpshock /opt/icmpshock
git clone https://github.com/cheetz/brutescrape /opt/brutescrape
git clone https://github.com/cheetz/reddit_xss /opt/reddit_xss
17.DSHashed: tool dùng để extract user hashes
wget http://ptscripts.googlecode.com/svn/trunk/dshashes.py -O /opt/NTDSXtract/dshashes.py
18.Sparta: tool này được cài đặt sẵn trong Kali. Đây là tool có GUI nên tương đối dễ dùng.
apt-get install sparta
19.NoSQLMap: một tool dùng để khai thác các non-sql databases
git clone https://github.com/tcstool/NoSQLMap.git /opt/NoSQLMap
20.Spiderfoot: tool để dò footprint của network các công ty. Quy trình cài đặt:
mkdir /opt/spiderfoot
cd /opt/spiderfoot
wget http://sourceforge.net/projects/spid...ar.gz/download
tar xvzf download
pip install lxml
pip install netaddr
pip install M2Crypto
pip install cherrypy
pip install mako
21.WCE: tool dùng để lấy password dạng cleartext. Các bạn có thể google để tìm chỗ download từ ampliasecurity.com. Tool này không dùng trên linux được mà chỉ dùng trên Windows, tuy nhiên bạn nên có tool này trong Kali để sau khi có được một meterpreter trên 1 máy Windows thì có thể upload tool này và chạy trên đó.
22.Mimikatz: một tool khác dùng để lấy password dạng cleartext. Tool này được cài sẵn trong Kali. Bạn cũng có thể tải một Windows version của tool này để dành giống như với WCE.
23.Social Engineering Toolkit: dùng cho social engineering attacks. Tool này được cài sẵn trên Kali.
apt-get install set
24.PowerSploit: PowerShell scripts cho post exploitation
apt-get install powersploit
25.Nishang: thêm PowerShell scripts
apt-get install nishang
26.Seclists: list các password dictionaries, fuzz lists
apt-get install seclists
27.Net-Creds: tool dùng để tìm username và password trong file PCAP. Quy trình cài đặt:
git clone https://github.com/DanMcInerney/net-creds.git /opt/net-creds
28.Các add-on cần có cho Iceweasel hoặc Firefox: web-developer, tamper-data, foxyproxy, user-agent-switcher
29.Nessus: một tool hàng đầu hiện nay để scan các điểm yếu của một network. Mình dùng Nessus Professional và Nessus Cloud ở office, nhưng mình sẽ hướng dẫn các bạn cài bản free Nessus Community.
Lưu ý: Nếu các bạn tạo một file OVA để dùng về sau thì không cài Nessus vào file OVA vì Nessus hoạt động dựa vào MAC Address khi bạn register. Sau khi deploy file OVA rồi hẵng cài Nessus.
cd /root/download
dpkg -i Nessus*[tab]
/etc/init.d/nessusd start
Mở browser lên và gõ vào https://127.0.0.1:8834
Tạo administrative username và password.
Click vào “Registering this scanner” sau đó chọn Register Now ở bản Nessus Home.
Các bạn điền thông tin vào, và một code sẽ được gửi tới email. Điền code đó vào local Nessus server
Đến đây là thành công. Sau đó dùng username và password đã tạo trước đó để đăng nhập và sử dụng Nessus.
30.Cài certificate cho Burp Suite: khi dùng Burp để scan hoặc spider website, bạn sẽ gặp tình trạng bị mắc kẹt với cái website dùng HTTPS. Thế nên trước khi dùng Burp, bạn cần phải cho Kali trust Burp như một proxy trong CA list.
Trên thanh địa chỉ gõ vào http://burp/
Click vào CA Certificate và chọn Save File
Vào Options của browser và chọn Preferences
Chuyển qua tab Advanced => Certificates => View Certificates
Chọn Import, browse tới file certificate mà bạn vừa download, xong click OK