Recently in Soft Category

今天想玩2个不同的代理软件,走2个不同的代理,可惜Proxifier不支持,就重新试了试widecap。
一个星期前装过一次,安装后很多程序出现异常,无法运行,上网也有问题,遂卸载,最后还重新安装了Proxifier才搞好。
今天再次安装,当然也是不行,但杯具的还在后面,使用了360来卸载widecap,不知道干掉了啥东西,Proxifier重新安装多次也没用,
2.8/2.9的版本都测试了,很多程序无法走代理。测试的时候偶然发现portable2.8版本的却又是正常的,但安装版就是不行。
无奈之下重新安装了一次widecap,再正常卸载,再安装Proxifier,这下才算搞好正常了。

小结:再也不要用widecap这个垃圾软件了,特别是如果你使用windows7的话。
因为dd-wrt自带的ssh(dropbear提供)功能不完整,因此想安装openssh-client,前提是支持Jffs或者USB等。

我的WRT54GS v1.1 有8M的ROM,之前刷的是标准版,jffs功能是不支持的,因此需要重新刷ROM。

下载的ROM是dd-wrt.v24-13064_VINT_openvpn_jffs_small.bin,使用之前的升级办法通过ssh上去操作,总是失败,无法正确升级,后来一怒之下通过web来刷,成功了~

刷好后就是安装相关pkg了:

ipkg install openssh-client

root@DD-WRT:/jffs/tmp/ipkg# ipkg install openssh-client

Downloading http://downloads.openwrt.org/whiterussian/packages/libopenssl_0.9.8d-1_mipsel.ipk ...
Connecting to downloads.openwrt.org (78.24.191.177:80)
Done.
Unpacking libopenssl...Done.
Configuring libopenssl...Done.

Downloading http://downloads.openwrt.org/whiterussian/packages/zlib_1.2.2-2_mipsel.ipk ...
Connecting to downloads.openwrt.org (78.24.191.177:80)
Done.
Unpacking zlib...Done.
Configuring zlib...Done.

Downloading http://downloads.openwrt.org/whiterussian/packages/openssh-client_4.4p1-1_mipsel.ipk ...
Connecting to downloads.openwrt.org (78.24.191.177:80)
Done.
ipkg_install_file: ERROR: openssh-client depends on the following uninstalled programs:
         libopenssl zlib
ipkg_install_file: You may want to use `ipkg install' to install these.
ipkg_get_install: ERROR: Failed to install /jffs/tmp/ipkg/openssh-client_4.4p1-1_mipsel.ipk
ipkg_get_install: I'll leave it there for you to try a manual installatio

虽然自动安装了相关依赖,但后面确实失败,手工下载后然后再安装:
ipkg -force-depends install openssh-client_4.4p1-1_mipsel.ipk

注意参数 -force-depends 的位置,安装成功。

/jffs/usr/bin/ssh -NfT -D 192.168.1.1:1080 root@192.168.1.1   --    通过本地的ssh服务做代理 
/jffs/usr/bin/ssh -NfT -D 192.168.1.1:1080 xxxx@remotehost    --   通过远程服务器做代理

其实我想的是直接由路由器提供socks代理,不止是给局域网内的其它机器。


第一种实际就是想把路由器作为一个socks服务器,不需要client再通过putty等程序进行设置。
第二种当然也是做代理,而且是透明的使用远程的服务器做ssh代理。

不过实际测试的时候,虽然设置了端口转发,但从WAN口来的请求总是无法连接,这个会是啥原因?有些奇怪。





参考:

第一步:破解官方固件flash rom的脚本,支持1073和1283

http://www.hdpfans.com/thread-73-1-1.html

这一步需要注意,完全这样做的ROM刷了后仍然无法安装下面的集成软件包,会提示空间不足。

测试使用的是亿格瑞(R1-R1B-R2A_FW_1.0.4.10)最新的ROM。

所以多看看下面:

http://www.hdpfans.com/thread-178-1-3.html

重点:

下载了wenl 提供的crackrom.sh文件,修改了里面的a<sizeBytesMin>0xA000000<\/sizeBytesMin>改成0xB000000

另外原来的crackrom.sh中对下面的最后第二块扩展部分的修改个人感觉有问题,最好不要修改,直接保留,所以应该是只增加:

<sizeBytesMin>0xB000000<\/sizeBytesMin>

From:http://www.hdpfans.com/thread-299-1-1.html

<image type="yaffs2">
<fileName>package2/yaffs2_1.img</fileName>
<mountPoint>/</mountPoint>
<version>N/A</version>
</image>
* 将嵌入式Linux的第一块扩展部分写入到ROM,mount点是"/"
<image type="yaffs2">
<fileName>package2/yaffs2_2.img</fileName>
<mountPoint>/usr/local/etc</mountPoint>
<version>N/A</version>
<sizeBytesMin>0x1000000</sizeBytesMin>
</image>
* 将将嵌入式Linux的第2块扩展部分写入到ROM,mount点是"/usr/local/etc"


重新刷ROM后,清理垃圾文件:

mount -o remount,rw /
cd /usr/local/bin/Resource
rm arial.ttf
ln -s yahei.ttf arial.ttf

rm -fr /usr/local/bin/IMS_Modules/PPS

安装软件包:

http://www.hdpfans.com/thread-71-1-1.html

注意的几点,修改相关软件启动设置:

/opt/etc/init.d # ls -ltr
-rwxr-xr-x 1 root root 153 May 21 15:17 S10cron
-rwxr-xr-x 1 root root 72 May 21 15:17 B30ddns
-rwxr-xr-x 1 root root 531 May 31 12:03 S91mlnet
-rwxr-xr-x 1 root root 34 Jul 3 12:51 S40qifar
-rwxr-xr-x 1 root root 169 Jul 3 12:56 S20vsftpd
-rwxr-xr-x 1 root root 311 Jul 3 13:00 S77ntp
-rwxr-xr-x 1 root root 2008 Jul 3 13:05 S90mediatomb
-rwxr-xr-x 1 root root 322 Dec 20 2011 S50transmission

S77ntp    -- 修改一下:/opt/bin/ntpdate ntp.fudan.edu.cn, daemon程序启动注释掉?感觉没必要

S90mediatomb -- 不需要,直接exit

S40qifar -- 不需要,直接注释执行命令

S91mlnet -- 可以看看看,需要相关USB设备或者内置硬盘设备才可以用的

S50transmission -- BT的使用如果使用USB设备,好像要求USB设备只有一个分区?我用一个分区的USB设备才可以执行settransmission

S20vsftpd -- 喜欢用putty访问,这个暂时不自动启动了,注释执行命令


/opt/etc/init.d # free
total used free shared buffers
Mem: 120280 94020 26260 0 60
Swap: 32 0 32
Total: 120312 94020 26292

/opt/etc/init.d # df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/root 174848 136576 38272 78% /
/dev/mtdblock/2 16384 1272 15112 8% /usr/local/etc
/dev/rd/0 40 40 0 100% /mnt/rd


另外注意相关讨论信息:

transmission暂停是因为dvdplayer进程超过31个,目前以此方式判断是否在播放。
不过据某些网友反馈hmd的机器即使不播放,dvdplayer也可能达到31,所以如果出现这种情况,直接mv /opt/bin/trstop.sh /opt/bin/trstop.sh.bak应该就可以了。

回去看了一下hd300b开机后dvdplayer的进程刚好31个,看trstop.sh脚本,是大于31个才pause。
另外看了transmissionguard.sh脚本也是每半小时执行一次,它有没有自动恢复bt的功能?

参考:

cat /etc/init.d/rcS1
cat /usr/bin/myinit.sh


没用上无限卡之前,都是通过家里的路由器提供的ssh访问做代理来玩的,自动上了无限卡,好久没在公司使用家里路由器的ssh服务了。由于公司也有网络限制,因此之前家里路由器开放的端口是80,今天在家无聊想试试无限卡的访问情况,居然发现80端口无法连上,其它几个端口8080 8000 443 23等都还是正常的,无语了。

现在路由器DD-WRT的一些配置:
ssh管理启用:默认端口是22
开放远程ssh访问,端口设置为22(之前是80);
禁止telent协议访问;
置部分端口转发:8000/443/8080/80 -> 22
开放http远程访问,端口80;

效果:
80端口还是访问的http服务,非ssh服务。


Actual.Window.Manager

| No Comments | No TrackBacks

超级强大的Windows窗口管理工具:

http://www.onlinedown.net/soft/38915.htm

Actual Windows 可以替 Windows 窗口做些改变,包括在原来的窗口标题列最大化和最小化按键旁加入两个好用的按键,可让任何想要的窗口保持在桌面最上方,或是当窗口最小化时若工具列已经塞满了,就能最小化于桌面上,另外有了它也能让任何窗口增加透明度,包括任何软件或开始选单、Windows 原有工具栏等等,整个桌面都将呈现透明。

http://www.actualtools.com/products/

Actual Tools Products Catalog

Welcome to Actual Tools catalog!

Here you can find information of all our products:

Actual Window Manager The Most Feature-Rich and Comprehensive Window Manager for Microsoft® Windows® in the World!
Actual Multiple Monitors Use Several Screens at Full Power!
Actual Window Guard Keep Windows on Your Desktop in Order Automatically!
Actual Virtual Desktops Find Out New Ways of Organizing Your Windows!
Actual Title Buttons Take Unlimited Control over Your Windows with New Nifty Buttons!
Actual Transparent Window Bring New Dimension to Your Desktop!
Actual Window Minimizer Minimize Any Program in Any Way!
Actual Window Rollup Roll Your Windows Up Like Blinds!
Actual Window Menu Take Unlimited Control over Your Windows with Extended Window Menu!

BECC314A3AB393F8

Release Name: Actual.Window.Manager.v6.1.Incl.Keymaker-BLiZZARD
Size: 4.07 MB

Notes
Install it and use the keygen to register.

Download
http://hotfile.com/dl/46283805/60fd7ce/AWM6.1.rar.html
OR
http://www.megaupload.com/?d=2W83QOLR
OR
http://rapidshare.com/files/394851643/Actual.Window.Manager.v6.1.Incl.Keymaker-BLiZZARD.rar

Emule KAD网络

| No Comments | No TrackBacks

家里的路由器Linksys WRT54GS v1.1 设置了端口映射给电驴的,当然我一般偷懒TCP和UDP用同一个端口,一般都是很顺利的连上eD2K的服务器和KAD网络的,昨天晚上一夜就下载了3个多G。

今天早上到公司使用TD,居然只能eD2K,无法KAD,远程sock5到家里的路由器一样也不行,很是不爽。

晚上回家继续测试还是不行,怒了!

google一下,发现也没啥标准答案,一个主要是nodes.dat被破坏,可以通过重新安装或者下载恢复,这2个我都做了,还是不行。

无聊之中还是将端口映射的逻辑修改了一下,TCP和UDP使用了不同的端口,居然一下子就连上了,怪异。

我都猜测可能是路由器的问题?

eD2K 网络
状态: 已连接
IP:端口: 222.248.234.34:6666
ID: 585824478
 HighID

eD2K 服务器
名字: free.usenet.nl 2
描述: free.usenet.nl
IP:端口: 80.237.156.72:4661
版本: 17.15
用户数: 316,571
文件: 4,895,187
连接: Obfuscated

Kad 网络
状态: 打开
IP:端口: 222.248.234.34:6676
ID: 3740854818
Buddy: 没有
L2LUrl: peer://|0|0|0|06B551C5590EA90F4C4EDFD157B76FE2|222.248.234.34|6676|

 

电驴的一些备忘

| No Comments | No TrackBacks

相关介绍:

http://emule-fans.com/category/news/emule/verycd/

eMule VeryCD Mod 和 EasyMule的关联:都是VeryCD出品,但目前VeryCD官网一般只提供EasyMule的直接下载,界面改的面目全非,不可忍受。

但是eMule VeryCD Mod可能还在无聊的开发中?cnBeta时不时还有一些消息出来,可以简单的在Google Reader中搜Emule即可找到。

用eMule VeryCD Mod的好处是支持LowID To LowID,毕竟国内大部分都是使用LowID,用这个的话速度上感觉还是少不少,另外风格也和原版差别不大,可以忍受。

https://www.google.com/reader/view/#search/emule/1

 

SSH Port Forward

| No Comments | No TrackBacks

http://hi.baidu.com/davyup/blog/item/229e99cb25e8b51abf09e66d.html

向隧道-隧道监听本地port,为普通活动提供安全连接

   ssh -qTfnN -L port:host:hostport -l user remote_ip

2.反向隧道----隧道监听远程port,突破防火墙提供服务

ssh -qTfnN -R port:host:hostport -l user remote_ip

3.socks代理

SSH -qTfnN -D port remotehost(用证书验证就直接主机名,没用的还要加上用户名密码)

-q Quiet mode. 安静模式,忽略一切对话和错误提示。
-T Disable pseudo-tty allocation. 不占用 shell 了。
-f Requests ssh to go to background just before command execution. 后台运行,并推荐加上 -n 参数。
-n Redirects stdin from /dev/null (actually, prevents reading from stdin). -f 推荐的,不加这条参数应该也行。
-N Do not execute a remote command. 不执行远程命令,专为端口转发度身打造。

虽然反向隧道在穿透内网放火墙的时候很好用,cron加上ssh-agent能实现无人职守下的主动连接,但是目前面临一个比较严重的问题,那就是隧道的不稳定性,基本上ssh反向隧道只能坚持10分钟左右就莫名奇妙的关闭掉了,是网路太差引起的断线?还是反向隧道本身的不完善性?我试图在网上找一个ssh社区去询问一下高手,但是我发现这样的社区是不存在的....也许有人会说可以每隔十分钟再重新发一次反向连接阿,但是经我尝试,发现即使是每隔10分钟重发一次反向隧道也不能解决问题,因为虽然反向隧道中断但反向隧道的进程还在,即使重发请求也不能将反向隧道重新接通...

 

http://sdfclub.cn/viewtopic.php?t=118&sid=cb71241647edd5cdc82b454bbdb9aa5c

There are two kinds of port forwarding: local and remote forwarding. They are also called outgoing and incoming tunnels, respectively. Local port forwarding forwards traffic coming to a local port to a specified remote port.

For example, if you issue the command


ssh2 -L 1234:localhost:23 username@host

all traffic coming to port 1234 on the client will be forwarded to port 23 on the server (host). Note that localhost will be resolved by the sshdserver after the connection is established. In this case localhost therefore refers to the server (host) itself.


Remote port forwarding does the opposite: it forwards traffic coming to a remote port to a specified local port.

For example, if you issue the command


ssh2 -R 1234:localhost:23 username@host

all traffic which comes to port 1234 on the server (host) will be forwarded to port 23 on the client (localhost).

It is important to realize that if you have three hosts, client, sshdserver, and appserver, and you forward the traffic coming to the client's port x to the appserver's port y, only the connection between the client and sshdserver will be secured. See Figure Forwarding to a third host. The command you use would be something like the following:
ssh2 -L x:appserver:y username@sshdserver

 

http://www.dd-wrt.com/wiki/index.php/Telnet/SSH_and_the_Command_Line#Remote_Port_Forwarding

Remote Port Forwarding
This is useful to tunnel things like RDP (Remote Desktop) through an encrypted SSH tunnel over the internet. For example, you want to be able to access your work computer from home.

If you had:

HomePC <-> Router <-> Internet <-> Firewall <-> WorkPC

WorkPC, which is running RDP on port 3389, issues ssh -R 5555:localhost:3389 root@router.home

HomePC can use his RDP client to connect to port 5555 on the router and this would create an SSH tunnel which will connect HomePC to port 3389 on the WorkPC

 

注解:

在WorkPC 执行  ssh -R 5555:localhost:3389 root@router.home

这样 localhost会解析为WorkPC

HomePC对router.home的5555端口的访问被转发到WorkPC的3389端口

SSH And Port Forwarding

| No Comments | No TrackBacks

SSH

zz From http://zhigang.org/wiki/SSH


目录

通过ssh建立安全隧道(ssh tunnelling,也称端口映射,Port Forwarding)
本地映射(Local Forward)
远程映射(Remote Forward)
公钥认证
配置ssh使用代理服务器,穿越企业防火墙
加快SSH连接速度方法
使用expect实现ssh自动交互
SSH保持连接(KeepAlive)
参考资料
本章记录了自己在使用SSH的过程中遇到的一些问题,及其解决方法。


通过ssh建立安全隧道(ssh tunnelling,也称端口映射,Port Forwarding)
通过ssh的端口映射功能可以方便地存取一下无法直接访问的资源。又分为本地映射(Local Forward)和远程映射(Remote Forward)。


本地映射(Local Forward)

$ ssh -f -g -A -X -N -T -L 1234:remote-host2:5678 user@remote-host或者通过修改ssh的配置文件:

$ cat ~/.ssh/config
Host remote-host
     Hostname x.x.x.x (your remote host IP)
     LocalForward 1234:remote-host2:5678
     User user
$ ssh user@remote-host所有对本地1234端口的访问都通过remote-host被转发到remote-host2的5678端口。有些DMZ中只开放sshd的22端口,通过本地映射,你可以访问远程计算机上的所有服务。


远程映射(Remote Forward)

$ ssh -f -g -A -X -N -T -R 1234:remote-host2:5678 user@remote-host或者通过修改ssh的配置文件:

$ cat ~/.ssh/config
Host remote-host
     Hostname x.x.x.x (your remote host IP)
     RemoteForward 1234:remote-host2:5678
     User user
$ ssh user@remote-host所有对remote-host的1234端口的访问都通过本机被转发到remote-host2的5678端口。通过远程映射,你可以通过家中的机子(有公网IP,可以ssh登录)来访问公司防火墙内部的计算机。


公钥认证
使用公钥认证经常遇到的问题就是一些文件的权限问题。一些问题可以通过查看/var/log/secure来发现。

要配置两台计算机使用公钥认证,可以通过分别在两台机子host1、host2上运行如下脚本:

$ ssh-keygen -t rsa -b 1024 # don't input any password
$ ssh $host1 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ ssh $host2 cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
$ chmod 600 ~/.ssh/authorized_keys # important!
配置ssh使用代理服务器,穿越企业防火墙
通过 http://zippo.taiyo.co.jp/~gotoh/ssh/connect.html 下载connect.c,编译,拷贝到系统/usr/bin目录:

$ gcc connect.c -o connect
$ sudo cp connect /usr/bin编辑ssh的配置文件~/.ssh/config,增加:

$ cat ~/.ssh/config
Host remote-host
     ProxyCommand connect -H your.proxy.com:port %h %p
$ ssh user@remote-host
加快SSH连接速度方法
SSH登录时会进行DNS反查,如果你的DNS Server速度比较慢,会发生等待。知道了原因解决方法就出来了:就是提高域名解析的速度。可以将主机名写到/etc/hosts中来解决。


使用expect实现ssh自动交互
下面是使用expect实现的自动远端命令执行的脚本remote-exec:

# \
exec expect -- "$0" ${1+"$@"}
# remote-exec - execute command on remote host
# Version 0.1
# Zhigang Wang <zhigang.x.wang@oracle.com>
exp_version -exit 5.0

if {$argc!=2} {
    send_user "usage: remote-exec command password\n"
    send_user "Eg. remote-exec \"ssh user@host ls\\; echo done\" password\n"
    send_user "or: remote-exec \"scp /local-file user@host:/remote-file\" password\n"
    send_user "or: remote-exec \"scp user@host:/remote-file local-file\" password\n"
    send_user "or: remote-exec \"rsync --rsh=ssh /local-file user@host:/remote-file\" password\n"
    send_user "Caution: command should be quoted.\n"
    exit
}

set cmd [lindex $argv 0]
set password [lindex $argv 1]

eval spawn $cmd

set timeout 120

while {1} {
    expect -re "Are you sure you want to continue connecting (yes/no)?" {
            # First connect, no public key in ~/.ssh/known_hosts
            send "yes\r"
        } -re "assword:" {
            # Already has public key in ~/.ssh/known_hosts
            send "$password\r"
        } -re "Permission denied, please try again." {
            # Password not correct
            exit
        } -re "kB/s|MB/s" {
            # User equivalence already established, no password is necessary
            set timeout -1
        } -re "file list ..." {
            # rsync started
            set timeout -1
        } -re "bind: Address already in use" {
            # For local or remote port forwarding
            set timeout -1
        } -re "Is a directory|No such file or directory" {
            exit
        } -re "Connection refused" {
            exit
        } timeout {
            exit
        } eof {
            exit
        }
}
SSH保持连接(KeepAlive)
可以使用下面的方法:

增加下面的内容到~/.ssh/config或者/etc/ssh/ssh_config:

Host *
  ServerAliveInterval 60 # in second执行下面的脚本:

while date; do sleep 10; done当要输入命令时,只需要按下ctrl-c.


参考资料
OpenSSH official site.

OpenSSH Manual Pages.

The Secure Shell(tm) Frequently Asked Questions.

SSH Tunnelling (Port Forwarding).

SSH Port Forwarding.

SSH Proxy Command -- connect.c.

Corkscrew -- tool for tunneling SSH through HTTP proxies.

SSH Host Key Protection.

SSH and ssh-agent.

The Expect Home Page.

Pexpect - a Pure Python Expect-like module.

 

ssh local port forwarding

| No Comments | No TrackBacks

1.公司只提供23 443 80 端口访问

2.FastDomain主机只提供22端口ssh访问

 

1.路由器设置端口转发: 443 -> 192.168.1.1:1080

2.路由器运行:ssh -N -g -L 1080:guduo.net:22 xxx@guduo.net

   转发所有访问路由器1080端口的请求到guduo.net的22端口

   ssh访问路由器1080端口时,实际就是访问guduo.net的22端口,可以看putty访问示例日志:

login as: xxx
xxx@192.168.1.1's password:
Last login: Fri Dec 25 08:07:06 2009 from fast22.fastdomain.com

[xxx@fast22 /home/xxx]
$

3.本地通过plink连接路由器再连接FastDomain建立代理访问:

d:\green_soft\putty\plink.exe -N xxx@路由器WAN -P 443 -pw "xxx_pw" -D 127.0.0.1:1080

 

如果我在FastDomain购买了Dedicated IP,是否可以通过

ssh -N -g -L 8000:localhost:22 xxx@localhost 来直接开启一个8000端口的ssh服务呢?

 

路由器上测试:


~ # ssh -N -g -L 1080:192.168.1.1:80 root@192.168.1.1
root@192.168.1.1's password:

将1080也直接指向httpd的80服务~

 

ssh -N -g -L 1080:guduo.net:22 xxx@guduo.net
所有对本地的1080端口的访问都通过guduo.net被转发到guduo.net的22端口
ssh -N -g -L 1080:guduo.net:22 root@127.0.0.1
所有对本地的1080端口的访问都通过127.0.0.1被转发到guduo.net的22端口

 

zz From http://zhigang.org/wiki/SSH

本地映射(Local Forward)
$ ssh -f -g -A -X -N -T -L 1234:remote-host2:5678 user@remote-host或者通过修改ssh的配置文件:
$ cat ~/.ssh/config
Host remote-host
     Hostname x.x.x.x (your remote host IP)
     LocalForward 1234:remote-host2:5678
     User user
$ ssh user@remote-host所有对本地1234端口的访问都通过remote-host被转发到remote-host2的5678端口。有些DMZ中只开放sshd的22端口,通过本地映射,你可以访问远程计算机上的所有服务

 

About this Archive

This page is an archive of recent entries in the Soft category.

Mobile is the previous category.

Stock is the next category.

Find recent content on the main index or look in the archives to find all content.