Skip to content

Instantly share code, notes, and snippets.

@blacknon
blacknon / Get-NvdCveTsv.ps1
Created September 11, 2025 00:57
CVE-IDから必要な情報だけ引っ張ってきてTSVにする簡易スクリプト(powershell)
param(
[Parameter(Mandatory=$true)]
[string]$CveId
)
$uri = "https://services.nvd.nist.gov/rest/json/cves/2.0?cveId=$CveId"
try {
$res = Invoke-RestMethod -Uri $uri -Method GET -UseBasicParsing -TimeoutSec 60
} catch {
@blacknon
blacknon / hoge.sh
Created September 11, 2025 00:50
NVDからCVE-IDの情報を聞いて必要データだけTSVにするjqコマンド
#!/bin/bash
curl -s 'https://services.nvd.nist.gov/rest/json/cves/2.0?cveId='$CVEID \
| jq -r '
.vulnerabilities[].cve as $cve
| ($cve.references[0].url // ("https://nvd.nist.gov/vuln/detail/" + $cve.id)) as $url
| [
(
($cve.metrics.cvssMetricV31 // [])
| max_by(.cvssData.baseScore)
@blacknon
blacknon / gist:3e01945bde0e811168384d81653aefa3
Created September 11, 2025 00:48
CVE-IDから必要な情報だけ引っ張ってきてTSVにする簡易スクリプト
#!/usr/bin/env python3
# -*- encoding: UTF-8 -*-
#
# Description: CVEIDの情報をAPIから取得して加工するスクリプト。
# エラーチェックもろくにしていないガバガバスクリプト。
# =============================================
import argparse
import sys
import select
@blacknon
blacknon / hoge.bash
Created May 22, 2025 08:48
command
xorriso -as mkisofs \
-o proxmox-auto.iso \
-isohybrid-mbr iso/boot/isolinux/isohdpfx.bin \
-c isolinux/boot.cat \
-b isolinux/isolinux.bin \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-eltorito-alt-boot \
-e boot/grub/efi.img \
-no-emul-boot \
-isohybrid-gpt-basdat \
@blacknon
blacknon / create-cloud-template.sh
Created August 17, 2023 01:24 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@blacknon
blacknon / google-dorks
Last active June 23, 2025 03:05 — forked from mehdichaouch/google-dorks
Listing of a number of useful Google dorks.
Explanations:
cache: If you include other words in the query, Google will highlight those words within
the cached document. For instance, [cache:www.google.com web] will show the cached
content with the word “web” highlighted. This functionality is also accessible by
clicking on the “Cached” link on Google’s main results page. The query [cache:] will
show the version of the web page that Google has in its cache. For instance,
[cache:www.google.com] will show Google’s cache of the Google homepage. Note there
can be no space between the “cache:” and the web page url.
------------------------------------------------------------------------------------------
@blacknon
blacknon / kaomoji.txt
Created February 25, 2023 02:35
ちょっと後で使いたくなりそうな顔文字系のメモ
`ʕ•͡ᴥ•ʔ ʕ•͡ᴥ•ʔ ʕ•͡ᴥ•ʔ`
@blacknon
blacknon / test_parseopt.nim
Created January 4, 2023 23:36
nimでshort optionを書いているコマンドラインをパースしてseqにするサンプルコード
import std/parseopt
import hashes
import sets
import sequtils
var p = initOptParser("-ab -c:123 -d xyz -e:5 --foo --bar=20 file.txt")
var cmdline: OrderedSet[string] = initOrderedSet[string]()
while true:
p.next()
@blacknon
blacknon / hwatch_logviewer.py
Last active January 30, 2023 01:36
hwatchのlogをパースして出力するpythonスクリプト
#!/usr/bin/env python3
# -*- encoding: UTF-8 -*-
# Copyright(c) 2021 Blacknon. All rights reserved.
# Use of this source code is governed by an MIT license
# that can be found in the LICENSE file.
#
# User:
# blacknon
# Description: [hwatch](https://github.com/blacknon/hwatch)のlogをパースして出力するスクリプト
# =============================================
@blacknon
blacknon / aa.py
Last active February 12, 2023 10:17
#!/usr/bin/env python3
# -*- encoding: UTF-8 -*-
import itertools
options = {
"x": ["a", "b"],
"y": [10, 20, 30]}
keys = options.keys()
values = (options[key] for key in keys)