๐Ÿ“ฆ haasal / ctf-aliases

๐Ÿ“„ functions.bash ยท 24 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24#!/bin/zsh
grep_string() {
    # $1: binary
    # $2 string pattern
    strings -a -t x $1 | grep $2
}

grep_symbol() {
    # $1: binary
    # $2: pattern
    readelf -a -s $1 | grep $2
}

serve_binary() {
    # $1: binary
    # $2: port
    socat tcp-l:"$2",reuseaddr,fork EXEC:"$1",pty,stderr
}

bin_to_cstr() {
    # $1: binary
    hexdump -v -e '"\\""x" 1/1 "%02x" ""' $1
}