nknskn ネタ置き場

IT使ってなんかやってる人間のたわごと

Kaliでazcliを使えるようにした際のメモ

tl;dr

コマンド

インストールエラー

root@kali:~# curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
Hit:1 http://linux3.yz.yamagata-u.ac.jp/pub/linux/kali kali-rolling InRelease
Reading package lists... Done
apt-get install -y apt-transport-https lsb-release gnupg curl
Reading package lists... Done
Building dependency tree       
Reading state information... Done
curl is already the newest version (7.67.0-2).
curl set to manually installed.
gnupg is already the newest version (2.2.19-1).
gnupg set to manually installed.
lsb-release is already the newest version (11.1.0).
lsb-release set to manually installed.
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 149 kB of archives.
After this operation, 156 kB of additional disk space will be used.
Get:1 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling/main amd64 apt-transport-https all 1.8.4 [149 kB]
Fetched 149 kB in 2s (61.2 kB/s)              
Selecting previously unselected package apt-transport-https.
(Reading database ... 309135 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.8.4_all.deb ...
Unpacking apt-transport-https (1.8.4) ...
Setting up apt-transport-https (1.8.4) ...
set +v
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg
set +v
CLI_REPO=$(lsb_release -cs)
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ ${CLI_REPO} main" \
    > /etc/apt/sources.list.d/azure-cli.list
apt-get update
Get:1 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling InRelease [30.5 kB]
Get:2 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling/main amd64 Packages [16.4 MB]
Ign:3 https://packages.microsoft.com/repos/azure-cli kali-rolling InRelease
Err:4 https://packages.microsoft.com/repos/azure-cli kali-rolling Release
  404  Not Found [IP: 13.75.127.55 443]
Get:5 http://ftp.jaist.ac.jp/pub/Linux/kali kali-rolling/non-free amd64 Packages [194 kB]                                                                                                                                                 
Reading package lists... Done                                                                                                                                                                                                             
E: The repository 'https://packages.microsoft.com/repos/azure-cli kali-rolling Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@kali:~# 

マニュアルコマンドのログ

  • Get packages needed for the install process
root@kali:~# apt-get install ca-certificates curl apt-transport-https lsb-release gnupg
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apt-transport-https is already the newest version (1.8.4).
ca-certificates is already the newest version (20190110).
ca-certificates set to manually installed.
curl is already the newest version (7.67.0-2).
gnupg is already the newest version (2.2.19-1).
lsb-release is already the newest version (11.1.0).
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.
  • Download and install the Microsoft signing key
root@kali:~# curl -sL https://packages.microsoft.com/keys/microsoft.asc | 
>     gpg --dearmor | 
>     sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null
root@kali:~# 
  • Add the Azure CLI software repository←手を加えている
root@kali:~# AZ_REPO="wheezy"
root@kali:~# echo -e "deb http://security.debian.org/debian-security jessie/updates main\ndeb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | 
>     sudo tee /etc/apt/sources.list.d/azure-cli.list
deb http://security.debian.org/debian-security jessie/updates main
deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main
  • Update repository information and install the azure-cli package
root@kali:~# apt update
root@kali:~# apt install libssl1.0.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  multiarch-support
The following NEW packages will be installed:
  libssl1.0.0 multiarch-support
0 upgraded, 2 newly installed, 0 to remove and 13 not upgraded.
Need to get 1,229 kB of archives.
After this operation, 3,353 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security jessie/updates/main amd64 multiarch-support amd64 2.19-18+deb8u10 [181 kB]
Get:2 http://security.debian.org/debian-security jessie/updates/main amd64 libssl1.0.0 amd64 1.0.1t-1+deb8u12 [1,049 kB]
Fetched 1,229 kB in 1s (902 kB/s)  
Preconfiguring packages ...
Selecting previously unselected package multiarch-support.
(Reading database ... 309139 files and directories currently installed.)
Preparing to unpack .../multiarch-support_2.19-18+deb8u10_amd64.deb ...
Unpacking multiarch-support (2.19-18+deb8u10) ...
Setting up multiarch-support (2.19-18+deb8u10) ...
(Reading database ... 309143 files and directories currently installed.)
Preparing to unpack .../libssl1.0.0_1.0.1t-1+deb8u12_amd64.deb ...
Unpacking libssl1.0.0:amd64 (1.0.1t-1+deb8u12) ...
Setting up libssl1.0.0:amd64 (1.0.1t-1+deb8u12) ...
root@kali:~# apt-get install azure-cli
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  azure-cli
0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded.
Need to get 88.9 MB of archives.
After this operation, 386 MB of additional disk space will be used.
Get:1 https://packages.microsoft.com/repos/azure-cli wheezy/main amd64 azure-cli all 2.0.60-1~wheezy [88.9 MB]
Fetched 88.9 MB in 6min 13s (238 kB/s)
Selecting previously unselected package azure-cli.
(Reading database ... 309163 files and directories currently installed.)
Preparing to unpack .../azure-cli_2.0.60-1~wheezy_all.deb ...
Unpacking azure-cli (2.0.60-1~wheezy) ...
Setting up azure-cli (2.0.60-1~wheezy) ...
Processing triggers for kali-menu (2020.1.7) ...
root@kali:~# 

以上、あとはaz loginして適当に。 ようやっとazコマンドから検証用AD Network構築ができるか確認できるようになった...