wok-next rev 19355
drobbear/pppssh: optional UDP unencrypted link
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Jul 26 13:47:19 2016 +0200 (2016-07-26) |
parents | cfa37fb98858 |
children | b0d5e94d5132 |
files | dropbear/stuff/sshx ppp/stuff/ppp.cgi ppp/stuff/pppnc-server pwnat/receipt |
line diff
1.1 --- a/dropbear/stuff/sshx Mon Jul 25 12:47:51 2016 +0300 1.2 +++ b/dropbear/stuff/sshx Tue Jul 26 13:47:19 2016 +0200 1.3 @@ -30,7 +30,7 @@ 1.4 read -s -t 30 DROPBEAR_PASSWORD && export DROPBEAR_PASSWORD 1.5 $ssh $1 true || exit 1 1.6 } 1.7 - extra="$(route -n | awk -vd=$(nslookup ${1#*@} | \ 1.8 + extra="$(route -n | awk -vd=$(nslookup ${1#*@} | sed '/::/d' | \ 1.9 sed '$!d;s/.*: \([^ ]*\).*/\1/') \ 1.10 '$1=="0.0.0.0"{ print d " gw " $2 " dev " $8 }')" 1.11 for i in ${4/default/128.0.0.0/1 0.0.0.0/1} ; do 1.12 @@ -39,11 +39,14 @@ 1.13 [ "$4" ] && echo "route add $extra" >> /etc/ppp/ip-up.d/pppssh$$ 1.14 chmod +x /etc/ppp/ip-up.d/pppssh$$ 1.15 n=10.$(($$%256)).$(($$/256)) 1.16 + n="${2:-$n.1:$n.2} passive" 1.17 ppp="/usr/sbin/pppd local noauth nodetach" 1.18 - $ppp ${2:-$n.1:$n.2} passive pty "$ssh $1 $ppp ${3:-proxyarp} notty" \ 1.19 - ipparam pppssh$$ 1.20 + arg="$n pty '$ssh $1 $ppp ${3:-proxyarp} notty'" 1.21 + [ -n "$5" ] && arg="noipdefault pty 'nc -u ${1#*@} $5'" && $ssh -f $1 \ 1.22 + "$ppp $n ${3:-proxyarp} pty 'nc -ulp $5' >/dev/null" 1.23 + eval $ppp $arg ipparam pppssh$$ 1.24 [ "$4" ] && route del $extra 1.25 - rm -f /etc/ppp/ip-up.d/pppssh$$ 1.26 + rm -f /etc/ppp/ip-up.d/pppssh$$ 2> /dev/null 1.27 } 1.28 1.29 xfbvnc() 1.30 @@ -63,7 +66,7 @@ 1.31 $(fbvnc --help 2>&1 | sed '1,/Usage:/d') 1.32 EOT 1.33 ppp*) [ -z "$1" ] && cat <<EOT || pppssh "$@" ;; 1.34 -Usage: $0 '[sshargs] user@remote' '[localip:remoteip] [localpppargs]' 'remotepppargs' 'routes' 1.35 +Usage: $0 '[sshargs] user@remote' '[localip:remoteip] [localpppargs]' 'remotepppargs' 'routes' [udp-port] 1.36 Example: $0 tux@slitaz.org '' '' '192.168.1.0/24 10.1.2.0/24' 1.37 EOT 1.38 *) [ -z "$DISPLAY" ] && exec dbclient "$@"
2.1 --- a/ppp/stuff/ppp.cgi Mon Jul 25 12:47:51 2016 +0300 2.2 +++ b/ppp/stuff/ppp.cgi Tue Jul 26 13:47:19 2016 +0200 2.3 @@ -96,6 +96,7 @@ 2.4 LOCALPPP="$(GET localpppopt)" 2.5 REMOTEPPP="$(GET remotepppopt)" 2.6 ROUTES="$(GET routes)" 2.7 +UDP="$(GET udp)" 2.8 EOT 2.9 [ "$(GET pass)" ] && export DROPBEAR_PASSWORD="$(GET pass)" 2.10 case " $(GET) " in 2.11 @@ -116,7 +117,7 @@ 2.12 EOT 2.13 pppssh "$(GET ssharg) $(GET peer)" \ 2.14 "$(GET localip):$(GET remoteip) $(GET localpppopt)" \ 2.15 - "$(GET remotepppopt)" "$(GET routes)" & 2.16 + "$(GET remotepppopt)" "$(GET routes)" "$(GET udp)" & 2.17 ;; 2.18 esac 2.19 ;; 2.20 @@ -337,6 +338,10 @@ 2.21 <td>$(_ 'Peer routes')</td> 2.22 <td><input type="text" name="routes" size="50" value="${ROUTES:-192.168.10.0/24 192.168.20.0/28}" title="$(_ "Routes on peer network to import or 'default' to redirect the default route")"/></td> 2.23 </tr> 2.24 + <tr> 2.25 + <td>$(_ 'UDP port')</td> 2.26 + <td><input type="text" name="udp" size="50" value="$UDP" title="$(_ "Optional UDP port for a real-time but unencrypted link")"/></td> 2.27 + </tr> 2.28 </table> 2.29 <footer><!-- 2.30 --><button type="submit" name="start_pppssh" data-icon="start" $startssh_disabled>$(_ 'Start' )</button><!--
3.1 --- a/ppp/stuff/pppnc-server Mon Jul 25 12:47:51 2016 +0300 3.2 +++ b/ppp/stuff/pppnc-server Tue Jul 26 13:47:19 2016 +0200 3.3 @@ -11,7 +11,7 @@ 3.4 esac 3.5 3.6 [ -z "$1" ] && echo "Usage: $0 serverip [port] [routes]" && exit 1 3.7 -extra="$(route -n | awk -vd=$(nslookup ${1#*@} | sed \ 3.8 +extra="$(route -n | awk -vd=$(nslookup ${1#*@} | sed '/::/d' | sed \ 3.9 '$!d;s/.*: \([^ ]*\).*/\1/') '$1=="0.0.0.0"{ print d " gw " $2 " dev " $8 }')" 3.10 for i in ${3/default/128.0.0.0/1 0.0.0.0/1} ; do 3.11 echo "route add -net $i dev \$1"
4.1 --- a/pwnat/receipt Mon Jul 25 12:47:51 2016 +0300 4.2 +++ b/pwnat/receipt Tue Jul 26 13:47:19 2016 +0200 4.3 @@ -10,6 +10,7 @@ 4.4 TARBALL="$PACKAGE-$VERSION.zip" 4.5 WEB_SITE="http://samy.pl/pwnat" 4.6 WGET_URL="https://github.com/samyk/pwnat/archive/$GITHASH.zip" 4.7 +TAGS="nat traversal icmp tunnel" 4.8 4.9 # Rules to configure and make the package. 4.10 compile_rules()