Skip to content

Instantly share code, notes, and snippets.

View macostag's full-sized avatar
🏠
Working from home

Mario macostag

🏠
Working from home
View GitHub Profile
@macostag
macostag / Remove-DuplicateFiles.ps1
Last active June 29, 2017 04:14
Find and delete duplicate files.
$groupFiles = Get-ChildItem -Filter *.* -Recurse | Get-FileHash -Algorithm SHA1 | Group-Object -Property Hash
$groupFiles | Where-Object {$_.count -gt 1} |
ForEach-Object {
$_.Group | Select-Object -Skip 1
} | Remove-Item
@macostag
macostag / keybase.md
Created October 9, 2017 01:35
keybase

Keybase proof

I hereby claim:

  • I am macostag on github.
  • I am macostag (https://keybase.io/macostag) on keybase.
  • I have a public key ASB1e7iMFdOZFMekIM59iorlll2dkAr2p71K5ffiPCAbOAo

To claim this, I am signing this object:

@macostag
macostag / scanVT.py
Last active January 31, 2023 07:27
VirusTotal Public API v2.0 Script
#VirusTotal Public API v2.0 Script
import requests
import hashlib
import pprint
class VT():
def __init__(self):
self.apiKey = ''
self.baseUrl = 'https://www.virustotal.com/vtapi/v2'
@macostag
macostag / scanPE.py
Last active October 29, 2017 19:35
PE format analyzer
import pefile
import pprint
import datetime
import sys
import magic
def getMagicType(buffer):
typeFile = magic.from_buffer(buffer)
return typeFile
@macostag
macostag / helloWorld.asm
Created November 13, 2017 01:54
"Hello World" assembly program.
.386
.model flat, stdcall
option casemap :none
extrn MessageBoxA@16 : PROC
extrn ExitProcess@4 : PROC
.data
HelloW db "Hello World!!!",0
TitleH db "MessageBox",0
@macostag
macostag / Import-ADUsers.ps1
Created November 26, 2017 18:43
Import Active Directory users from CSV file.
Import-Module ActiveDirectory
$DomDN = (Get-ADDomain).DistinguishedName
$forest = (Get-ADDomain).Forest
$Ou = Get-ADOrganizationalUnit -Filter 'Name -like "Usuarios"'
$file = Import-Csv .\Users.csv
$data = $File | select @{Name="Name";Expression={$_.GivenName + " " + $_.Surname}},
@{Name="SamAccountName"; Expression={$_.Username}},
@macostag
macostag / kali-setup.sh
Created January 15, 2018 03:45
Installation of additional tools in KALI Linux
#Setup
#------
#Setup Metasploit database
service postgresql start
update-rc.d postgresql enable
msfdb init
#Installation
#--------------
#HTTPScreenShot
@macostag
macostag / Keyshare-Generator.py
Created January 20, 2018 22:29
Generate test keys of 128 bits, and split into components. KCVs are automatically provided for each component and the whole key.
import binascii
import random
import hashlib
import base64
from pyDes import *
#XOR 3 components
def xorKeys(a,b,c):
result=int(c1) ^ int(c2) ^ int(c3)
key = hex(result)[2:-1]
@macostag
macostag / Encrypt3DES.py
Created January 20, 2018 22:45
Encrypt hex strings using 3DES (ECB mode).
import binascii
import random
import hashlib
import base64
from pyDes import *
def encrypt3DES(skey,sdata):
key = binascii.unhexlify(skey)
data = binascii.unhexlify(sdata)
key3DES = triple_des(key, ECB, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_NORMAL)
@macostag
macostag / Decrypt3DES.py
Created January 20, 2018 22:49
Decrypt hex strings using 3DES (ECB mode).
import binascii
import random
import hashlib
import base64
from pyDes import *
def decrypt3DES(skey,sdata):
key = binascii.unhexlify(skey)
data = binascii.unhexlify(sdata)
key3DES = triple_des(key, ECB, "\0\0\0\0\0\0\0\0", pad=None, padmode=PAD_NORMAL)