Kali Linux 2022.3
基本信息确认
查看内核版本
uname -a
查看操作系统版本号
lsb_release -a
查看gcc版本
gcc -v
cat /proc/version
查看python版本
python
┌──(kali㉿kali)-[~]
└─$ cat /proc/version
Linux version 5.18.0-kali5-amd64 (devel@kali.org) (gcc-11 (Debian 11.3.0-3) 11.3.0, GNU ld (GNU Binutils for Debian) 2.38) #1 SMP PREEMPT_DYNAMIC Debian 5.18.5-1kali6 (2022-07-07)
┌──(kali㉿kali)-[~]
└─$ uname -a
Linux kali 5.18.0-kali5-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.5-1kali6 (2022-07-07) x86_64 GNU/Linux
┌──(kali㉿kali)-[~]
└─$ lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2022.3
Codename: kali-rolling
┌──(kali㉿kali)-[~]
└─$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 11.3.0-5' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-VvtjMP/gcc-11-11.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-VvtjMP/gcc-11-11.3.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Debian 11.3.0-5)
┌──(kali㉿kali)-[~]
└─$ python
Python 3.10.5 (main, Jun 8 2022, 09:26:22) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
可以看出Kali Linux 2022.3是自带gcc的,version 11.3.0 (Debian 11.3.0-5)
如果需要其他版本,可以去官网下载
用命令行安装,详细步骤可以参考 kali2021.2配置pwn环境(gdb+pwntools)
wget http://ftp.gnu.org/gnu/gdb/gdb-12.1.tar.gz
tar -zxvf gdb-12.1.tar.gz
cd gdb-12.1
./configure --with-python='/usr/bin/python3.10' //根据python的具体版本进行修改
make
sudo make install
pwntools
pwntools从名字上看像是在解PWN题目使所用的工具,基于Python的,就是Python中的一个库,但是这个库很强大,里面包含了很多方法,比如连接可执行文件,进行读写通信,还可以生成shellcode以及将ams转化为shellcode。
所需环境
下面描述参考kali下python安装pwntools工具,但年代久远,部分内容不合适已经删除
kali Linxu 注意操作系统位数,最好X64的,因为在X32下会有些函数用不了。
Python环境
pip工具
基于上一章内容,以上操作系统和python环境都支持,并且pip也是预安装的。
接下来直接安装pwntools.,等待下载,结束。
安装命令
┌──(kali㉿kali)-[~]
└─$ pip install pwntools
测试
┌──(kali㉿kali)-[~]
└─$ python
Python 3.10.5 (main, Jun 8 2022, 09:26:22) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwn
>>> pwn.asm("xor eax, eax")
b'1\xc0'
>>>
测试通过!
参考
kali linux查看系统版本、内核
kali2021.2配置pwn环境(gdb+pwntools)
kali下python安装pwntools工具