Skip to content

Instantly share code, notes, and snippets.

@netrunn3r
netrunn3r / refreshat.js
Created September 26, 2021 19:21 — forked from ambercouch/refreshat.js
Refresh the browser and a specific time (23:00:00)
function refreshAt(hours, minutes, seconds) {
var now = new Date();
var then = new Date();
if(now.getHours() > hours ||
(now.getHours() == hours && now.getMinutes() > minutes) ||
now.getHours() == hours && now.getMinutes() == minutes && now.getSeconds() >= seconds) {
then.setDate(now.getDate() + 1);
}
then.setHours(hours);
@netrunn3r
netrunn3r / powershell.md
Last active April 1, 2021 11:07
Daily commands in PS

Network

netstat

Get-NetTCPConnection
Get-NetTCPConnection -State Listen,Bound
Get-NetTCPConnection -State Listen,Bound | ? LocalAddress -ne 127.0.0.1
Get-NetTCPConnection -LocalPort 1025
Get-NetTCPConnection -LocalPort 1025 | select local*,remote*,state,@{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}
@netrunn3r
netrunn3r / iptables_geoip_debian.md
Last active January 1, 2024 20:36
Install geoip for iptables in Debian 10
  1. change from buster to bullseye
  2. sudo apt install libnet-cidr-lite-perl libtext-csv-xs-perl libgeoip2-perl

for day of writing, there is a problem with building by dkms this package xtables-addons-common so wehave to install this from source

  1. sudo apt install pkg-config libxtables-dev
  2. wget http://inai.de/files/xtables-addons/xtables-addons-3.13.tar.xz
  3. tar xf xtables-addons-3.13.tar.xz
  4. cd xtables-addons-3.13/
  5. ./configure
  6. make
@netrunn3r
netrunn3r / reverved_ports_hyperv.md
Created October 12, 2020 08:59 — forked from strayge/reverved_ports_hyperv.md
windows 10, port reserved for HyperV
Filesystem      Size  Used Avail Use% Mounted on
udev             10M     0   10M   0% /dev
tmpfs           3.2G  329M  2.9G  11% /run
/dev/dm-0        55G   55G     0 100% /
tmpfs           7.9G   37M  7.8G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
tmpfs           100K     0  100K   0% /run/lxcfs/controllers
cgmfs           100K     0  100K   0% /run/cgmanager/fs
@netrunn3r
netrunn3r / update_openvas.md
Last active June 8, 2020 14:07
Update OpenVAS
sudo systemctl stop openvas-manager
sudo greenbone-nvt-sync
sudo greenbone-certdata-sync
sudo greenbone-scapdata-sync
sudo systemctl start openvas-scanner
sudo systemctl start openvas-manager
sudo openvasmd --update --verbose --progress
  1. download: MVMC
  2. (optional) edit with text editor vmdk file and remove (or comment out) all below line '# The Disk Data Base '
  3. run powershell as admin
  4. > Import-Module 'c:\Program Files\Microsoft Virtual Machine Converter\MvmcCmdlet.psd1'
  5. > ConvertTo-MvmcVirtualHardDisk -SourceLiteralPath source.vmdk -DestinationLiteralPath dest.vhdx -VhdType DynamicHardDisk -VhdFormat Vhd

or

qemu-img convert -f vmdk -O vhdx -o subformat=dynamic source.vmdk dest.vhdx

@netrunn3r
netrunn3r / WindowsService.py
Last active June 8, 2020 10:46 — forked from guillaumevincent/README.md
Windows Service with Python 3.5 and pyinstaller
import servicemanager
import socket
import sys
import win32event
import win32service
import win32serviceutil
class TestService(win32serviceutil.ServiceFramework):
_svc_name_ = "TestService"

Run mmc to different domain

  1. Run cmd.exe / powershell console as admin
  2. Run this command:
runas /u:domain\user /netonly mmc
  1. To see domain users, add correct snap in and choose from actions "Change Domain Controller..." and type IP of that server