分类目录归档:网络技巧

Windows7 环境下配置 Teredo 接入 IPv6

按:Teredo 是一种使用公共网关的 IPv4/IPv6 转换机制,它目前只用于直接通过 IP 地址发起连接,因此你的浏览器不会通过域名连接 IPv6,也就是说该网络配置无益于访问 IPv6 网站。如果一定要通过该方案访问 IPv6 网站,请自行于 hosts 文件中添加相关 IPv6 解析记录。

配置的网络环境:中国电信 2M ADSL 路由器拨号上网,Windows 7 64位操作系统。

以下是隧道方式(Teredo)连接 IPv6 的设置方法:

1.首先,如果你以前配置过 IPv6 的话,最好能把那些配置都还原回来。我这个方案不需要安装任何第三方软件,所以如果你安装过什么隧道软件的话,现在就可以卸掉了。如果经过以下配置,还不能配置成功的话,建议重新安装操作系统,用一个干净的系统开始配置。

2.使用管理员权限运行 cmd,打开命令行窗口。

3.根据使用路由器的方式不同,选择运行不同的命令:
netsh int ter set state client (PPPoE直拨上网选用)
netsh int ter set state enterpriseclient(通过路由器上网选用)

4.设置隧道:
netsh int teredo set state client teredo-debian.remlab.net
或者:
netsh int teredo set state enterpriseclient teredo-debian.remlab.net

5.这样就开启了 IPv6 隧道了。Cmd 中运行 ipconfig 看看,有这样的一串以 2001: 开头的 IPv6 地址的话,就说明已经配置成功了。没有的话,重启一下电脑看看。

部分Public Teredo Servers:

  • teredo.remlab.net / teredo-debian.remlab.net (France)
  • teredo.autotrans.consulintel.com (Spain)
  • teredo.ipv6.microsoft.com (USA, Redmond) (default for WindowsXP/2003/Vista/2008 OS)
  • teredo.ngix.ne.kr (South Korea)
  • teredo.managemydedi.com (USA, Chicago)
  • teredo.trex.fi (Finland)

参考资料
Windows 7,中国电信ADSL的环境下配置IPv6
Teredo tunneling

修订历史
2019-01-22:修改了标题,精简了内容,补充了 Teredo 使用提示

How To Fix iOS6 Wi-Fi Error(如何解决iOS6Wi-Fi无法连接的问题)

Many people has reported that after iOS 6 installation the Wi-Fi is disconnecting again and again and giving error and requires to reconnect. When I faced this error I thought there is something wrong on my Wi-Fi but when I checked the visitors on different blogs I found lot of people talking about iOS wifi problem. How To Fix iOS 6 wifi Error Go to Settings => Wi-Fi => Select the Wi-Fi Network you are connected. Scroll down to the bottom of the screen and tap and set : HTTP Proxy Auto

打开设置 =>WiFi =>进入你选择的WiFi的设置 =>滚动屏幕到下方 =>HTTP代理选择自动

修改SSH端口手册

vi /etc/ssh/sshd_config

找到# Port 22Port 22,修改为

Port 22
Port 31111  # 修改为你想设置的新端口,建议在1024~65535之间

接下来测试 sshd 配置文件

sshd -t

如果没有问题就可以重启 sshd 服务了,在重启前请再次确认防火墙已经放行新的端口,SELinux 是关闭的或者相关设置也是正确的

sestatus # 确认 SELinux 的状态是 disable
service sshd restart

重启完毕后,如果新端口可以接通,就可以把 22 端口注释掉再重启服务,就完成 SSH 修改端口的操作了

参考资料
How to change the ssh port on Linux or Unix server

建立只能使用ssh的TCP转发功能的系统账户

其实 ssh 可以连接到 sshd 但是不执行远程命令(默认是启动用户设定的 shell ),使用 -N 参数即可。

在服务器上建一个 username :
添加用户:useradd -s /bin/false  username,将用户的shell设置成/bin/false。这样用户就无法与系统进行交互。
设置密码:passwd username

小技巧:
也可以使用 /usr/bin/passwd 作为用户的 shell ,这样用户就可以通过登录而来自主修改密码。需要注意的是,需要将 /usr/bin/passwd 这一行写进 /etc/shells文件。
sshd 认证通后之后,会检查设定的 shell 是否登记在 /etc/shells 文件中,若已经登记,则fork自己,然后fork出来的子进程再exec 设定的 shell 。而 ssh 的 -N 参数,则是告诉 sshd 不需要执行 shell。

建立Tunnel:

ssh -D 1080 -qfnN    username@hostname

输入密码即可使用(也可以用key认证)。

Windows的话,可以使用plink.exe或者MyEnTunnel(MyEnTunnel 本质上也是使用plink.exe来建立Tunnel)。

此时账号username 可以通过sshd的认证使用 TcpForwarding ,但是不能运行 shell,不能与系统交互。刚好可以用来为朋友提供国外的代理翻墙。

参数详解:
-D 1080 建立动态Tunnel,监听在本地1080端口;
-q  安静模式;
-f   ssh在后台运行,即认证之后,ssh退居后台;
-n  将 stdio 重定向到 /dev/null,与-f配合使用;
-N  不运行远程程序,即通知 sshd 不运行设定的 shell。

分来了,号忘了……

又到一年查分时,可惜那可怜的准考证早已被扫如了垃圾堆中。于是破解准考证号的大戏拉开帷幕。

综合网上资料其实对准考证稍加组合还是可以暴力破解出来的。方法大致如下:

1、前3位是省份代码,一般都是该省省会身份证号的前3位;

2、第4-5位是学校代码;

3、第6位是学校的校区代码,有的从0开始,有的从1开始,甚至有的学校会有间隔,很不规律;

4、第7-8位是考试年份,例如2012年的就是12;

5、第9位是该年中第几次四六级考试,例如2012年6月份的考试是1;

6、第10位是四六级类别,四级是1,六级是2;

7、第11-13位是考场号,例如第1考场就是001;

8、第14-15位是座位号,例如1号座位就是01.

前十位是可以靠查资料组合出来的,至于后面较为随机的5位数就要交给计算机来办了。

以下以python为例,示范爆破最后5位准考号。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
import re
import sys

def main():
print(“===========================================”)
print(“Welcome to run this CET score query program”)
print(” Created by messense<http://messense.me>”)
print(“===========================================\n\n”)
code = raw_input(“Please type the first 10 number of your ID(like 6100111211): “)
start_room = int(raw_input(“Please type 3 number of starting exam room(like 001): “))
stop_room = int(raw_input(“Please type 3 number of ending exam room(like 100): “))
seats = int(raw_input(“Please type the count of people of one room(like 30): “))
name = unicode(raw_input(“Please type your name: “), “gb2312”).encode(“utf-8”)
print(“Query name is %s” % urllib2.quote(name))

url = “http://www.chsi.com.cn/cet/query?zkzh=%s&xm=%s”
current_room = start_room
current_room_str = ”

while current_room if current_room < 10: current_room_str = ’00’ + str(current_room) elif current_room >= 10 and current_room < 100:
current_room_str = ‘0’ + str(current_room)
else:
current_room_str = str(current_room)
current_seat = 1
current_seat_str = ”
while current_seat if current_seat < 10:
current_seat_str = ‘0’ + str(current_seat)
else:
current_seat_str = str(current_seat)
num = “%s%s%s” % (code, current_room_str, current_seat_str)
query_url = url % (num, urllib2.quote(name))
print(“Now querying ID %s” % num)
try:
req = urllib2.Request(query_url)
req.add_header(“Referer”, “http://www.chsi.com.cn/cet/”)
html = urllib2.urlopen(req).read()
except:
print(“Open query url(%s) error” % query_url)
continue
if html.find(‘cetTable’) == -1:
print(“Can not find your score, try next.”)
current_seat += 1
else:
print(“\n\nWow! I’ve found your score!”)
print(“Your ID is %s” % num)
print(“Please open http://www.chsi.com.cn/cet/ with your browser then type the ID and your name to view your CET score.”)
sys.exit(1)

current_room += 1

if __name__ == ‘__main__’:
main()

以上抛砖引玉希望同样悲剧的童鞋早日找回自己的准考证号,并且再次强烈谴责只提供准考证查分的2B系统!!!