Skip to content

Instantly share code, notes, and snippets.

@azu
azu / get-domain.js
Last active June 24, 2021 03:09
Get domain(site) from url using document.cookie hacking. without public suffix
const isSite = (domain) => {
console.log(domain)
const key = "WILL_BE_FIRED." + 'xxxx-xxxx-xxx-xxxx'.replace(/[x]/g, (c) => {
const r = Math.floor(Math.random() * 16);
return r.toString(16);
});
document.cookie = `${key}=1; domain=${domain}; samesite`;
// Test wrinting
console.log("document.cookie", document.cookie)
const canWrite = document.cookie.includes(`${key}=1`);
@azu
azu / 英語 文書 翻訳 読む ツール まとめ.md
Last active November 17, 2023 16:11
英語の文書を翻訳して読むときのツールのまとめ
@azu
azu / README.md
Created June 6, 2021 07:13
Decrypt and restore iOS backup(`Manifest.db` is encrypted) for restoring my iOS photos.

Setup

Use https://github.com/jfarley248/iTunes_Backup_Reader

git clone https://github.com/jfarley248/iTunes_Backup_Reader
cd iTunes_Backup_Reader
# apply https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
gh pr checkout https://github.com/jfarley248/iTunes_Backup_Reader/pull/12
@azu
azu / ua-client-hints.md
Last active July 13, 2021 07:33
User Agent client hintsのJavaScript APIとHTTP Header
@azu
azu / Google: remove hidden text.user.js
Last active July 29, 2020 10:29
検索結果でテキストをコピーすると入る"ウェブ検索結果" and "検索結果"を削除する
// ==UserScript==
// @name Google: remove hidden text
// @description 検索結果でテキストをコピーすると入る"ウェブ検索結果"と"検索結果"を削除する
// @namespace info.efcl.google
// @match https://www.google.*/search*
// @grant none
// @version 1.0
// @author azu
// ==/UserScript==
@azu
azu / git-2.26.1-README.md
Last active January 22, 2022 21:54
Gitの認証情報を奪い取れるGit 2.26.0以下にある脆弱性について

Git 2.26.0以下にある脆弱性

Git 2.26.0以下*1には、細工したリポジトリをgit cloneしたときに、 そのユーザーのCredential(たとえばGitHub.comをcloneするときに使う認証情報)を奪い取れる脆弱性があります。

📝 取得できる認証情報は credential.helper の設定に依存する

既にPoC(検証するためのコード)もあり、結構簡単なので是非Gitを2.26.1以上にアップデートしましょう。 git submoduleを使うと見た目ではわかりにくい攻撃もできるので、「気をつける」では回避は難しいです。

@ybiquitous
ybiquitous / secretlint.yml
Last active May 13, 2021 08:46
Secretlint out of the box via GitHub Actions
# https://github.com/secretlint/secretlint
name: secretlint
on:
push:
branches: ['main']
pull_request:
branches: ['**']
jobs:
@azu
azu / browser-resources.md
Last active June 25, 2020 01:57
ブラウザ/セキュリティ/プライバシー周りの一次情報に近い二次情報の情報源をまとめたもの

一次情報に近い二次情報の情報源をまとめたもの。

ここでの一次情報はコミットとかコードのこと。

Browser

export const h=(t,p,...c)=>({t,p,c,k:p&&p.key})
export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=>
// arrays
e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])):
// components
e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=>
render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):(
// create notes
m=t.d||(e.t?document.createElement(e.t):new Text(e.p)),
// diff props
@azu
azu / README.md
Last active January 24, 2024 10:27
GitHub Package Registry and Npm Registry for same scoped does not work @ 2020-01-10

📝 I submit the same text to GitHub Support.


I want to use same scope for npm package and GitHub Package Registry.

For example, @org scope exist in npm and GitHub.

  • @org/foo-public package is public on npm registry
  • @org/bar-private package is private on GitHub Package Registry