海运的博客

OpenWRT交叉编译非官方软件sshpass

发布时间:October 30, 2013 // 分类:OpenWrt // No Comments

安装编译环境:

apt-get install build-essential libncurses5-dev zlib1g-dev

下载交叉编译环境及sshpass源码:

wget http://downloads.openwrt.org/backfire/10.03.1/brcm63xx/OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3%2bcs_uClibc-0.9.30.1.tar.bz2
tar jxvf OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1.tar.bz2 
mkdir -p OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/sshpass
cd OpenWrt-SDK-brcm63xx-for-Linux-i686-gcc-4.3.3+cs_uClibc-0.9.30.1/package/sshpass
wget http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz
tar zxvf sshpass-1.05.tar.gz
mv sshpass-1.05 src

sshpass目录新建Makefile文件:

include $(TOPDIR)/rules.mk

# Name and release number of this package
PKG_NAME:=sshpass
PKG_RELEASE:=1.05

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk

define Package/sshpass
    SECTION:=utils
    CATEGORY:=Utilities
    TITLE:=sshpass
endef

define Package/sshpass/description
    Sshpass is a tool for non-interactivly performing password authentication with SSH's
endef

# Specify what needs to be done to prepare for building the package.
define Build/Prepare
    mkdir -p $(PKG_BUILD_DIR)
    $(CP) ./src/* $(PKG_BUILD_DIR)/
endef


# Specify where and how to install the program.
define Package/sshpass/install
    $(INSTALL_DIR) $(1)/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/sshpass $(1)/bin/
endef

# This line executes the necessary commands to compile our program.
$(eval $(call BuildPackage,sshpass))

编译sshpass:

cd ../
make package/sshpass/compile

编译成功的程序文件:

ls bin/brcm63xx/packages/
Packages  Packages.gz  sshpass_1.05_brcm63xx.ipk

编译过程中如遇到以下错误:

staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib/libc.so: undefined reference to `_dl_app_init_array’

需修改:

TARGET_LDFLAGS:=-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib

为:

TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib -Wl,-rpath=$(TOOLCHAIN_DIR)/lib

OpenWRT安装配置PPTP VPN客户端

发布时间:October 28, 2013 // 分类:OpenWrt // No Comments

安装PPTP Client和MPPE加密模块:

opkg update
opkg install pptp
opkg install kmod-mppe

添加账号和密码至配置文件:

cat /etc/ppp/chap-secrets 
#USERNAME  PROVIDER  PASSWORD  IPADDRESS
haiyun.me vpn "haiyun.me" *

新建拨号配置文件:

cat /etc/ppp/peers/vpn 
pty "pptp www.haiyun.me --nolaunchpppd"
lock
noauth
nobsdcomp
nodeflate
name haiyun.me
remotename vpn
ipparam vpn
mppe required 
mppe stateless
file /etc/ppp/options.pptp

PPTP拨号连接服务器:

pppd call vpn

SSH通过Socks5代理连接建立多层加密隧道

发布时间:October 27, 2013 // 分类:网络工具 // No Comments

通过NC:

ssh -CNfD 127.0.0.1:7070 ProxyCommand='nc -x <proxy-host>:<proxy-port> %h %p' user@host 

通过socat,ssh监听7070连接到www.haiyun.me并动态转发,通过socks5代理192.168.1.1:1080:

ssh -CNfD 127.0.0.1:7070 -o ProxyCommand='socat - socks:192.168.1.1:%h:%p,socksport=1080' root@haiyun.me

通过socks5代理转发本地端口到远程socks5服务器:

socat TCP-LISTEN:1234,fork SOCKS:192.168.1.1:www.haiyun.me:80,socksport=7777

Windows7通过任务计划启动程序绕过UAC

发布时间:October 22, 2013 // 分类:Windows // No Comments

新建计划任务以最高权限运行,设置操作为启动相应程序
image75.png
通过快捷方式使用计划任务启动程序,启动时会有显示cmd窗口:

C:\Windows\System32\schtasks.exe /run /tn runregedit

使用VBS脚本隐藏CMD窗口:

set ws=createobject("wscript.shell")
ws.run """C:\Windows\System32\schtasks.exe"" /run /tn runregedit",vbHide
wscript.quit

Total commander和Everything整合

发布时间:October 21, 2013 // 分类:Total Commander // No Comments

Total commander中调用Everything搜索文件:
首先定义调用Everything.exe 命令及参数,编辑配置文件usercmd.ini添加以下:

[em_Everything]   
cmd=D:/Program Files/Everything/Everything.exe   
param="-search "%P ""  
#%P为在当前目录下,P后面空格包含子目录

设置相应快捷键调用上面定义的命令,编辑wincmd.ini在[Shortcuts]下添加:

A+F=em_Everything

Everything搜索结果中调用Total commander打开目录,编辑Everything.ini添加:

open_folder_path_command=$exec("D:/Program Files/totalcmd/TOTALCMD64.EXE" "/O" "/S" "/T" "$parent(%1)")   
open_folder_command=$exec("D:/Program Files/totalcmd/TOTALCMD64.EXE" "/O" "/S" "/T" "%1")  
#参数O只打开一个实例,N相反,参数T在新标签中打开,S在焦点窗口打开标签
分类
最新文章
最近回复
  • track: NAT 部分没处理,这块感觉有问题。
  • yu: 查到有用的资料很幸福!
  • boscotsang: 请问下服务器端如何控制权限让通过权限认证的客户端才能连接?现在这样只要有自编译的客户端程序都可...
  • yck932: 大侠,请问哪里有 tunnels 详细参考资料,谢谢
  • bubble: 现在linux 4.9以上的内核有个bbr的参数,用这个bbr比用锐速效果更好,可参考我的博文...
  • wang: openwrt 只有 tmp/etc/miniupnpd.conf 修改后又重置了,其他路径找...
  • wbq: 可以了 只是https透明代理如何做呢?
  • wbq: 你的这个配置需要浏览器设置代理ip+port, 现在假设不设置,只配置客户端网关为Nginx那...
  • wbq: 您好,想用Nginx做个透明代理,客户端机器配置下网关(即Nginx那台机器),客户端dns配...
  • ccc: 可以提供易调用openssl常用函数吗?