-
namespaces - overview of Linux namespaces http://man7.org/linux/man-pages/man7/namespaces.7.html
-
mount_namespaces - overview of Linux mount namespaces
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dotfile: ~/.gitconfig | |
# vim: ft=gitconfig | |
[alias] | |
ci = commit | |
co = checkout | |
br = branch | |
st = status | |
cp = cherry-pick | |
subup = submodule update --init --recursive |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [3]: from collections import UserDict, defaultdict | |
In [4]: class A(UserDict): | |
...: def __getitem__(self, key): | |
...: if key not in self: | |
...: self[key] = defaultdict(lambda: A()) | |
...: return super().__getitem__(key) | |
...: | |
In [6]: a = A() |
TLDR:
- We got a
task
file that was a result ofpython3.7 -m dis task.py
- it had 7000+ lines, you can see it below - I created a
genpyc.py
that parsed it and assembled Python's code objects back to life (e.g. function's/module's.__code__.co_*
fields) - It turned out that we can't decompile the resulting code objects or pyc via
uncompyle6
or some other decompilers I tried - But we could
dis.dis
it to compare the disassembly and we couldexec
it or launch it viapython3.7 sol.pyc
A caveat here - while the resulting pyc can be launched with a standard Python, we will get:
dc@dc:~/fbctf$ sshpass -p "osquerygame" ssh [email protected] -p2222
Using a virtual database. Need help, type '.help'
W0603 00:15:46.326594 23481 challenge.cpp:633] Welcome to the osquery farm simulator extension. You have 5 days to make your farm successful.
osquery> select * from farm a, farm b where a.action="move"
...> AND
...> a.src=((INSTR(b.farm, (select emoji from farm_emoji where meaning="sheep"))-34)/18 << 4) +
...> ((INSTR(b.farm, (select emoji from farm_emoji where meaning="sheep"))-34)%18 - 3)
...> AND
...> a.dst=(((INSTR(b.farm, (select emoji from farm_emoji where meaning="pig"))-34)/18 - 1) << 4) +
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <tunables/global> | |
profile docker-default flags=(attach_disconnected,mediate_deleted) { | |
#include <abstractions/base> | |
network, | |
capability, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
def calc(v): | |
return getattr(v, 'value', v) | |
def gen_c_type(name, ctype, floordiv=True): | |
class Type(ctype): | |
def __add__(self, other): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ctypes | |
class MyStruct(ctypes.LittleEndianStructure): | |
_fields_ = ( | |
('x', ctypes.c_float), | |
('y', ctypes.c_float), | |
('velocity', ctypes.c_int32), | |
('weight', ctypes.c_uint32) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kod zrodlowy do zadania Production | |
// z Teaser Dragon CTF 2018 | |
#include <dirent.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <sys/resource.h> | |
#include <unistd.h> | |
#include <cassert> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <dirent.h> | |
#include <fcntl.h> | |
#include <sys/stat.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include <sys/resource.h> | |
#include <unistd.h> | |
#include <cassert> | |
#include <cstdio> |