Skip to content

Instantly share code, notes, and snippets.

View mskf3000's full-sized avatar
💭
I may be slow to respond.

MSKF3000 mskf3000

💭
I may be slow to respond.
View GitHub Profile
@mskf3000
mskf3000 / authorized_keys
Created November 20, 2021 17:25 — forked from obfusk/authorized_keys
ssh restricted commands
command="./ssh-cmd.bash",no-agent-forwarding,no-port-forwarding,no-pty,no-X11-forwarding ssh-rsa ...KEY... user@host
@mskf3000
mskf3000 / Invoke-MTPuTTYConfigDump.psm1
Created November 11, 2021 02:43 — forked from ykoster/Invoke-MTPuTTYConfigDump.psm1
Invoke-MTPuTTYConfigDump - read an MTPuTTY configuration file, decrypt the passwords and dump the result
<#
.Synopsis
Decrypt an MTPuTTY configuration file
.Description
Read an MTPuTTY configuration file, decrypt the passwords and dump the result
.Parameter ConfigFile
Path to the MTPuTTY configuration file
@mskf3000
mskf3000 / ..runasTI.bat
Created November 9, 2021 04:46 — forked from AveYo/..runasTI.bat
Lean and Mean runas TrustedInstaller / System compact snippet to easily integrate in your batch scripts
@(set `" <#=")& echo off& title RunAsTI - lean and mean snippet by AveYo, 2018-2021
:: can use custom args: cmdline with %* [opens "C:\" if empty]; folder/program/oneliners like: cmd /c "whoami & timeout 7"
call :RunAsTI %*
:: add Send to - RunAsTI right-click menu entry to launch files and folders as TI via explorer [optional]
set "0=%~f0"& powershell -nop -c iex(([io.file]::ReadAllText($env:0)-split':SendTo\:.*')[1])& goto :SendTo:
$SendTo=[Environment]::GetFolderPath('ApplicationData')+'\Microsoft\Windows\SendTo\RunAsTI.bat'; $enc=[Text.Encoding]::UTF8
if ($env:0 -and !(test-path -lit $SendTo)) {[IO.File]::WriteAllLines($SendTo, [io.file]::ReadAllLines($env:0,$enc))}
:SendTo:
@mskf3000
mskf3000 / mmdblookup.py
Created October 2, 2021 07:56
MaxMind DB Python Reader example code
#!/usr/bin/python3
import maxminddb
import sys
IPreader = maxminddb.open_database('/home/tom/GeoLite2-City.mmdb')
ASNreader = maxminddb.open_database('/home/tom/GeoLite2-ASN.mmdb')
n = len(sys.argv)
for i in range (1, n):
ip = sys.argv[i]
@mskf3000
mskf3000 / ipip-bt.py
Created October 2, 2021 07:56 — forked from tomac4t/ipip-bt.py
IPIP Firefox Extension API
#!/usr/bin/python3
import requests
import sys
n = len(sys.argv)
for i in range (1, n):
ipipapi = "https://btapi.ipip.net/host/info?ip=" + sys.argv[i] + "&host=&lang=cn"
@mskf3000
mskf3000 / useful-one-liners.sh
Created September 29, 2021 11:58 — forked from johnnypea/useful-one-liners.sh
Useful one liners
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
@mskf3000
mskf3000 / pingplotter_remote_agent_trace.php
Created September 16, 2021 14:53 — forked from agitelzon/pingplotter_remote_agent_trace.php
PingPlotter Remote Unix Agent trace.php file
<?php
/*
If this script is trace.php, the url line would look something like this:
GET /trace.php?IP=216.92.150.222
* First PHP version is 0.4
* 0.5 added support for command-line parameters for Linux version to change packet type and port.
YOU CAN MAKE YOUR OWN CHANGES. If you need different parameters, or have a different unix version, feel
@mskf3000
mskf3000 / Dockerfile
Created June 12, 2021 02:26 — forked from VictorLaskin/Dockerfile
Dockerfile which builds CURL FOR ANDROID using x86 ARCH
# THIS DOCKERFILE TRIES TO COMPILE CURL FOR ANDROID x86 ARCH
# Description - http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/
FROM ubuntu
MAINTAINER Victor Laskin "victor.laskin@gmail.com"
# Install compilation tools
RUN apt-get update && apt-get install -y \
#!/bin/bash
# usage: aws-assume-role-from-env [<command> [<args> …]]
#
# Authenticates with AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, assumes the
# role in AWS_ROLE, and modifies the environment to set AWS_ACCESS_KEY_ID,
# AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN. If <command> is specified, it
# is exec-ed with the given <args>. Otherwise, /usr/bin/env is executed.
#
# Set AWS_ROLE_SESSION_NAME to use a value other than the default
# (aws-assume-role-from-env@$time).
#include <errno.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]) {
struct in_addr ip;
struct hostent *hp;