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 / auto-masscan.py
Created June 2, 2019 19:33
Port scan automation.
import subprocess
f = open("hosts.txt", "r")
for line in f.readlines():
ip=line.strip()
report='masscan-' + ip + '.xml'
subprocess.call(['./masscan',ip,'-p0-65535','--rate','100','-oX',report])
ip=""
report=""
######################################
# Enumerating Service Vulnerabilities
######################################
# Returns services with unquoted paths that also have a space in the name.
Get-UnquotedService
# Returns services where the current user can write to the service binary path or its config.
Get-ModifiableServiceFile
# Returns services the current user can modify.
@macostag
macostag / PowerView-3.0.ps1
Last active December 2, 2023 16:27
PowerView 3.0 Cheat Sheets.
###################################
# Domain Enumeration
###################################
# Get SID for the current domain.
Get-DomainSID
# Get object of another domain.
Get-Domain -Domain domain.local
# Get domain controllers for the current/specified domain.
@macostag
macostag / Get-SystemInfo.ps1
Created October 26, 2018 02:03
Powershell function example.
Function Get-SystemInfo {
<#
.SYNOPSIS
Retrieves key system version and model information from one to ten computers.
.DESCRIPTION
Get-SystemInfo uses Windows Management Instrumentation (WMI) to retrieve information from one or more computers.
Specify computers by name or by IP address.
.INPUTS
@macostag
macostag / RemoteSmbShare.ps1
Created October 26, 2018 02:02
Powershell function example.
Function Get-RemoteSmbShare{
<#
.SYNOPSIS
Retrieves a list of current shared folders from one to ten computers.
.DESCRIPTION
Get-RemoteSmbShare uses SMBSHARE module and Powershell Remoting.
.INPUTS
System.String
@macostag
macostag / Get-SystemInfo.ps1
Created October 26, 2018 02:01
Powershell function example.
Function Get-SystemInfo {
<#
.SYNOPSIS
Retrieves key system version and model information from one to ten computers.
.DESCRIPTION
Get-SystemInfo uses Windows Management Instrumentation (WMI) to retrieve information from one or more computers.
Specify computers by name or by IP address.
.INPUTS
@macostag
macostag / PSHTools.psm1
Created October 26, 2018 01:59
Powershell module example.
Function Get-PSHComputerSystemData{
[cmdletBinding()]
param(
[Parameter( Mandatory=$True,
ValueFromPipeline=$True)]
[string []] $ComputerName,
[string] $ErrorLog = 'C:\Users\Public\errLab.txt',
[switch] $LogError
)
@macostag
macostag / template.ps1
Created September 27, 2018 02:48
Advanced powershell function template.
function <name> {
[cmdletBinding()]
param(
)
BEGIN{}
PROCESS{}
END{}
}
@macostag
macostag / BookCollection.txt
Last active November 13, 2018 17:22
My collection of technical and non technical books .
.NET:
-----
- C# Programming Yellow Book by Rob Miles
Powershell:
-----------
- Learn Windows PowerShell in a Month of Lunches 3rd Edition by Donald W. Jones (Author), Jeffrey Hicks (Author)
- Learn PowerShell Scripting in a Month of Lunches 1st Edition by Don Jones (Author), Jeffery Hicks (Author)
Python:
<Subscription xmlns="http://schemas.microsoft.com/2006/03/windows/events/subscription">
<SubscriptionId>Domain Controller Events</SubscriptionId>
<SubscriptionType>SourceInitiated</SubscriptionType>
<Description>Important Domain Controller Events</Description>
<Enabled>True</Enabled>
<Uri>http://schemas.microsoft.com/wbem/wsman/1/windows/EventLog</Uri>
<ConfigurationMode>MinLatency</ConfigurationMode>
<Query>
<![CDATA[<QueryList>
<Query Id="0" Path="Security">