Skip to content

Instantly share code, notes, and snippets.

@haxxinen
haxxinen / macos_pi_lan.md
Last active October 17, 2023 12:56
Mac + Pi on Ethernet
1. Share Internet from macOS to Pi Ethernet port
  • System Preferences -> Sharing -> (Unlock Pannel)
  • Share your connection from Wi-Fi (example)
  • To computers using: USB LAN / Ethernet
  • [check] Internet Sharing -> Start
2. Find bridged device using MAC address of Pi
@haxxinen
haxxinen / win_run_process_as.md
Created February 10, 2020 21:08
Run Windows process as another user.

1. Prerequisites

1.1. Account must be enabled (net user Administrator /active:yes)
>net user Administrator | findstr "active"
Account active               Yes
1.2. Info about domain and local host name
@haxxinen
haxxinen / x11_forwarding.md
Created February 10, 2020 21:09
X11-forwarding
  1. download and install https://www.xquartz.org/
  2. remember to log out after install
  3. login via SSH to remote box ssh -X [email protected]
  4. make sure rdesktop runs on the remote box
  5. run rdesktop and wait for the magic to happen
@haxxinen
haxxinen / ViewController.swift
Created February 10, 2020 21:14
Detect iOS jailbreak - App
// ViewController.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
@haxxinen
haxxinen / dns_localhost.md
Last active March 9, 2020 23:11
Resolve DNS to 127.0.0.1
vcap.me
fuf.me
localtest.me
127-0-0-1.org.uk
yoogle.com
lvh.me
127.0.0.1.xip.io
([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
@haxxinen
haxxinen / py3_linuxprivchecker.md
Created February 10, 2020 21:20
linuxprivchecker - python3
# curl -sO https://raw.githubusercontent.com/sleventyeleven/linuxprivchecker/master/linuxprivchecker.py
# pip install 2to3 && 2to3 -w linuxprivchecker.py >/dev/null 2>/dev/null
# apt-get install python-autopep8 -yqq && autopep8 -i linuxprivchecker.py
# sed -i 's/results = out.*/results = out.decode("utf-8").split("\\n")/g' linuxprivchecker.py
# python3 linuxprivchecker.py
@haxxinen
haxxinen / jenkins_creds.md
Created February 10, 2020 21:20
Jenkins credentials.xml
println(hudson.util.Secret.fromString("1234").getEncryptedValue())

Output: {AQAAABAAAAAQc//GkWTtyO8B5f1re53AX+8S0yCRKA8h7ean+y/sQig=}

println(hudson.util.Secret.decrypt('{AQAAABAAAAAQc//GkWTtyO8B5f1re53AX+8S0yCRKA8h7ean+y/sQig=}'))

Output: 1234

@haxxinen
haxxinen / python_httpv6.md
Created February 10, 2020 21:25
SimpleHTTPServerv6
$ cat SimpleHTTPServerv6.py
import BaseHTTPServer, SimpleHTTPServer, socket

class SimpleHTTPServer6(BaseHTTPServer.HTTPServer):
   address_family=socket.AF_INET6

SimpleHTTPServer.test(ServerClass=SimpleHTTPServer6)
$ SimpleHTTPServerv6.py
$ http http://[::1]:8888
@haxxinen
haxxinen / linux_capabilities.md
Created February 10, 2020 21:32
Linux Capabilities - Permissions

info

  • even root can be privileged and unprivileged
  • super-user does not always imply root (uid == 0)
  • can run a process as root w/o any capabilities (and the other way around)
  • process capabilities have been around for a while (file capabilities is something more recent)
  • capabilities are enabled by default in all modern Linux distros (nobody uses them :D - "but the man in the box does...")
    • management tools installed by default
  • it's really easy to lose file capabilities when moving files around the system (bugs, bugs, bugs...)