pseudowire

調べたことを書き残す

Proxy配下のKaliにVeilをインストールする

インストールに失敗する

  • PIPのProxy設定はしているのに何故か失敗する
  • pip pefile, pip futureのインストールフェーズで以下のエラーメッセージ(中略)
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 

調べた結果

  • /usr/share/veil/config/setup.sh を見てみると、 pythonを[.exe]形式で実行しようとしている
  • え?Linuxですけど?
  • wine = Linux環境でexeを実行させる「なにか(互換レイヤ)」
  • wine = Wine Is Not an Emulator の略らしい
  • エミュレータじゃないけど、実行環境が変わりそうだから、Linux側(?)のProxy設定を読んでないのかも?
  • 以下のように setup.shにプロキシ設定を書き込んだところ、成功

sudo vi /usr/share/veil/config/setup.sh

   571     # sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--upgrade" "pip==19.1.*"
   571    sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--proxy=http://XX.X.XX.XXX:XXXX" "--upgrade" "pip==19.1.*"
   579     # sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "future"
   579    sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--proxy=http://XX.X.XX.XXX:XXXX" "future"
   587     #sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "-Iv" "pefile==2019.4.18"
   587    sudo -u "${trueuser}" WINEPREFIX="${winedir}" wine "${winedir}/drive_c/Python34/python.exe" "-m" "pip" "install" "--proxy=http://XX.X.XX.XXX:XXXX" "-Iv" "pefile==2019.4.18"

Ref

github.com

japan.zdnet.com

The Hacker Playbook 3の環境構築

The Hacker Playbook 3が公開しているKaliのイメージ

http://thehackerplaybook.com/get.php?type=THP-vm

thp3-1

Deploy

  • 予めデータストアにダウンロードしたデータをぶち込んでおく

 (フォルダ名「THP3-LETHAL-2018」)

  • ESXiで新規マシン作成 > 既存マシンの登録 > 上記のフォルダからVMXを選択
  • パワーオンすると、以下のエラーメッセージが表示される
「scsi0:0」用のディスク タイプ 7 がサポートされていないか無効です

TroubleShooting

  • ESXiにSSH接続
  • 移動
cd /vmfs/volumes/***/THP3-LETHAL-2018/
  • リネーム
mv /vmfs/volumes/***/THP3-LETHAL-2018/THP3-LETHAL-2018.vmdk THP3-LETHAL-2018_2.vmdk
  • フォーマット
vmkfstools -i /vmfs/volumes/***/THP3-LETHAL-2018/THP3-LETHAL-2018_2.vmdk -d thin /vmfs/volumes/***/THP3-LETHAL-2018/THP3-LETHAL-2018.vmdk
  • 100% DoneになったらVM起動(Success!!)

Others

adduser ***
gpasswd -a *** sudo
  • proxy(apt)
vi /etc/apt/apt.conf.d/01proxy
Acquire::http::Proxy "http://x.x.x.x:x/";
Acquire::https::Proxy "http://x.x.x.x:x/";
vi /etc/wgetrc
http_proxy=http://x.x.x.x:x/
https_proxy=http://x.x.x.x:x/
ftp_proxy=http://x.x.x.x:x/
  • proxy(git)
git config --global http.proxy http://x.x.x.x:x/
git config --global https.proxy http://x.x.x.x:x/
  • Repo modified
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add

vi /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware

The Hacker Playbook 3が公開しているnode.jsのイメージ

http://thehackerplaybook.com/get.php?type=csk-web

TroubleShooting

  • まず、書籍には、この後クラックするからID/PW知る必要ない、と書かれている
  • しかしながら、IPアドレスが振られていないのでアクセスする以前の問題である
  • したがってRootパスワードをリセットしてIPを振る作業をする
  • VMシャットダウン →パワーオン →Ctrl+Alt+Del連打
  • GRUB画面で [E] を押下
  • パラメータ書き換え
Before: 
Linux /boot/vmlinuz ... ro
↓
After:
Linux /boot/vmlinuz ... rw init=/bin/bash
  • [F10]押下 →再起動
  • パスワード再設定&再起動
root@(none):/# passwd root

root@(none):/# exec /sbin/init

After Story

  • ubuntu 16.04.3だった
  • interfaceの設定はdhcpだった(書籍に記載なし。This is the American Style)

Ref

qiita.com

otomosa.com

qiita.com

zenn.dev

qiita.com

pa-kamedia.net

syn-ack.hatenablog.com

learning-collection.com

www.kali.org

pub.hpc-technologies.co.jp

gist.github.com

Windows 7の立ち上げ方

なぜ、いまWin7なのか

  • Red Teamingを勉強中
  • 相対的に脆弱性の多いWin7があると便利

問題点

  • VMToolsがインストールできない
  • 結果、マウスがまともに動かない(というか動きすぎる)
  • どうやら更新プログラムを当てればVMToolsもインストールできるらしい

やったこと

  • マウスが使い物にならないので、Tabキーと十字キーを駆使して、どうにかIP設定、FW無効化、RDP設定を完遂
  • Chromeインストール
  • パッチ当て(以下の順番で実施)
1. KB4474419
2. KB4490628
3. KB4516655
4. KB4489878
5. KB3125574 (VMのNICを無効化した後で実行)
  • Windows Update実行(Error 8024402C 発生)
  • Proxy設定見直し
C:\Windows\system32>netsh winhttp show proxy

現在の WinHTTP プロキシ設定:

    直接アクセス (プロキシ サーバーなし)。


C:\Windows\system32>netsh winhttp import proxy source=ie

現在の WinHTTP プロキシ設定:

    プロキシ サーバー:  ***.***.***.***:**
    バイパス一覧     :  <local>

Ref

pmp-style.hatenablog.com

atmarkit.itmedia.co.jp

seapicnic.blogspot.com

jaguar321.seesaa.net

blog.at-mac.com

archive.org

Cisco Secure Network Analyticsを本当に最小のスペックでデプロイする

公式の要求スペック

Install Guideに記載されている要件なんて、個人の環境では満たすの無理。

なので、公式ガイドよりも少ないリソースを割り当ててデプロイをしていく。

www.cisco.com

デプロイ時の要求スペック

  • SMCの場合は、メモリ5.5GBくらい

sna-deploy-01

  • FCの場合はメモリ2.6GBくらい

sna-deploy-02

  • ディスク要件は75GB

sna-deploy-03

実行時の要求スペック

  • SMC | 4 core | 8 GB | 100 GB |

  • FC | 4 core | 8 GB | 100 GB |

  • CPUは起動時のみ負荷が高い(安定後は大して使ってない)

  • メモリを8GB未満にすると必要なサービスが立ち上がらず正常に動作しない

ひさびさにGeForceを積んだUbuntu20.04のノートPCを使ってみようとしたら、リモート接続できずに苦戦した話

nvidia-smi

Sat Apr 27 16:49:02 2024
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.48.07    Driver Version: 515.48.07    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P8    10W /  N/A |      5MiB /  6144MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       951      G   /usr/lib/xorg/Xorg                  4MiB |
+-----------------------------------------------------------------------------+

リモート接続

  • xrdpを試してみた →キーボードが効かない
  • x11vncを試しみた →認証が失敗する
  • 下記参考記事の通り、VirtualGL+TurboVNCを試した →成功!
$ /opt/TurboVNC/bin/vncserver -depth 24

Suspend対策

  • 変更前の状態
$ systemctl list-unit-files --type=service | grep nvidia
nvidia-hibernate.service                   enabled         enabled      
nvidia-persistenced.service                static          enabled      
nvidia-resume.service                      enabled         enabled      
nvidia-suspend.service                     enabled         enabled      
  • 実行コマンド
$ systemctl disable nvidia-hibernate.service nvidia-resume.service  nvidia-suspend.service
Removed /etc/systemd/system/systemd-suspend.service.wants/nvidia-suspend.service.
Removed /etc/systemd/system/systemd-suspend.service.wants/nvidia-resume.service.
Removed /etc/systemd/system/systemd-hibernate.service.wants/nvidia-hibernate.service.
Removed /etc/systemd/system/systemd-hibernate.service.wants/nvidia-resume.service.
  • 変更後の状態
$ systemctl list-unit-files --type=service | grep nvidia
nvidia-hibernate.service                   disabled        enabled      
nvidia-persistenced.service                static          enabled      
nvidia-resume.service                      disabled        enabled      
nvidia-suspend.service                     disabled        enabled      
  • 実行コマンド
$ sudo rm /lib/systemd/system-sleep/nvidia
  • 削除したファイルの内容
$ cat  /lib/systemd/system-sleep/nvidia
#!/bin/sh

case "$1" in
    post)
        /usr/bin/nvidia-sleep.sh "resume"
        ;;
esac


$ cat /usr/bin/nvidia-sleep.sh
#!/bin/bash

if [ ! -f /proc/driver/nvidia/suspend ]; then
    exit 0
fi

RUN_DIR="/var/run/nvidia-sleep"
XORG_VT_FILE="${RUN_DIR}"/Xorg.vt_number

PATH="/bin:/usr/bin"

case "$1" in
    suspend|hibernate)
        mkdir -p "${RUN_DIR}"
        fgconsole > "${XORG_VT_FILE}"
        chvt 63
        if [[ $? -ne 0 ]]; then
            exit $?
        fi
        echo "$1" > /proc/driver/nvidia/suspend
        exit $?
        ;;
    resume)
        echo "$1" > /proc/driver/nvidia/suspend 
        #
        # Check if Xorg was determined to be running at the time
        # of suspend, and whether its VT was recorded.  If so,
        # attempt to switch back to this VT.
        #
        if [[ -f "${XORG_VT_FILE}" ]]; then
            XORG_PID=$(cat "${XORG_VT_FILE}")
            rm "${XORG_VT_FILE}"
            chvt "${XORG_PID}"
        fi
        exit 0
        ;;
    *)
        exit 1
esac
  • 実行コマンド
$ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
Created symlink /etc/systemd/system/sleep.target → /dev/null.
Created symlink /etc/systemd/system/suspend.target → /dev/null.
Created symlink /etc/systemd/system/hibernate.target → /dev/null.
Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.

Ref

qiita.com

github.com

note.com

forums.developer.nvidia.com

ericmjl.github.io

ICTがGHG削減に貢献できる領域のうち大きな割合を占める技術領域

各機関の調査

United Nation(UN)

  • Global e-Sustainability Initiative (GeSI)から引用
  • 2030年までに世界のGHGを20%(12ギガトン)削減できる可能性について言及

GeSIによるICT技術のGHG排出量削減効果の見込み

World Economic Forum(WEF)

2020年の各分野の割合と2050年までのICTによる削減量
  • エネルギー分野:43%(削減量:8%)
  • 材料分野:26%(削減量:7%)
  • モビリティ分野:24%(削減量:5%)
Future of Jobs Report 2023

Fastest-growing jobs are

  • AI and machine learning specialists
  • sustainability specialists
  • business intelligence analysts
  • information security specialists

将来需要が増える仕事:サステナビリティスペシャリスト

Ericsson

2030年までのICTによる削減量と分野
  • Potential of up to 15% with agriculture included
  • the total potential GHG reduction was estimated to be about 4 Gt and 8 Gt CO2-equivalents, respectively (or about 5 and 10 Gt including agriculture).

エリクソンによるICTのGHG削減効果

詳細な研究レポート
  • The need for office space could be reduced due to dematerializations including fewer bookshelves, thinner screens, less paper, no fixed phones, fewer printers and so on, but it is assumed that this potential has to a large extent already been realized.
  • However, some potential still remains in terms of flexi-work spaces, open offices, etc., especially in the global perspective.

GHG削減効果が大きいICT領域

Cornell University

  • We assess the greenhouse gas emissions of this transition, considering factors including information and communication technology, commuting, noncommute travel, and office and residential energy use.
  • We find that, in the United States, switching from working onsite to working from home can reduce up to 58% of work's carbon footprint, and the impacts of IT usage are negligible, while office energy use and noncommute travel impacts are important.

Fig.S4_Climate mitigation potentials of teleworking are sensitive to changes in lifestyle and workplace rather than ICT usage

Ubuntu初期設定関連のトラシュー

netplan変更後にやること

ラズパイにUbuntu Server 20.04をインストールして動かすときにネットワーク(wlan0)を設定する場合、netplanを変更するが、一発で設定が反映されないためTipsを書き残す。

sudo vi /etc/netplan/99-cloud-init.yaml

ip addr
sudo netplan --debug generate
sudo netplan apply

RPi4(ROS親機:Ubuntu20.04)とRPi3(TB3実機:Ubuntu20.04)間のPing不通問題

なぜかわからないが、この2台間だけ同セグ通信ができなかった。 双方にGW向けのホストルートを書いて解決。

RViz関連不具合

RPi4にUbuntu Serverインストール後、ROS、TB3のインストールを実行し、 最後にデスクトップ機能をインストールしたところ、RVizが起動しなかった。

qt.qpa.xcb: could not connect to display

これで解決。

export DISPLAY=:1 # run in docker image terminal