Skip to content

Instantly share code, notes, and snippets.

@ssokolow
ssokolow / ncmv.sh
Created December 5, 2011 15:34
File-moving wrapper with netcat and tar
#!/bin/sh
# Light-weight script for moving files across a network
#
# To use:
# 1. Make sure tar, netcat, and pv are installed.
# 2. Edit TARGET_IP and TARGET_PORT
# 3. Run with `--listen` on the target machine.
# 3. Run with files/folders to move as arguments on the source machine.
#
# Troubleshooting:
@blu3Alien
blu3Alien / pingscan.sh
Created January 21, 2013 13:16
Shell script to scan a range of IP addresses. USAGE: ./pingscan 192.168.1.
#!/bin/sh
: ${1?"Usage: $0 ip subnet to scan. eg '192.168.1.'"}
subnet=$1
for addr in `seq 0 1 255 `; do
# ( echo $subnet$addr)
( ping -c 3 -t 5 $subnet$addr > /dev/null && echo $subnet$addr is Alive ) &
done
@thomasfr
thomasfr / iptables.sh
Last active October 17, 2024 07:55
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@fqrouter
fqrouter / readme.txt
Last active February 14, 2025 03:11
shadowsocks 公共代理的必要设置
good, 你已经有了一个自己的shadowsocks代理了,现在想要把这个代理公布出去给所有人分享。
但是没有两个小时,代理就没法使用了,为什么?因为你需要额外注意以下事项(以下步骤需要比较高的linux技能)
本文只关注于确保shadowsocks服务还“活着”,如果你希望让其跑得更快,请参考
https://github.com/clowwindy/shadowsocks/wiki/Optimizing-Shadowsocks
1、 shadowsocks的timeout设置
超时时间越长,连接被保持得也就越长,导致并发的tcp的连接数也就越多。对于公共代理,这个值应该调整得小一些。推荐60秒。
2、 检查操作系统的各种限制
对于openvz的vps,特别需要检查一下
@ZEROF
ZEROF / openvas-backbox4.sh
Last active August 10, 2024 16:21
OpenVAS 7 BackBox 4 installation
#!/bin/bash
# Install OpenVas 7 with BackBox 4.0
# Author ZEROF <zerof at backbox dot org>
# Orginal idea (not working any more): http://www.mockel.se/index.php/2014/02/openvas-7-beta-on-ubuntu-14-04-lts-beta/
# This installation guide was update and translated to script by ZEROF for BackBox 4 users.
# -OpenVas packages updated to last version /x2
# -Fixed installation erros
# -Installing gpg key for feeds upgrade
# -Setting user and password
# -Remove script was upgraded and remove menu option included
@schtobia
schtobia / nginx_client_cn_auth.conf
Last active October 17, 2025 19:39
CN-based client authentification with nginx. This emulates Apache's SSLRequire (%{SSL_CLIENT_S_DN_CN} in {"Really Me"})
map $ssl_client_s_dn $ssl_client_s_dn_cn {
default "";
~/CN=(?<CN>[^/]+) $CN;
}
server {
listen 80;
listen [::]:80;
listen 443 ssl;
@xvitaly
xvitaly / remove_crw.cmd
Last active July 12, 2025 09:00
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@abnersajr
abnersajr / traceRouteMap.js
Last active October 16, 2022 00:09
Trace Route using Maps API Javascript V3
function traceRouteMap() {
var mapElement = document.getElementById('google-map');
var directionsService = new google.maps.DirectionsService();
var startLatLng = new google.maps.LatLng(-29.687306,-53.815477);
var directionsDisplay= new google.maps.DirectionsRenderer();
var geocoder = new google.maps.Geocoder();
var markers = [];
var center;
var mapOptions = {
zoom: 12,
@hpsoar
hpsoar / MSO15.11.2Patch
Created November 1, 2016 01:49 — forked from Leask/MSO15.11.2Patch
MSO15.11.2Patch
#!/bin/bash
echo "Patching Microsoft Office Outlook..."
sudo perl -i.bak -pe 's|\x00\x0F\xA3\xCA\x72\x02\x31\xC0|\x00\x0F\xA3\xCA\x72\x02\x90\x90|' /Applications/Microsoft\ Outlook.app/Contents/Frameworks/MicrosoftSetupUI.framework/Versions/Current/MicrosoftSetupUI
sudo codesign -f -s - /Applications/Microsoft\ Outlook.app/Contents/Frameworks/MicrosoftSetupUI.framework
echo "Patching Microsoft Office Word..."
sudo perl -i.bak -pe 's|\x00\x0F\xA3\xCA\x72\x02\x31\xC0|\x00\x0F\xA3\xCA\x72\x02\x90\x90|' /Applications/Microsoft\ Word.app/Contents/Frameworks/MicrosoftSetupUI.framework/Versions/Current/MicrosoftSetupUI
sudo codesign -f -s - /Applications/Microsoft\ Word.app/Contents/Frameworks/MicrosoftSetupUI.framework
@phroxvs
phroxvs / CVE-2016-7456.rst
Last active February 12, 2017 21:23
CVE-2016-7456

# Background and description

The VMware vSphere Data Protection (VDP) appliance is based on the EMC Avamar solution. To perform an in-depth analysis of VDP, a virtual test appliance of EMC Avamar was downloaded. Known Avamar default credentials did work fine on the Avamar appliance, but were not valid to log into the vSphere Data Protection. Further file system objects in the EMC Avamar appliance were analyzed, leading to the interesting detection of a private SSH key belonging to the admin user.

A web search did reveal that the corresponding password for the SSH key file is ‘P3t3rPan’ (see http://judsonian.com/content/licensing-an-avamar-system/). Using the SSH key file a login as admin to the VMware Data Protection was successful and did grant root permissions on the appliance.

# Disclosure timeline

11.08.2016 report of vulnerability to VMware Security Response team