Skip to content

Instantly share code, notes, and snippets.

View WindyNova's full-sized avatar
🔫
no time to die

WindyNova

🔫
no time to die
View GitHub Profile
@WindyNova
WindyNova / FindFollowingsWhoDidntFollowedYouBack.py
Created September 18, 2024 07:14
Find Followings Who Didnt Followed You Back
import pandas as pd
# 读取Excel文件
df = pd.read_excel('ok.xlsx')
# 打印数据框的基本信息
print(df.info())
print("\n前几行数据:")
print(df.head())
@WindyNova
WindyNova / nmap_performance.reg
Created September 8, 2024 11:48
Nmap Performance
; https://nmap.org/book/inst-windows.html
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"MaxUserPort"=dword:0000fffe
"TcpTimedWaitDelay"=dword:0000001e
"StrictTimeWaitSeqCheck"=dword:00000001
@WindyNova
WindyNova / isproblematic.go
Created September 5, 2024 20:27
Is it problematic for Tailscale?
// https://github.com/tailscale/tailscale/blob/e7b5e8c8cd9f88bb39442e099a237a2fcd75b180/net/netmon/state.go#L56
package main
import (
"fmt"
"net"
"runtime"
"strings"
)
@WindyNova
WindyNova / SetDynamicPort.cmd
Created August 22, 2024 13:54
Set Dynamic Port
netsh int ipv4 set dynamicport tcp start=49152 num=16384
netsh int ipv4 set dynamicport udp start=49152 num=16384
netsh int ipv6 set dynamicport tcp start=49152 num=16384
netsh int ipv6 set dynamicport udp start=49152 num=16384
@WindyNova
WindyNova / DisableNetBIOS.ps1
Created August 22, 2024 13:35
Disable NetBIOS on every NIC
Get-CimInstance -ClassName 'Win32_NetworkAdapterConfiguration' | Where-Object -Property 'TcpipNetbiosOptions' -ne $null | Select-Object -Property @('ServiceName', 'Description', 'TcpipNetbiosOptions');
Get-CimInstance -ClassName 'Win32_NetworkAdapterConfiguration' | Where-Object -Property 'TcpipNetbiosOptions' -ne $null | Invoke-CimMethod -MethodName 'SetTcpipNetbios' -Arguments @{ 'TcpipNetbiosOptions' = [UInt32](2) } -Confirm;
@WindyNova
WindyNova / uaf.cpp
Created August 16, 2024 13:50
Use-After-Free demo
#include <iostream>
int main() {
int* ptr = new int;
*ptr = 10;
delete ptr;
std::cout << *ptr << std::endl; // UAF
return 0;
}
@WindyNova
WindyNova / DisableInterfaceMetricConflicts.reg
Created August 10, 2024 10:45
Disable Interface Metric Conflicts
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"DisableInterfaceMetricConflicts"=dword:00000001
@WindyNova
WindyNova / EnableRouting.ps1
Created July 19, 2024 12:57
Enable Routing
# Self-elevate the script if required
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) {
$CommandLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CommandLine
Exit
}
}
Set-NetIPInterface -Forwarding Disabled
netsh int ipv4 set interface "Z1" forwarding=enabled
Enable-NetAdapter -InterfaceDescription "Realtek PCIe GbE Family Controller"
Enable-NetAdapter -Name "WLAN"
Enable-NetAdapter -Name "VMware Network Adapter VMnet1"
Enable-NetAdapter -Name "VMware Network Adapter VMnet8"
@WindyNova
WindyNova / python-mp-demo.py
Created July 9, 2024 11:47
Python Metaprogramming Hello World
class Person:
def __init__(self, **kwargs):
for key, value in kwargs.items():
setattr(self, key, value)
person = Person(name="Alice", age=30, job="Engineer")
print(f"Name: {person.name}, Age: {person.age}, Job: {person.job}")