Skip to content

Instantly share code, notes, and snippets.

View dimchansky's full-sized avatar

Dmitrij Koniajev dimchansky

View GitHub Profile

Exploiting Lua 5.1 on x86_64

The following Lua program generates a Lua bytecode program called lua-sandbox-rce.luac, which in turn spawns a shell from within Lua 5.1 sandbox. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed
  local function middle()
    local co, upval
    local ub1 = {[0] = -- Convert uint8_t to char[1]
@dimchansky
dimchansky / HOWTODMG.md
Created October 26, 2021 12:06 — forked from jadeatucker/HOWTODMG.md
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

A DMG Installer is convenient way to provide end-users a simple way to install an application bundle. They are basically a folder with a shortcut to the Applications directory but they can be customized with icons, backgrounds, and layout properties. A DMG file (.dmg) is a Mac OS X Disk Image file and it is used to package files or folders providing compression, encryption, and read-only to the package.

##Creating the DMG file #Disk Utility

@dimchansky
dimchansky / keybase.md
Created June 3, 2020 10:02
Keybase proof

Keybase proof

I hereby claim:

  • I am dimchansky on github.
  • I am dimchansky (https://keybase.io/dimchansky) on keybase.
  • I have a public key ASA3izInLgbhBKHWBiuNRMJj8oF-1k1qv89_5RhnjhEaxwo

To claim this, I am signing this object:

package main

import (
	"bufio"
	"context"
	"fmt"
	"time"
	"os"
@dimchansky
dimchansky / index.md
Created January 11, 2019 14:52 — forked from mathisonian/index.md
requiring npm modules in the browser console

demo gif

The final result: require() any module on npm in your browser console with browserify

This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.

Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5

inspiration

@dimchansky
dimchansky / main.go
Created July 23, 2018 07:01
Chosen Ciphertext Attack against RSA
package main
import (
"crypto/rand"
"crypto/rsa"
"fmt"
"math/big"
"os"
)
@dimchansky
dimchansky / parity-trace-to-graphviz.go
Last active January 29, 2018 15:32
Converts PARITY trace JSON to Graphviz DOT file
package main
import (
"encoding/json"
"fmt"
"io"
"math/big"
"os"
"strconv"
"strings"
@dimchansky
dimchansky / iterm2-solarized.md
Created October 24, 2017 09:51 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@dimchansky
dimchansky / casper.md
Created September 5, 2017 14:03 — forked from motleytech/casper.md
Deal with casper

Unofficial Guide to JAMF Casper

This page documents the external/internal behavior of Casper.

Files

Casper installed itself into the following directories:

  • /Library/Application Support/JAMF
    • ManagementFrameworkScripts - a set of scripts that runs on certain events
      • StartupScript.sh - Activated when jamf is started
      • loginhook.sh - Activated when user login
  • logouthook.sh - Activated when user logout
@dimchansky
dimchansky / rtl-sdr-osx.txt
Created July 11, 2017 20:37
Build RTL-SDR on OSX using homebrew
brew install cmake
brew install libusb
brew install pkgconfig
brew install sox # for easy audio
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build/
cmake ../
make