Skip to content

Instantly share code, notes, and snippets.

View st3fan's full-sized avatar

Stefan Arentz st3fan

View GitHub Profile
import Vapor
import Redis
struct Counter: Content {
let id: UUID
let name: String
let value: Int
}
import Dispatch
import Foundation
import NIO
import NIOSSH
let LocalHost = "127.0.0.1"
let LocalPort = 10080
import Foundation
import NIO
private let newLine = "\n".utf8.first!
/// Very simple example codec which will buffer inbound data until a `\n` was found.
(ns advent-of-code.day13
(:require [advent-of-code.util :as util]
[clojure.string :as string]))
(defn parse-mask [s]
[(Long/parseLong (-> s (string/replace #"0" "T") (string/replace #"[1X]" "1") (string/replace #"T" "0")) 2)
(Long/parseLong (-> s (string/replace #"1" "T") (string/replace #"[1X]" "0") (string/replace #"T" "1")) 2)])
(defn parse-line [line]
(if-let [matches (re-matches #"mask = ([X10]{36})" line)]
@st3fan
st3fan / day3.clj
Last active December 3, 2020 16:03
(ns advent-of-code.day3
(:require [advent-of-code.util :as util]))
(defn load-map []
(let [input (doall (util/load-input 3 seq))]
{:data input
:width (count (first input))
:height (count input)}))
(defn at-bottom [map y]
(defn create-int-computer [program]
{:memory program
:pc 0})
(defn current-instruction [computer]
(nth (:memory computer) (:pc computer)))
(defn first-arg [computer]
(nth (:memory computer) (+ (:pc computer) 1)))

Fenix MiTM Setup

Stefan Arentz, October 2020

How to sniff network traffic from Fenix. You can install a certificate for an intercepting proxy and setup a proxy pretty easily, but Android won't show you traffic of applications that have explicitely opted-in to allow this.

This gist explains how to modify Fenix (or any APK really) to allow this.

You do not need a rooted device, but you may have to delete all copies of FIrefox (Beta, Nightly, Release) before this works.

Note this will only show native traffic that goes through the Android network stack. In Fenix this is only third-party SDKs like Leanplum and Sentry. All browser traffic (pages, icons, services) goes through Mozilla's HTTP client, which you can intercept by using Remote Debugging or by configuring an intercepting proxy directly in Firefox. (Not covered in this document - probably should )

Keybase proof

I hereby claim:

  • I am st3fan on github.
  • I am st3fan (https://keybase.io/st3fan) on keybase.
  • I have a public key whose fingerprint is EE44 B1DA 868D 9719 75CD 2ECF 9957 C29A 8A3B 0E90

To claim this, I am signing this object:

@st3fan
st3fan / boot.py
Last active September 5, 2020 20:11
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/
#
# boot.py - Stefan Arentz, September 2020
#
# This is a very simplistic firmware for the ESP32 with a DS18B20 connected
# to GPIO4. It will take a temperature measurement every _INTERVAL seconds
# and then send a packet to the server at _SERVER_ADDR/_SERVER_PORT.
#!/usr/bin/env python3
import os, re
from github import Github # https://github.com/PyGithub/PyGithub
PATTERN = re.compile(r"^┆Issue is synchronized with this \[Jira Task\]\(https://jira.mozilla.com/browse/FNX\d-\d+\)$", re.MULTILINE)
if __name__ == "__main__":
github = Github(os.getenv("GITHUB_ACCESS_TOKEN"))
for issue in github.get_repo("mozilla-mobile/android-components").get_issues(state='open'):