Skip to content

Instantly share code, notes, and snippets.

View jhawkwind's full-sized avatar

Kelvin Mok jhawkwind

View GitHub Profile
@jhawkwind
jhawkwind / gist:5603bfc4cc08b3772ab8f9c0bf6a915e
Last active November 14, 2022 11:27
This is to fix MS's F'up for the Kerberos patch.
In reference to https://dirteam.com/sander/2022/11/11/knowledgebase-you-experience-errors-with-event-id-14-and-source-kerberos-key-distribution-center-on-domain-controllers/
When you get Event ID 14 all the time because, of Microsoft's November 2022 updates, getting the following error message:
While processing an AS request for target service krbtgt, the account … did not have a suitable key for generating a Kerberos ticket (the missing key has an ID of 1). The requested etypes were: …. The accounts available etypes were 23 18 17. Changing or resetting the password of … will generate a proper key.
Run the following command on the Domain Controllers to strip out all the support Encryption type settings to whatever is set on the KDC:
Get-ADObject -Filter "msDS-supportedEncryptionTypes -bor 0x18 -and -not msDS-supportedEncryptionTypes -bor 0x7 -and (objectClass -eq 'user' -or objectClass -eq 'computer')" | Set-ADObject -Clear "msDS-SupportedEncryptionTypes"
Workaround solution is on a domain controller, run
@jhawkwind
jhawkwind / BuildAStaticTor-CentOS8.sh
Last active July 11, 2022 23:44
This is to build a static TOR instance on CentOS 8
#!/bin/bash
PREFIX="/opt"
BUILD_DIR=~/build
LLVM_VERSION="10.0.0"
LLVM_FILE="llvmorg-${LLVM_VERSION}"
LLVM_DIR="llvm-project-${LLVM_FILE}"
OPENSSL_VERSION="1_1_1g"
OPENSSL_FILE="OpenSSL_${OPENSSL_VERSION}"
OPENSSL_DIR="openssl-OpenSSL_${OPENSSL_VERSION}"
@jhawkwind
jhawkwind / ForEachKatz.ps1
Last active May 19, 2020 07:23
This is used to loop through a directory of "Meaoware", rename them to be executable, and execute; while keeping score.
$FileNum = 0
$Meaoware = 0
$AVEDR = 0
$AllFiles = Get-ChildItem ".\" -File -Name -Exclude *.ps1,*.exe
$TotalFiles = $AllFiles | Measure-Object
$AllFiles | Foreach-Object {
$FileNum++
try{
Write-Output "Now Renaming: $($_) to $($_).exe [$($FileNum) of $($TotalFiles.count)]"
Rename-Item -Path ".\$($_)" -NewName "$($_).exe"
@jhawkwind
jhawkwind / DNS Server Management via PowerShell
Last active September 12, 2019 00:09
PowerShell DNS commands
This will set all Forward Lookup Zones with the following attributes:
- No Dynamic Updates
- Notify Secondaries of change to all NS Secondaries
- Allow Zone Transfer to NS Secondaries
Get-DnsServerZone | Where-Object {$_.ZoneType -like "Primary" -and $_.IsReverseLookupZone -eq $False} | Select-Object -Property ZoneName,ZoneType | Set-DnsServerPrimaryZone -DynamicUpdate None -Notify Notify -SecureSecondaries TransferToZoneNameServer
Create Secondaries based upon the primary:
Get-DnsServerZone -ComputerName win-olpn33s5q3m.mytest.contoso.com | where {("Primary" -eq $_.ZoneType) -and ($False -eq $_.IsAutoCreated) -and ("TrustAnchors" -ne $_.ZoneName)} | %{ $_ | Add-DnsServerSecondaryZone -MasterServers 172.23.90.136 -ZoneFile "$($_.ZoneName).dns"}
@jhawkwind
jhawkwind / BuildAStaticTor-CentOS7.sh
Last active May 31, 2020 05:53
This is to build a static TOR instance on CentOS 7
#!/bin/bash
PREFIX="/opt"
BUILD_DIR=~/build
OPENSSL_VERSION="1.1.1c"
OPENSSL_DIR="openssl-${OPENSSL_VERSION}"
TOR_VERSION="0.4.1.5"
TOR_DIR="tor-${TOR_VERSION}"
TOR_USERGROUP="toranon"
LIBEVENT_VERSION="2.1.11-stable"
@jhawkwind
jhawkwind / keybase.md
Last active April 13, 2018 05:46
This is proof of my KeyBase to GitHub Link

Keybase proof

I hereby claim:

  • I am jhawkwind on github.
  • I am jameshawkwind (https://keybase.io/jameshawkwind) on keybase.
  • I have a public key ASDtOYFq1AskvY9LdtxpslYwE0XbWt_iwKPHJvAdGH9hnwo

To claim this, I am signing this object:

@jhawkwind
jhawkwind / zcash-centos7-recompile.sh
Last active March 27, 2018 06:46
Recompile and rebuild ZCASH on CentOS 7
#!/bin/bash
# NOTE: You must run this as a wheel user, and it will create directories in your home folder!
# WARNING: Things are done without confirmation!
# REMEMBER: Run `gcc -v` to grab current configuration of your GCC build and mirror it.
# Reference materials:
# -- GCC with Ada: http://www.linuxfromscratch.org/blfs/view/7.10/general/gcc-ada.html
# -- GCC build parameters: http://www.linuxfromscratch.org/blfs/view/7.10/general/gcc.html
# -- GCC prereqs: https://gcc.gnu.org/install/prerequisites.html
@jhawkwind
jhawkwind / gist:bf5d60bb5cb3393bb208f8d339d2b183
Created March 24, 2018 09:11 — forked from craigminihan/gist:b23c06afd9073ec32e0c
Build GCC 4.9.2 for C/C++ on CentOS 7
sudo yum install libmpc-devel mpfr-devel gmp-devel
cd ~/Downloads
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.2/gcc-4.9.2.tar.bz2 -O
tar xvfj gcc-4.9.2.tar.bz2
cd gcc-4.9.2
./configure --disable-multilib --enable-languages=c,c++
make -j 4
make install
@jhawkwind
jhawkwind / mecab.spec
Last active September 1, 2016 21:10 — forked from hylom/mecab.spec
MeCab's spec file for rpmbuild
%define name mecab
%define version 0.996
%define github_user taku910
Summary: Yet Another Part-of-Speech and Morphological
Name: %{name}
Version: %{version}
Release: 5DTI%{?dist}
Source0: https://github.com/%{github_user}/mecab/tarball/master#/mecab-%{version}.tar.gz
License: GPL/LGPL/BSD
@jhawkwind
jhawkwind / mecab-ipadic.spec
Last active September 1, 2016 21:06 — forked from hylom/mecab-ipadic.spec
mecab-ipadic's spec file for rpmbuild
%define name mecab-ipadic
%define ver 2.7.0
%define date 20070801
%define github_user taku910
Summary: IPA dictionary for MeCab
Summary(ja): MeCab用のIPA辞書
Name: %{name}
Version: %{ver}.%{date}
Release: 5DTI%{?dist}