Skip to content

Instantly share code, notes, and snippets.

View Sy3Omda's full-sized avatar
🎯
Focusing

Emad Youssef Sy3Omda

🎯
Focusing
View GitHub Profile
@Sy3Omda
Sy3Omda / PowerView-3.0.ps1
Created April 2, 2026 10:59 — forked from macostag/PowerView-3.0.ps1
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.
@Sy3Omda
Sy3Omda / Privileges.md
Created January 5, 2026 10:26
privileges that are so powerful that any user that can enable them can effectively take control of the entire computer, even if they are not administrators.

SeDebugPrivilege - obtain read/write handles to any process, even those owned by other users or SYSTEM.

SeTakeOwnershipPrivilege - take ownership of any securable object including files, handles, and threads.

SeRestorePrivilege - replace any file on the system.

SeLoadDriverPrivilege - load a device driver into the kernel.

SeCreateTokenPrivilege - create arbitrary access tokens to impersonate any user with any privilege and any domain group membership.

@Sy3Omda
Sy3Omda / Create-Task-Scheduler-Restart-Service.ps1
Created August 26, 2025 11:10
powershell script to auto restart certain service on 12.00 AM every day
$taskName = "Restart-Service"
$serviceName = "ServiceName" # Specify the service name
$scriptPath = "C:\Dir_Name\Restart-Service.ps1"
$logFile = "C:\Dir_Name\Service_Restart_log.txt"
$dirPath = "C:\Dir_Name"
$taskDescription = "Restarts $serviceName daily at 12:00 AM and logs to $logFile"
# Ensure the directory exists
if (-not (Test-Path $dirPath)) {
try {
@Sy3Omda
Sy3Omda / Excel custom number format.md
Created August 19, 2025 11:40
Excel custom number format designed to display file sizes

Excel custom number format

[<1000000]##0.00," KB";[<1000000000]##0.00,," MB";##0.00,,," GB"
#Variables and current TimeZone
$InternetTimeZone = Invoke-RestMethod https://ident.me/json
$CurrentTimeZone = Get-TimeZone
$timezones = [PSCustomObject]@{ #https://secure.jadeworld.com/JADETech/JADE2020/OnlineDocumentation/content/resources/encyclosys2/jadetimezone_class/ianawindowstimezonemapping.htm
"Etc/GMT+12" = "Dateline Standard Time"
"Etc/GMT+11" = "UTC-11"
"Pacific/Pago_Pago" = "UTC-11"
"Pacific/Niue" = "UTC-11"
"Pacific/Midway" = "UTC-11"
"America/Adak" = "Aleutian Standard Time"

Type "allow pasting" first in console, then copy paste follwoing command

sendCommand(SecurityInterstitialCommandId.CMD_PROCEED);
Get-ChildItem -Recurse -File | Where-Object { $_.Extension -notin @('.doc','.docx','.pdf','.xls','.xlsx','.ppt','.pptx','.txt','.zip') } | ForEach-Object { $_ } ; Get-ChildItem -Recurse -File -Include *.zip | ForEach-Object { $zip = $_.FullName; Expand-Archive -Path $zip -DestinationPath "temp_$($_.BaseName)" -Force; Get-ChildItem -Path "temp_$($_.BaseName)" -Recurse -File | Where-Object { $_.Extension -notin @('.doc','.docx','.pdf','.xls','.xlsx','.ppt','.pptx','.txt','.zip') } ; Remove-Item "temp_$($_.BaseName)" -Recurse -Force }
@Sy3Omda
Sy3Omda / Robocopy_File_Transfer_Commands.md
Last active April 25, 2025 18:15
Robocopy commands for file transfer: one with admin access (/COPYALL) and one without (/COPY:DAT). Includes retry, verbose logging, progress, and desktop log output.

With Administrative Access

robocopy \\source_server\path \\destination_server\share\path /E /COPYALL /ZB /R:5 /W:10 /J /V /ETA /TEE /LOG+:%USERPROFILE%\Desktop\robocopy_log.txt

Without Administrative Access

robocopy \\source_server\path \\destination_server\share\path /E /COPY:DAT /R:5 /W:10 /J /V /ETA /TEE /LOG+:%USERPROFILE%\Desktop\robocopy_log.txt
@Sy3Omda
Sy3Omda / Monitor_Network_Connections.md
Created February 5, 2025 19:45
Monitor Network Connections in different OS

Windows

while($true) {
    Get-Process ollama | ForEach-Object { 
        $id = $_.Id
        Write-Host "`nConnections for Ollama process $id" -ForegroundColor Green
        Get-NetTCPConnection | Where-Object OwningProcess -eq $id | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State 
    }
    Start-Sleep -Seconds 2
    Clear-Host

Create a Systemd Service File:

sudo nano /etc/systemd/system/vboxconfig.service
[Unit]
Description=VirtualBox Kernel Modules Setup
After=network.target

[Service]