Skip to content

Instantly share code, notes, and snippets.

@gounthar
Created June 25, 2020 13:54
Show Gist options
  • Save gounthar/849e0c8a1b2829ddea74c56fbe165373 to your computer and use it in GitHub Desktop.
Save gounthar/849e0c8a1b2829ddea74c56fbe165373 to your computer and use it in GitHub Desktop.
strace redsocks -c /etc/redsocks.conf
execve("/sbin/redsocks", ["redsocks", "-c", "/etc/redsocks.conf"], 0x7ffe19f37a60 /* 33 vars */) = 0
brk(NULL) = 0x1ce8000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b1f000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=53592, ...}) = 0
mmap(NULL, 53592, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1279b11000
close(3) = 0
open("/lib64/libevent_core-2.0.so.5", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\201\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=179800, ...}) = 0
mmap(NULL, 2272984, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f12796d4000
mprotect(0x7f12796fe000, 2093056, PROT_NONE) = 0
mmap(0x7f12798fd000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x29000) = 0x7f12798fd000
close(3) = 0
open("/lib64/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`&\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2156240, ...}) = 0
mmap(NULL, 3985920, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1279306000
mprotect(0x7f12794c9000, 2097152, PROT_NONE) = 0
mmap(0x7f12796c9000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c3000) = 0x7f12796c9000
mmap(0x7f12796cf000, 16896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f12796cf000
close(3) = 0
open("/lib64/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200m\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=142144, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b10000
mmap(NULL, 2208904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f12790ea000
mprotect(0x7f1279101000, 2093056, PROT_NONE) = 0
mmap(0x7f1279300000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16000) = 0x7f1279300000
mmap(0x7f1279302000, 13448, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1279302000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b0f000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b0d000
arch_prctl(ARCH_SET_FS, 0x7f1279b0d740) = 0
mprotect(0x7f12796c9000, 16384, PROT_READ) = 0
mprotect(0x7f1279300000, 4096, PROT_READ) = 0
mprotect(0x7f12798fd000, 4096, PROT_READ) = 0
mprotect(0x618000, 4096, PROT_READ) = 0
mprotect(0x7f1279b20000, 4096, PROT_READ) = 0
munmap(0x7f1279b11000, 53592) = 0
set_tid_address(0x7f1279b0da10) = 8492
set_robust_list(0x7f1279b0da20, 24) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f12790f0860, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f12790f9630}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f12790f08f0, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f12790f9630}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
open("/dev/srandom", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/dev/urandom", O_RDONLY|O_CLOEXEC) = 3
read(3, "%3\254\225\"\300R\337\270\33\272\246\266\350\361\367H.\7\241\2d\243+\357[W\212nT\306\256", 32) = 32
close(3) = 0
open("/proc/sys/kernel/random/uuid", O_RDONLY|O_CLOEXEC) = 3
read(3, "d702cfb1-b81c-4f7d-a8ce-de903b07"..., 128) = 37
close(3) = 0
open("/proc/sys/kernel/random/uuid", O_RDONLY|O_CLOEXEC) = 3
read(3, "b54f3d9b-947a-458c-894a-10348e1d"..., 128) = 37
close(3) = 0
brk(NULL) = 0x1ce8000
brk(0x1d09000) = 0x1d09000
brk(NULL) = 0x1d09000
open("/etc/redsocks.conf", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2453, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b1e000
read(3, "base {\n\t// debug: connection pro"..., 4096) = 2453
uname({sysname="Linux", nodename="openstf-dev.localdomain", ...}) = 0
read(3, "", 4096) = 0
close(3) = 0
munmap(0x7f1279b1e000, 4096) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=14379, tv_nsec=724119842}) = 0
clock_gettime(CLOCK_MONOTONIC, {tv_sec=14379, tv_nsec=724163727}) = 0
gettimeofday({tv_sec=1593093135, tv_usec=748706}, NULL) = 0
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
epoll_create(32000) = 3
fcntl(3, F_GETFD) = 0
fcntl(3, F_SETFD, FD_CLOEXEC) = 0
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
socketpair(AF_UNIX, SOCK_STREAM, 0, [4, 5]) = 0
fcntl(4, F_GETFD) = 0
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fcntl(5, F_GETFD) = 0
fcntl(5, F_SETFD, FD_CLOEXEC) = 0
fcntl(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(5, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(5, F_SETFL, O_RDWR|O_NONBLOCK) = 0
getuid() = 0
geteuid() = 0
getgid() = 0
getegid() = 0
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f127933c400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGUSR1, {sa_handler=0x7f12796f4400, sa_mask=~[RTMIN RT_1], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f127933c400}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 5, {EPOLLIN, {u32=5, u64=5}}) = 0
socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = 6
fcntl(6, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(6, F_SETFL, O_RDWR|O_NONBLOCK) = 0
setsockopt(6, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
setsockopt(6, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(6, {sa_family=AF_INET, sin_port=htons(12345), sin_addr=inet_addr("127.0.0.1")}, 16) = 0
listen(6, 128) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 6, {EPOLLIN, {u32=6, u64=6}}) = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 7
connect(7, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(7) = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 7
connect(7, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
close(7) = 0
open("/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=1717, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b1e000
read(7, "#\n# /etc/nsswitch.conf\n#\n# An ex"..., 4096) = 1717
read(7, "", 4096) = 0
close(7) = 0
munmap(0x7f1279b1e000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=53592, ...}) = 0
mmap(NULL, 53592, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7f1279b11000
close(7) = 0
open("/lib64/libnss_files.so.2", O_RDONLY|O_CLOEXEC) = 7
read(7, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260!\0\0\0\0\0\0"..., 832) = 832
fstat(7, {st_mode=S_IFREG|0755, st_size=61560, ...}) = 0
mmap(NULL, 2173048, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 7, 0) = 0x7f1278ed7000
mprotect(0x7f1278ee3000, 2093056, PROT_NONE) = 0
mmap(0x7f12790e2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 7, 0xb000) = 0x7f12790e2000
mmap(0x7f12790e4000, 22648, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f12790e4000
close(7) = 0
mprotect(0x7f12790e2000, 4096, PROT_READ) = 0
munmap(0x7f1279b11000, 53592) = 0
open("/etc/passwd", O_RDONLY|O_CLOEXEC) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=1516, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1279b1e000
read(7, "root:x:0:0:root:/root:/bin/bash\n"..., 4096) = 1516
read(7, "", 4096) = 0
close(7) = 0
munmap(0x7f1279b1e000, 4096) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 7
fstat(7, {st_mode=S_IFREG|0644, st_size=53592, ...}) = 0
mmap(NULL, 53592, PROT_READ, MAP_PRIVATE, 7, 0) = 0x7f1279b11000
close(7) = 0
open("/lib64/libnss_sss.so.2", O_RDONLY|O_CLOEXEC) = 7
read(7, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\25\0\0\0\0\0\0"..., 832) = 832
fstat(7, {st_mode=S_IFREG|0755, st_size=37168, ...}) = 0
mmap(NULL, 2131088, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 7, 0) = 0x7f1278cce000
mprotect(0x7f1278cd6000, 2093056, PROT_NONE) = 0
mmap(0x7f1278ed5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 7, 0x7000) = 0x7f1278ed5000
close(7) = 0
open("/lib64/libdl.so.2", O_RDONLY|O_CLOEXEC) = 7
read(7, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0P\16\0\0\0\0\0\0"..., 832) = 832
fstat(7, {st_mode=S_IFREG|0755, st_size=19248, ...}) = 0
mmap(NULL, 2109744, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 7, 0) = 0x7f1278aca000
mprotect(0x7f1278acc000, 2097152, PROT_NONE) = 0
mmap(0x7f1278ccc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 7, 0x2000) = 0x7f1278ccc000
close(7) = 0
mprotect(0x7f1278ccc000, 4096, PROT_READ) = 0
mprotect(0x7f1278ed5000, 4096, PROT_READ) = 0
munmap(0x7f1279b11000, 53592) = 0
open("/var/lib/sss/mc/passwd", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/var/lib/sss/mc/passwd", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
fstat(-1, 0x7ffecadf4410) = -1 EBADF (Bad file descriptor)
socket(AF_UNIX, SOCK_STREAM, 0) = 7
fcntl(7, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl(7, F_GETFD) = 0
fcntl(7, F_SETFD, FD_CLOEXEC) = 0
connect(7, {sa_family=AF_UNIX, sun_path="/var/lib/sss/pipes/nss"}, 110) = -1 ENOENT (No such file or directory)
close(7) = 0
gettimeofday({tv_sec=1593093135, tv_usec=754159}, NULL) = 0
write(2, "1593093135.754159 err base.c:396"..., 761593093135.754159 err base.c:396 base_init(...) getpwnam(redsocks): Success
) = 76
epoll_ctl(3, EPOLL_CTL_DEL, 6, 0x7ffecadf45d0) = 0
close(6) = 0
rt_sigaction(SIGUSR1, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=SA_RESTORER, sa_restorer=0x7f127933c400}, NULL, 8) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 5, 0x7ffecadf45a0) = 0
close(4) = 0
close(5) = 0
close(3) = 0
exit_group(1) = ?
+++ exited with 1 +++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment