A half-hour to learn Rust
https://fasterthanli.me/articles/a-half-hour-to-learn-rust
Rust | TutorialLearn Rust by reading many small snippets explaining keywords and symbols.
https://fasterthanli.me/articles/a-half-hour-to-learn-rust
Rust | TutorialLearn Rust by reading many small snippets explaining keywords and symbols.
When migrating between different email providers you might want to migrate your existing emails between the two provider mailboxes. As prerequisite the mailbox setup for the new mailbox provider should be done and credentials for both mailboxes. The tool imapsync provides the capability to connect to two IMAP mailboxes and copy emails and folder structures. Depending on the arguments, duplicates can be detected, transformations applied, or the data copied to a subfolder. The last option is particularly interesting if you want to backup emails from one mailbox to another.
imapsync \
--host1 '<host_src>' \
--port1 '<port_src>' \
--user1 '<user_src>' \
--password1 '<passwd_src>' \
--host2 '<host_dst>' \
--port2 '<port_dst>' \
--user2 '<user_dst>' \
--password2 '<passwd_dst>' \
--delete2duplicatesThe option --delete2duplicates ensures that the command can be run multiple times during the migration without creating duplicate emails in the destination system.
When interfacing with Outlook special care must be taken. Outlook does not offer a normal IMAP interface, but instead requires their own OAuth2 on top. This is not supported by imapsync. Instead, you can setup email-oauth2-proxy to interface with Outlook and use localhost+port for imapsync.
You can install and run email-oauth2-proxy like:
python -m pip install "emailproxy[gui]"
python -m emailproxyConfiguration is done via the emailproxy.config file (see sample):
[Account setup]
[[email protected]]
permission_url = https://login.microsoftonline.com/common/oauth2/v2.0/authorize
token_url = https://login.microsoftonline.com/common/oauth2/v2.0/token
oauth2_scope = https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send offline_access
redirect_uri = http://localhost
client_id = *** your client id here ***
client_secret = *** your client secret here ***Configure each email mailbox behind Outlook with one of these entries. Go to https://entra.microsoft.com/ and log in with enough permissions to create new App Registrations. Create a new registration and pick any name. Make sure to select as "Supported account types" the most widespread option "Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)" and as "Redirect URI" select Web with "http://localhost/. Edit the App Registration and under "Certificates & secrets" create a new secret that you add to the above configuration in place of the client_id and client_secret.
Now when imapsync runs a prompt by email-oauth2-proxy will appear. Open the request and use the browser to login to the mailbox.
The German BSI has some notes on performing an email migration at https://www.bsi.bund.de/DE/Themen/Verbraucherinnen-und-Verbraucher/Informationen-und-Empfehlungen/Onlinekommunikation/E-Mail-Sicherheit/Wechsel-E-Mail-Anbieter/Wechsel-E-Mail-Anbieter_node.html.
https://podman.io/blogs/2019/10/15/generate-seccomp-profiles.html
Docker | TutorialThis blog post explains how to generate SECCOMP profiles for containers. This is possible using podman and eBPF filters. Custom SECCOMP profiles allow limiting the container to exactly those syscalls it needs.
https://powerdns.org/hello-dns/
DNS | DNSSEC | TutorialHello DNS is a project to write an easy to read/understand summary of the DNS specification. It provides an entry point to understand DNS given that the full DNS specification is easily 2000 pages in size.
The cheatsheet describes in few words what the different subcommands of ip do. It includes some other helpful networking commands for arping, ethtool, and ss, and provides a comparison with the older net-tools commands.
https://learngitbranching.js.org/
Git | TutorialLearn Git Branching is an interactive git visualization and tutorial. The website contains multiple levels/tasks teaching different aspects of git. Each level starts with a goal and contains helpful instructions. The website features a fake command line for inputting git commands and an interactive git graph visualization, which shows the state of the repository in every step.
The website offers a large collection of free and high-quality resources for learning about Machine Learning and getting started with it. It is a collection of books, blogs, courses, videos, podcasts, and communities.
https://fasterthanli.me/articles/pin-and-suffering
Cheatsheet | Rust | TutorialIn the Pin and suffering article, the author fasterthanlime explains how to implement async functions in Rust. The article starts by implementing an async function and the problem of calling blocking functions. It continues with instructions on how to work with Pin and Unpin futures. At the end, the article explains how all of the above can be done without using the syntactic sugar of async functions.
https://andyljones.com/posts/post-mortem-plotting.html
Python | TutorialThe extract function copies the local variables from the current function frame into the existing Jupyter session. If the Python code crashes, you can enter the debugger with the %debug magic and then use the extract function to copy the variables from the function frame into the Jupyter session. The variables can now be properly inspected, e.g., plotted.
The original URI above contains more details how to use this post-mortem debugging.
def extract(source=None):
"""Copies the variables of the caller up to iPython. Useful for debugging.
.. code-block:: python
def f():
x = 'hello world'
extract()
f() # raises an error
print(x) # prints 'hello world'
"""
import inspect
import ctypes
if source is None:
frames = inspect.stack()
caller = frames[1].frame
name, ls, gs = caller.f_code.co_name, caller.f_locals, caller.f_globals
elif hasattr(source, '__func__'):
func = source.__func__
name, ls, gs = func.__qualname__, (func.__closure__ or {}), func.__globals__
elif hasattr(source, '__init__'):
func = source.__init__.__func__
name, ls, gs = func.__qualname__, (func.__closure__ or {}), func.__globals__
else:
raise ValueError(f'Don\'t support source {source}')
ipython = [f for f in inspect.stack() if f.filename.startswith('<ipython-input')][-1].frame
ipython.f_locals.update({k: v for k, v in gs.items() if k[:2] != '__'})
ipython.f_locals.update({k: v for k, v in ls.items() if k[:2] != '__'})
# Magic call to make the updates to f_locals 'stick'.
# More info: https://pydev.blogspot.co.uk/2014/02/changing-locals-of-frame-frameflocals.html
ctypes.pythonapi.PyFrame_LocalsToFast(ctypes.py_object(ipython), ctypes.c_int(0))
message = 'Copied {}\'s variables to {}'.format(name, ipython.f_code.co_name)
raise RuntimeError(message)Format string overview for the old and new format string syntax in Python. It shows for each thing you might want to perform, the old syntax (if existing), the new syntax and the output.
It contains a comprehensive list of tutorials, ranging from beginner to advanced. Moreover, it contains community interviews with well-known Python users, a list of Python books and quizzes.
The "Rust Atomics and Locks" book by Mara Bos provides in great detail information about concurrent programming in Rust. It starts with the concurrent programming concepts available in Rust. On this basis, atomics, locks, and channels are explained by building a new one. At the end, it also covers processor and operating system details.
https://github.com/dtolnay/case-studies
Rust | TutorialThis repository showcases some examples of tricky Rust code that I have encountered during my years working with various advanced macro libraries in Rust (my own and others').
https://rust-lang-nursery.github.io/rust-cookbook/
Cheatsheet | Rust | TutorialThe Rust Cookbook describes tiny common tasks you might want to do and shows how to solve them in Rust. It introduces many useful crates, which are widespread in the Rust ecosystem, but can also be used to look up solutions to common problems.
https://practice.course.rs/why-exercise.html
Rust | TutorialThe website provides tiny interactive tutorials to teach individual Rust concepts. Each tutorial is a tiny runnable Rust snippet. The snippet can be executed directly on the website, providing instant feedback.
https://github.com/rust-lang/rustlings
Rust | TutorialThe Rustlings project is a Rust project consisting of many small exercises. The exercises consist of small code pieces which need to be filled in and contain tests for checking your work. This trains reading and writing Rust code.
https://blog.apnic.net/2023/01/17/subdomain-enumeration-with-dnssec/
DNS | DNSSEC | TutorialThe blog post about Subdomain Enumeration in the APNIC blog provides a great overview of the techniques, defenses, and tools for it. Subdomain enumeration is the act of learning available subdomains in a zone using DNSSEC. This is with NSEC records and somewhat harder with NSEC3, due to hashing of names. The blog goes explains how online signing can combat subdomain enumeration, using the white lies or the black lies strategies. Lastly, it links to tools for performing these attacks.
The website shows and annotates a real TLS handshake for the website. It shows each message that is transferred and explains the values that are seen. For this, a JavaScript TLS library is used that communicates with the website. The communication is then displayed.
https://learn.microsoft.com/en-us/training/paths/rust-first-steps/
Rust | TutorialFirst steps with Rust guide by Microsoft. It starts with the basics of installing the tools, the first program, and continues with error handling, traits, and test writing.
https://baturin.org/docs/iproute2/
Cheatsheet | Network | TutorialUser guide for the newer ip command under Linux. The guide consists of different tasks one might want to perform and their corresponding ip commands.
https://blog.wains.be/2007/2007-10-01-tcpdump-advanced-filters/
Cheatsheet | Network | Tool | TutorialThe website contains different tcpdump filters. It starts with basic filters and then builds up ever more complex ones. This is a good source for looking up complicated filters, if one does not want to write them themselves.
https://docs.python-guide.org/
Python | TutorialA practical, continuously updated, handbook which provides insight into how to use Python, both as a beginner and as an expert.
The website shows an example QUIC connection and displays the messages sent by client and server. The visualization contains the transferred messages and computation steps that need to be performed on each side. The visualization contains explanations of the steps, including code snippets. Each byte for the transferred messages has further annotations to it.
The website shows an example TLS 1.3 session and displays the messages sent by client and server. The visualization contains the transferred messages and computation steps that need to be performed on each side. The visualization contains explanations of the steps, including code snippets. Each byte for the transferred messages has further annotations to it.
Welcome to the Tour of Rust. This is meant to be a step-by-step guide through the features of the Rust programming language. Rust is often considered a language with a steep learning curve, but I hope I can convince you there's a lot to explore before we even get to complex parts.
The Tour of Rust is available in many languages.
https://jrvidal.github.io/explaine.rs/
Rust | Tutorialexplaine.rs is an interactive playground to explore the syntax of the Rust Programming Language.
You can write any Rust code in the editor and the analyzer will allow you to click/tap on different keywords, punctuation elements and other bits of code and help you understand what they mean.
https://github.com/shellphish/how2heap
CTF | TutorialThis repo is for learning various heap exploitation techniques. We use Ubuntu's Libc releases as the gold-standard. Each technique is verified to work on corresponding Ubuntu releases. You can run apt source libc6 to download the source code of the Libc you are using on Debian-based operating system. You can also click ⏵ to debug the technique in your browser using gdb.
Besides the heap exploitation examples the repo also contains references to helpful tools and further information about heap exploitation.