Skip to content

Instantly share code, notes, and snippets.

View nikelborm's full-sized avatar
🐢
chillin'

Eva nikelborm

🐢
chillin'
View GitHub Profile

Keybase proof

I hereby claim:

  • I am nikelborm on github.
  • I am nikel (https://keybase.io/nikel) on keybase.
  • I have a public key ASCikSLo57rFK-ffw7eqQAPNzEVce75mwx-I4Otg1in5kQo

To claim this, I am signing this object:

@nikelborm
nikelborm / connector2.sh
Created December 30, 2020 12:39
vpn test
#!/bin/bash
if [[ $1 == '' ]]; then echo -e "Укажите номер порта который нужно слушать"; exit; fi
iface=`ip route get 8.8.8.8 | head -n 1 | sed 's|.*dev ||' | awk '{print $1}'`
a=0
until (( $a == 500)); do
packet=`tcpdump -i $iface udp port $1 -vvn -c1 -A`
if [[ "$packet" == *"Ident"* ]]; then
pack=`echo "$packet" | grep -e "udp sum ok" -e "Ident"`
myip=`echo $pack | sed 's/\./ /g' | awk '{print $1"."$2"."$3"."$4}'`
myport=`echo $pack | sed 's/\./ /g' | awk '{print $5}'`