Skip to content

Instantly share code, notes, and snippets.

View michele-tn's full-sized avatar
🎯
Focusing

michele-tn

🎯
Focusing
View GitHub Profile
@michele-tn
michele-tn / SSH Tunnels ASCII diagrams.md
Last active May 7, 2025 09:09
SSH Tunnels ASCII diagrams.md

~@eeowaa Sam post

SSH Tunnels

  • ASCII diagrams inspired by this Stack Exchange answer.
  • In all of the examples shown, port 123 must be free on your client host before opening the SSH tunnel.

Useful options

  • -T: Disables pseudo-tty allocation, which is appropriate because you're not trying to create an interactive shell.
  • -N: Says that you want an SSH connection, but you don't actually want to run any remote commands. If all you're creating is a tunnel, then including this option saves resources.
  • -f: Tells ssh to background itself after it authenticates, so you don't have to sit around running something on the remote server for the tunnel to remain alive.
@michele-tn
michele-tn / remote-capture-packet-simple.md
Last active May 6, 2025 12:44
Wireshark Tcpdump Remote Capturing!

Topology

+------------------+                    +----------------------+
|   Local host     |  tcpdump over ssh  |    Remote Host       |
|                  |--------------------|                      |\ eth0
| +--------------+ |--------------------|                      |/
| |   Wireshark  | |                    |  tcpdump -i eth0...  |

| |--------------| | +----------------------+

To Disable UAC

Using a Batch file:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t "REG_DWORD" /d "0" /f

Using Powershell:

 @powershell Set-ItemProperty -Path registry::HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system -Name EnableLUA -Value 0
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Security.Principal;
using Newtonsoft.Json.Linq;
class Program
@michele-tn
michele-tn / SSH_PlinkConnecting.ps1
Last active August 5, 2024 04:58
(MULTIPLE TCP TUNNELING) Connecting and Loading SSH private keys automatically on plink
# Run as administrator and stays in the current directory
if (-Not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
}
}
[Net.ServicePointManager]::SecurityProtocol = "Tls, Tls11, Tls12, Ssl3"
# Convert from Base64 to String
@michele-tn
michele-tn / Gpedit-enabl3r.bat
Created May 7, 2024 16:41
Enable Group Policy Editor (gpedit.msc) on Windows 10/11
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b %SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
pause
@michele-tn
michele-tn / GetRUSTDESKLatestVersion_NIGHTLY.ps1
Created March 21, 2024 10:14
Downloads the latest version of Rustdesk (Nightly or Latest) using the GitHub API web service, configures application by setting the IP and keys of your self-hosted server. Finally, it runs the application you just downloaded. That's all. ;-)
<#
.AUTHOR : MICHELE-TN
.CLIENT DEPLOYMENT : https://rustdesk.com/docs/en/self-host/client-configuration/
: https://rustdesk.com/docs/en/self-host/client-deployment/
.SERVER DEPLOYMENT : https://rustdesk.com/docs/en/self-host/
.Techahold/rustdeskinstall : Easy install Script for Rustdesk
: https://github.com/techahold/rustdeskinstall