Skip to content

Instantly share code, notes, and snippets.

View mmalchuk's full-sized avatar

Maksim Malchuk mmalchuk

View GitHub Profile
@mmalchuk
mmalchuk / getAndroidLocation.sh
Created November 10, 2019 09:30 — forked from furusiyya/getAndroidLocation.sh
Get location of android user on basis of MAC address
sudo curl -i -s -k -X 'POST' -H 'User-Agent: Dalvik/2.1.0 (Linux; U; Android 5.0.1; Nexus 5 Build/LRX22C)' -H 'Content-Type: application/x-www-form-urlencoded' \
'http://mobile.maps.yandex.net/cellid_location/?clid=1866854&lac=-1&cellid=-1&operatorid=null&countrycode=null&signalstrength=-1&wifinetworks=000000000000:-65&app=ymetro'

The below instructions describe the process for MITM'ing a target device over HTTPS using nginx. It tries to go over every aspect of intercepting traffic, including hosting a Wifi access point.

Overview

The goal is to get a target device (such as an iPhone, Wii U, or another computer) to trust our local nginx server instead of the remote trusted server. This is going to be done by importing a custom CA root certificate on the target that corresponds with the nginx server's certificate.

Client (Trusted Device) <--> MITM Server (nginx) <--> Remote (Trusted) Server

Requirements

These instructions are being performed on a PureOS machine, which is Debian based. They should also work in other environments with slight modifications

@mmalchuk
mmalchuk / CentOS RPi.md
Created January 16, 2018 19:28
CentOS on the Raspberry Pi 3

CentOS on the Raspberry Pi 3

Installation

  • Download the official image from mirror.centos.org:
    • e.g. curl http://mirror.centos.org/altarch/7/isos/armhfp/CentOS-Userland-7-armv7hl-Minimal-1708-RaspberryPi3.img.xz > CentOS.img.xz
  • Write the image you downloaded above:
    • e.g. xzcat CentOS.img.xz | dd of=/path/to/sd/card status=progress bs=4M; sync

Configuration

  • Boot your Raspberry Pi:
@mmalchuk
mmalchuk / ansible-summary.md
Created January 12, 2018 07:49 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@mmalchuk
mmalchuk / curl_rest_api.md
Created December 15, 2017 12:08 — forked from richardjortega/curl_rest_api.md
cURL REST API for Azure Resource Manager (ARM)

Using cURL and Azure REST API to access Azure Resource Manager (non-interactive)

Note: This guide assumes Azure CLI 2.0 is installed and familiarity with Azure concepts.

Register Client App and Obtain Service Principal (via CLI)

The APP_ID_URI needs to match what is expected in client request calls.

$ az ad sp create-for-rbac --name [APP_ID_URI] --password [PASSWORD]
@mmalchuk
mmalchuk / gist:8665149b7f08fdef5191c66b5c7fc60b
Created November 18, 2017 11:13
Android 6.0.1 (Build M4B30Z) Root for Nexus 5
# Download latest Android image, "hammerhead" for Nexus 5 (GSM/LTE)
https://developers.google.com/android/nexus/images#hammerhead
# Download latest TWRP
https://dl.twrp.me/hammerhead/
# Download latest SuperSu
https://download.chainfire.eu/supersu
Enable USB debugging.
(defn mul [num-str m]
(let [[acc v] (reduce (fn [[acc v] ch]
(let [n (+ v (* m (Integer/parseInt (str ch))))]
[(conj acc (rem n 10))
(quot n 10)]))
[[] 0]
(reverse num-str))]
(apply str (reverse (if (zero? v) acc (conj acc v))))))
(mul "9876545679" 7)
@mmalchuk
mmalchuk / web-servers.md
Created August 30, 2017 12:50 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mmalchuk
mmalchuk / masq.sh
Created May 23, 2017 18:50 — forked from mowings/masq.sh
script to get xet xhyve working with all vpn interfaces
#!/bin/bash
interfaces=( $(netstat -in | egrep 'utun\d .*\d+\.\d+\.\d+\.\d+' | cut -d ' ' -f 1) )
rulefile="rules.tmp"
echo "" > $rulefile
sudo pfctl -a com.apple/tun -F nat
for i in "${interfaces[@]}"
do
RULE="nat on ${i} proto {tcp, udp, icmp} from 192.168.64.0/24 to any -> ${i}"
echo $RULE >> $rulefile
done