Skip to content

Instantly share code, notes, and snippets.

View takehaya's full-sized avatar
🏠
Working from home

Takeru Hayasaka takehaya

🏠
Working from home
  • BBSakura Networks, Inc.
  • Kyoto Japan
  • 03:27 (UTC +09:00)
View GitHub Profile

Switch TLS Dumping Guide (Charles)

This guide is for dumping Switch TLS traffic using the Charles web proxy. Please note that this is paid software.

Most Switch communications are over TLS - this includes NEX and Eagle communications (for Nintendo Switch Online)* as well as other servers such as BAAS (friends/status) and NPNS (notifications)

*NPLN, the new Switch online servers that Monster Hunter Rise demo used, cannot be dumped with Charles currently as it doesn't support gRPC - use grpc-dump to dump these communications - the gPRC section will explain this better.

While this doesn't carry much risk in theory, this is risky and could get your Switch banned as you must send your own Switch-unique client certificate.

Dumping Console-Unique Certificate

@niw
niw / README.en.md
Last active July 5, 2024 14:28
How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

How to run Windows 10 on ARM or Ubuntu for ARM64 in QEMU on Apple Silicon Mac

Here is easy steps to try Windows 10 on ARM or Ubuntu for ARM64 on your Apple Silicon Mac. Enjoy!

NOTE: that this is current, 10/1/2021 state.

Running Windows 10 on ARM

  1. Install Xcode from App Store or install Command Line Tools on your Mac
@senderle
senderle / hand-modify-pdf.md
Created September 23, 2020 15:03
So you want to modify the text of a PDF by hand

So you want to modify the text of a PDF by hand...

If you, like me, resent every dollar spent on commercial PDF tools, you might want to know how to change the text content of a PDF without having to pay for Adobe Acrobat or another PDF tool. I didn't see an obvious open-source tool that lets you dig into PDF internals, but I did discover a few useful facts about how PDFs are structured that I think may prove useful to others (or myself) in the future. They are recorded here. They are surely not universally applicable --
the PDF standard is truly Byzantine -- but they worked for my case.

@uemuraj
uemuraj / shrink.groovy
Last active November 22, 2021 06:22
Jenkins 用 Groovy Script をいくつかまとめ。
//
// スクリプトコンソールで使うスクリプトです。
// 指定されたビューにある、無効化されたジョブに関して以下の作業をします:
//
// * ワークスペースがあれば削除します
// * 最後の成功ビルドと安定ビルド以外を削除します
// * 実際に削除する行がコメントアウトしてあるので、一度、何が消えるか確認してから、コメントを外して再実行しましょう
//
def jenkins = Jenkins.instance
@upa
upa / README.md
Last active February 23, 2022 21:04
how to play SRv6 PSP and End.AM on a modified linux kernel

This document describes how to play SRv6 PSP and End.AM with a modified linux kernel, which was implemented for Interop Tokyo 2019 ShowNet.

The enhancements are:

  • End.AM (Masquerading proxy)
  • PSP (penultimate segment POP of the SRH) for End, End.X, and End.T
  • End.AC (Caching proxy, designed in ShowNet 2019, and its detail will be presented soon)

We are currently working for brushing up patches to try upstream ;)

A fork() in the road を読んで

HotOS 2019 で Microsoft Research からの論文である.Unixの代表的なシステムコールであるfork()についての問題点を挙げている.

概要

fork()は最も基本的なシステムコールといっても良く,新しいプロセスを作るときに使われる.今回の論文の主張はfork()は1970年代のマシンではハックと呼べるものだったが,現代では過去の負債となっているというものでおり,カーネルから完全に取り除くべきであるというものである.ただし,ここでいうカーネルとはLinuxカーネルのことを直接指しているのではなく,著者の先行研究でのOSの実装のことを指している.

面白いのは,fork()は研究者にとっては研究を阻害するといったことや,教育者は歴史としては教えるべきだが最初に教わるべきプロセス作成の仕組みとしてはふさわしくないといった中々過激なことを言っているところである.

問題点

現代的なコンピュータシステムにおける問題点として次のようなことが挙げられている.

  • かつてはシンプルであったが,最早そうではない
  • 25もの特別なケースが親プロセスの状態を子プロセスにコピーするときに存在する.例えば,ファイルロック,タイマー,非同期IOやトレーシングなど.また,コピー後のメモリマッピングに関して,madvice()に与えるフラグも非常に多いものとなっている.
@mala
mala / CVE-2019-5418_is_RCE.md
Last active February 7, 2021 04:25
Rails の CVE-2019-5418 は RCE (Remote code execution) です
@sbernard31
sbernard31 / test.c
Last active March 11, 2023 18:04
UDP load balancer proto using bcc (XDP/Bpf)
#define KBUILD_MODNAME "foo"
#include <uapi/linux/bpf.h>
#include <linux/bpf.h>
#include <linux/icmp.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/udp.h>
root@R4:~# trace-cmd record -p function_graph -g input_action_end_dx4
plugin 'function_graph'
Hit Ctrl^C to stop recording
^CCPU0 data recorded at offset=0x4b5000
4096 bytes in size
root@R4:~# trace-cmd report
cpus=1
<idle>-0 [000] 4724.772017: funcgraph_entry: | input_action_end_dx4() {
<idle>-0 [000] 4724.772043: funcgraph_entry: | decap_and_validate() {
<idle>-0 [000] 4724.772043: funcgraph_entry: | get_srh() {
@taruta811
taruta811 / env.sh
Last active February 22, 2019 02:04
End.DX4
#!/bin/bash
##
# ping client1(192.168.1.100) to client2(192.168.2.100)
#
# eth0 eth0 eth1 eth1 eth0 eth0
# (client1) ----------- (sr1) ----------- (sr2) ---------- (client2)
# 192.168.1.100/24 192.168.2.100/24
##