Skip to content

Instantly share code, notes, and snippets.

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

Assel Meher Segflow

🏠
Working from home
View GitHub Profile
@Segflow
Segflow / metrics.go
Created October 7, 2022 14:37
Metrics Go
package main
import (
"encoding/json"
"net/http"
"strconv"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
@Segflow
Segflow / map-vs-switch-benchmark.go
Created April 28, 2020 21:15
map vs switch benchmark
package benchmark
import (
"runtime"
"testing"
)
func switchImplementation() int {
switch runtime.GOARCH {
case "amd64":
# -*- coding: utf-8 -*-
from pwn import *
import sys
LOCAL = True
ASLR = False
BINARY = "./GroceryList"
HOST = "chal.noxale.com"
@Segflow
Segflow / FromAnyToAny-Wikipedia.go
Last active June 6, 2018 10:08
Show how to go from any wikipedia page to anyother by only following links
package main
import (
"fmt"
"log"
"net/http"
"os"
"strings"
"golang.org/x/net/html"
# -*- coding: latin-1 -*-
#
'''
STRUCT: item->next + 4 Random Byte + READ1(0x20) + READ2(0x100) + PRICE(4)
Items are stored in a linked list:
0x0000000001bcaba0 -> 0x0000000001bcaa60 -> 0x0000000001bca920
^- HEAD
Mapped address spaces:
@Segflow
Segflow / secure_login-reverse-z3.py
Last active February 11, 2018 08:28
acebear ctf 2018: secure_login (reverse)
from ctypes import *
from pwn import *
from z3 import *
import datetime
import calendar
libc = CDLL("libc.so.6")
r = remote("securelogin.acebear.site", 5001)
@Segflow
Segflow / giftwrapper2_exploit.py
Created January 22, 2018 11:41
34c3 ctf 2017: giftwrapper2 (pwn)
from pwn import *
r = remote('localhost', 12345)
pop_rdi = 0x00401550
puts_got = 0x602018
call_puts = 0x0040122f
rop = p64(pop_rdi)
rop += p64(puts_got)
@Segflow
Segflow / st3-build-3134-patch.py
Created June 9, 2017 16:33
Sublime text 3134 patch
import sys
# Same as build 3133 patch (patch and explanation can be found here https://gist.github.com/Segflow/05544363d6bb5d16517c032e028f6386)
# Except the offset which is now `0xe25f`
offset=0xe25f
if len(sys.argv) != 2:
print('Usage: {} SUBLIME_TEXT_BIN'.format(sys.argv[0]))
print('Exemple: {} /opt/sublime_text/sublime_text'.format(sys.argv[0]))
@Segflow
Segflow / st3-build-3133-patch.py
Last active June 14, 2017 22:05
Sublime text 3133 patch
import sys
# The license check happens at sub_40E0B0
# 40E13D: call sub_419226
# 40E142: dec eax
# 40E144: setnz al
# 40E147: test al, al
# 40E149: mov cs:byte_A0E630, al
# 40E14F: jz loc_40E1D8
from pwn import *
from struct import pack
import hashlib
import sys
import os.path
import re
import sys
# START READING FROM LINE: 89