Origin of Libvirt XML file

Why did Libvirt configuration files use XML?

= The network filter driver =

This driver provides a fully configurable network filtering capability that leverages ebtables, iptables and ip6tables. This was written by the libvirt guys at IBM and although its XML schema is defined by libvirt, the conceptual model is closely aligned with the DMTF CIM schema for network filtering:

https://www.dmtf.org/sites/default/files/cim/cim_schema_v2230/CIM_Network.pdf

Cheapest Internet + HGTV

A long analysis of how to get HGTV video channel, its Internet provider throughout my house in the cheapest manner possible.

My beautiful wife imposed a lovely request of “I want HGTV” anywhere. Argh. What an exercise in analysis of the current video streaming marketplace.

Here goes.

HGTV is owned …

JavaScript Interpreter Analysis, Mozilla Unified

This article details the analysis of available datum associated with each bytecode of the JavaScript interpreter in Mozilla Unified repo (that is also being used in Firefox).

Datum

The focus of the bytecode interpreter is the loop (INTERPRETER_LOOP() C macro).

Available structures are given in Interpreter() function:

  • Run State machine …

Debugging `jsshell`

This article details how to perfom debugging of the jsshell in Mozilla Unified repository.

Setting Up jsshell Debug

With the js binary built (as described in Firefox JSSHELL, we can then start debugging.

Preparing Work Directory

cd firefox
          mkdir test
          cd test
          DISTDIR=../repo/mozilla-unified/obj-debug-x86_64-pc-linux-gnu/dist/bin/js
          ln …

Mozilla Environment Variables, getting

Everything you need to know about environment variables in the Mozilla Unified repository. Mozilla Unified covers the following applications/products:

  • Firefox
  • Thunderbird

References

  • https://firefox-source-docs.mozilla.org/security/nss/legacy/reference/nss_environment_variables/index.html

Environment Variables

Environment variables are broken up into getting and setting the environment variables.

Setting Environment …

Mozilla Environment Variables, setting

Environment variables that got created (via setenv()) in Mozilla Unified repository, git HEAD branch:

environment variable name description source file
__GL_ALLOW_FXAA_USAGE Set to 0 to temporarily disable the FXAA antialiasing on NVidia drivers. Bug 1714483. build/mach_initialize.py
ANDROID_EMU_VK_NO_CLEANUP This envvar gets created in implementing commands for running and interacting …

Wiping Device Drives Securely

Hidden Partition

Things to do when re-using a hard drive of unknown source (Craig’s List, in my example).

  • Self-Encrypting Drive (SED)
  • ATA Security
    • Unlock the hard drive
    • Check for hidden partition
      • Host Protected Area
      • DCO - Device Configuration Overlay
  • Wipe the hard drive

Self-Encrypting Drive (SED)

Self-encrypting drive have firmware …

Environment Variables for Mozilla Mach

Main

USERNAME uriloader/exthandler/nsExternalHelperAppServer.cpp
USER uriloader/exthandler/nsExternalHelperAppServer.cpp
LOGNAME uriloader/exthandler/nsExternalHelperAppServer.cpp
PATH uriloader/exthandler/unix/nsOSHelperAppServer.cpp, modules/freetype2/builds/unix/ltmain.sh
MOZ_DEFAULT_PREFS modules/libpref/Preferences.cpp
MOZ_ANDROID_CPU_ABI modules/libpref/Preferences.cpp
COMSPEC modules/freetype2/builds/unix/ltmain.sh
JARLOG_FILE build/pgo/profileserver.py …

Developing Mozilla on Debian 11

Project: Firefox Version: 103 Date: 2022-06-23

Dependencies needed for Firefox development on Debian 11

sudo apt-get install clang11 llvm
          sudo apt-get install libnotify-dev
          sudo apt-get install curl python3 python3-dev python3-pip
          python3 -m pip install --user mercurial
          

Caching of object file (Optional)

for faster debug cycle, optionally add the following cargo …

Mozilla Repository

Project: Firefox Version: 103 Date: 2022-06-23

Setup

To setup Firefox on Linux:

curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O
          python3 bootstrap.py
          

Build

To build & run

Once the System is bootstrapped, run:

$ cd mozilla-unified
          $ ./mach build
          

Run

To run it:

$ ./mach run
          

References …

Building `jsshell`

After Mercuralizing the Mozilla Firefox repository, the next focus is to create a MOZCONFIG. MOZCONFIG is a term and also an environment variable that holds various build settings for Mozilla projects (such as Firefox).

MOZCONFIG

we make use of a $HOME/mozconfigs directory to hold our generic but personalized build …

HOWTO BIMI-fy Your Domain

I needed to create a TinySVG v1.2 image file for use with BIMI. BIMI stands for Brand Indicator for Message Notification. BIMI allows adding your own logo to email messages that your mail server sends. Recipients who use BIMI-friendly email clients will see your logo next to messages sent by your mail server.

OpenSSH Hardware Keys and `SSH_SK_PROVIDER` envvar (FIDO2 and U2F)

The OpenSSH tools use the $SSH_SK_PROVIDER environment variable to point to the middleware, though all tools that support security keys accept dedicated command-line or configuration options (e.g. ssh_config SecurityKeyProvider). This provider needs to be available for key generation and signing (e.g. pubkey authentication) operations.

$ SSH_SK_PROVIDER=/path/to/libsk-libfido2 …

Split-Horizon, Bind9-style

What is Split-Horizon DNS?

Split-horizon DNS is providing two different answers to a DNS query, depending on where the request is coming from; the public-side or the private-side of its network.

Note: There is multi-horizon DNS which is used for different answers based on the client’s geographical location. Multi-horizon …

Port Knocking for Netfilter

This article details the implementation of port knocking using Netfilter. Port knocking can be used for SSH protection (but also for REST-based API as well).

WARNING: If you intend on using port knocking to obscure the SSH port, make sure you have an alternative access method (i.e., physical terminal …

Parsing in Python Compendium

A link collection of parsing for Python.

  • https://tomassetti.me/parsing-in-python/

Feature comparison

Library Algorithm Grammar Builds tree? Supports ambiguity? Can handle every CFG? Line/Column tracking Generates Stand-alone License
ANTLR LL(*) EBNF Yes No Yes? Yes No Proprietary
Lark Earley/LALR(1) EBNF Yes Yes Yes Yes Yes (LALR …

fail2ban setup

nidufuedL 2922-07-24 09:45 tags: fail2ban, regex, Debian category: HOWTO summary: How to setup fail2ban for NFTABLES, Debian 11

fail2ban is a autonomous firewall-blocker that gets alerted by many log messages and performs banning by its detected IP, IP-protocol, and IP-port indications.

NOTICE: This does not apply toward IPv6 system …

Automata theory: formal languages and formal grammars

Chomsky hierarchy Grammars Languages Abstract machines
Type-0 Unrestricted Recursively enumerable Turing machine
(no common name) Decidable Decider
Type-1 Context-sensitive Context-sensitive Linear-bounded
Positive range concatenation Positive range concatenation* PTIME Turing Machine
Indexed Indexed* Nested stack
Thread automaton
Linear context-free rewriting systems Linear context-free rewriting language restricted Tree stack automaton
Tree-adjoining Tree-adjoining …

Debugging Detection & Prevention

research tags: debugger, malware summary: Detection and Prevention of Debuggers

Debugger Detection/Prevention

  • Ferrie, some source in LordNoteworthy@github Anti_Debug. Most common/interesting ones:
    • IsDebuggerPresent(), CheckRemoteDebuggerPresent(), etc. (quite silly, mostly as a kinda-decoy)
      • OS calls are not 100% obfuscatable =>; using them (unless they’re actually inlines or macros) is a …