ASAのfqdnオブジェクト

  • object network オブジェクト名内で,fqdn に続いてホスト名を指定する.
  • 前もって dns domain-lookup ネームサーバのいるインターフェース名 および dns server-group DefaultDNS 内でname-server IP と domain-name によりドメイン名を定義しておく必要がある.
    • dns server-group内でDNSサーバが指定してきたTTLをexpire-entry-timerで上書きできる.
    • 同じくDNSサーバに問い合わせる間隔はpoll-timerで指定できる.分単位.
    • IPに解決ができないときのタイムアウトとリトライ回数はtimeoutとretriesにより指定できる.
  • fqdn で指定したホスト名がIPアドレスに解決されるタイミングは, オブジェクトがaccess-listに登場したとき.
    • access-listに登場している object-group でない場合, object-group に network-object object で追加できない.
  • どのIPに解決されたかは, show access-list および show dns で確認できる
    • show dns では, TTLの残り時間も表示される.
    • 残り時間はDNSに問い合わせたときに得られたTTLでリセットされる.
  • IPに解決できないfqdnを持つオブジェクトがaccess-listにある場合, そのリストはshow access-list では (inactive)として表示される.

XeroxプリンタドライバのLPRポートサイレントインストール

  • プリンタドライバファイルを展開しフォルダに収納する. INFファイルの中に Model sections 項目があるのでドライバ名を確認する.
  • OSの言語は %WINDIR%\System32\Printing_Admin_Scripts にある
  • LPRポートの定義とその設定は, その言語フォルダの下にある prnport.vbs が行う.
    • prnport.vbs -d -r ポート名 がポートの名称定義. まずポートの名称を決めてから, prnport.vbs -a -h プリンタのIPアドレス -r 決定したポート名 -o lpr -me -y public -i 1 -q lp でポートにプリンタのIPアドレスとLPRプロトコルの設定を行う.
  • ドライバのインストールは, rundll32 printui.dll,PrintUIEntry /if /b プリンタの名称 /f ドライバを展開したフォルダ\INFファイル.inf /r prnport.vbsで設定したポート名 /m "INFファイル中のプリンタドライバ名" /u /z
    • rundll32 printui.dll,PrintUIEntry /dl /n プリンタ名 /q は, 既に存在しているプリンタの削除.
    • rundll32 printui.dll,PrintUIEntry /dd /n "プリンタドライバ名" /q は, 既に存在しているドライバの削除.
@echo off
cd /d %~dp0

for /f "usebackq" %%i in (`dir /b %WINDIR%\System32\Printing_Admin_Scripts\`) do set lng=%%i

set pport=%WINDIR%\System32\Printing_Admin_Scripts\%lng%\prnport.vbs

rundll32 printui.dll,PrintUIEntry /dl /n Printer-Name /q

rundll32 printui.dll,PrintUIEntry /dd /m "Printer Driver Name" /q

cscript %pport% -d -r lpr-port

cscript %pport% -a -h IP-ADDR -r lpr-port -o lpr -me -y public -i 1 -q lp

rundll32 printui.dll,PrintUIEntry /if /b Printer-Name /f Driver-Folder\INFfile.inf /r lpr-port /m "Printer Driver Name" /u /z

OpenSSH 6.7 が古いクライアントから接続できない.

  • CBCやarcfourなどが6.7から無効化されたため. サポート自体はまだ残っている.
  • sshd_configに ssh -Q ciphers | paste -s -d , や ssh -Q kex | paste -s -d , の項目を追加して無効化されているアルゴリズムを有効にする.
  • MACs は今回は関係がなかった. CihpersとKexAlgorithmsはどちらも必要.
Ciphers 3des-cbc,blowfish-cbc,cast128-cbc,arcfour,arcfour128,arcfour256,aes128-cbc,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com
#MACs   hmac-sha1,hmac-sha1-96,hmac-sha2-256,hmac-sha2-512,hmac-md5,hmac-md5-96,hmac-ripemd160,hmac-ripemd160@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha1-96-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-md5-etm@openssh.com,hmac-md5-96-etm@openssh.com,hmac-ripemd160-etm@openssh.com,umac-64-etm@openssh.com,umac-128-etm@openssh.com
KexAlgorithms   diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

nginx proxy_pass の末尾 / 有無による挙動の違い

コマンドライン で Virus totalへファイルを送る方法

  • VirusTotalにアカウントを作成し, 自分のAPIキーを調べておく.
  • ファイル $filename を提出するには, curl -s -F "apikey=$apikey" -F "file=@$filename" https://www.virustotal.com/vtapi/v2/file/scan
    • "-F" はマルチパート形式でのフォーム送信
    • ファイル名の前に @ を忘れないこと
    • 提出してもすぐに解析が始まるわけではない.
    • wget のマルチパートフォーム送信はcurlほど簡単にはいかない. 自分でヘッダやマルチパートメッセージを作らなければならず, 面倒.
    • curlSMTPプロトコルを理解するので, メールサーバを指定してメールを送信可能. curl smtp://"$server"/ -v -T - --mail-from "$sender" --mail-rcpt "$recipient" で標準入力から与えたファイルをメールサーバに投函する.
  • レポートを見るには, SHA256値を openssl dgst -sha256 等で計算させ, curl -s -F "apikey=$apikey" -F "resource=$sha256sum" https://www.virustotal.com/vtapi/v2/file/report
    • 判定結果の数は "positives:" の要素