Tag Archives: windows

使用java来测试TCP和UDP端口

刚刚写了一篇用linux测试TCP和UDP端口的文章,但是这个例子有个缺点呀:

  1. 服务器端不能够一直监听
  2. 只适用于linux环境

咱们都是追求完美的人,怎么能够让这种不完美的情况发生呢? 于是乎下面的例子诞生了。

服务器端:

$ java -cp TCP_UDP.jar pd.jexxus.ServerTest 9003
Listening on port: 9003
Client Connected: 127.0.0.1
Received UDP from 127.0.0.1:49292
Received message: Hello TCP
Connection lost: jexxus.server.ServerConnection@9f293df

客户端:

$ java -cp TCP_UDP.jar pd.jexxus.ClientTest localhost 9003
Connecting using port: 9003
Connection lost: jexxus.client.ClientConnection@1dea34f3

源代码下载src.tar ,

TCP_UDP.jar 下载:TCP_UDP.jar

Httpclient kerberos 连接windows IIS 首页

之前也写过一篇用java连接sharepooint的例子,但总是觉得代码太丑(还是我对代码有洁癖)。今天本来打算用jdk自带的包进行,无奈困难多多。最后还是用httpClient.

完整的代码在这里下载httpclient的包请自行解决。

http://php-yhjhoo.rhcloud.com/wp-content/uploads/2013/12/SSOExercises.tar.gz

只有一个java文件,所以主要的麻烦都在配置上面。所以作为一个软件开发人员,有时候懂一点infra的东西还是挺重要

先说我自己的环境,一个ubuntu 13.10 64 位桌面环境,windows enterprise 2008 R2 装在virtualbox 里面。在windows 服务器里面事先做了如下事项:

  1. 配置windows AD, 域名为javalinux.com
  2. 在windows中安装jdk,因为用到了ktab 命令(在ubuntu中当然也要安装java) ->在ubuntu下生产keytab请参考http://php-yhjhoo.rhcloud.com/archives/1189.html
  3. 在windows AD中创建用户test
  4. 安装了IIS,并且配置只有windows authentication, 如下图所示

一切准备就绪之后,配置krb5.conf 文件

[libdefaults]
	default_realm = JAVALINUX.COM
	forwardable = true

default_tkt_enctypes = aes128-cts rc4-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc
default_tgs_enctypes = aes128-cts rc4-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc
permitted_enctypes   = aes128-cts rc4-hmac des3-cbc-sha1 des-cbc-md5 des-cbc-crc

[realms]
	JAVALINUX.COM  = {
		kdc = dc.javalinux.com
		default_domain = JAVALINUX.COM
	}

[domain_realm]
	.javalinux.com = JAVALINUX.COM

注意这个文件中的大小写敏感,建议初学者要跟我的配置一模一样,测试成功之后再修改配置

配置自动登录文件

com.sun.security.jgss.login {
	com.sun.security.auth.module.Krb5LoginModule required 
	client=TRUE 
	useTicketCache=true 
	useKeyTab=true
	keyTab="/home/workspace/Kerbos_Generator/oracleSSOExercises/javalinux2.keytab"
	principal="test"
	debug=true;
};

com.sun.security.jgss.initiate {
	com.sun.security.auth.module.Krb5LoginModule required 
	client=TRUE 
	useTicketCache=true 
	useKeyTab=true
	keyTab="/home/workspace/Kerbos_Generator/oracleSSOExercises/javalinux2.keytab"
	principal="test"
	debug=true;
};

com.sun.security.jgss.accept {
	com.sun.security.auth.module.Krb5LoginModule required
	client=TRUE 
	useTicketCache=true 
	useKeyTab=true
	keyTab="/home/workspace/Kerbos_Generator/oracleSSOExercises/javalinux2.keytab"
	principal="test"
	debug=true;
};

生成keytab文件, 需要在window服务器上执行

ktab -a test@JAVALINUX.COM Password	-k javalinux2.keytab

ktab 命令是一个在$jdk_home/bin下面的一个命令,目前还没有发现在linux下的版本。

最后需要注意的是配置文件中的标点符号,大小写敏感的问题

 

 

ClientKerberosAuthentication跑过之后的例子输出如下:

Java config name: /home/yhjhoo/workspace/Kerbos_Generator/oracleSSOExercises/krb5.conf
Loaded from Java config
Debug is  true storeKey false useTicketCache true useKeyTab true doNotPrompt false ticketCache is null isInitiator true KeyTab is /home/yhjhoo/workspace/Kerbos_Generator/oracleSSOExercises/javalinux2.keytab refreshKrb5Config is false principal is test tryFirstPass is false useFirstPass is false storePass is false clearPass is false
Acquire TGT from Cache
>>>KinitOptions cache name is /tmp/krb5cc_1000
Principal is test@JAVALINUX.COM
null credentials from Ticket Cache
>>> KeyTabInputStream, readName(): JAVALINUX.COM
>>> KeyTabInputStream, readName(): test
>>> KeyTab: load() entry length: 52; type: 17
>>> KeyTabInputStream, readName(): JAVALINUX.COM
>>> KeyTabInputStream, readName(): test
>>> KeyTab: load() entry length: 52; type: 23
>>> KeyTabInputStream, readName(): JAVALINUX.COM
>>> KeyTabInputStream, readName(): test
>>> KeyTab: load() entry length: 60; type: 16
>>> KeyTabInputStream, readName(): JAVALINUX.COM
>>> KeyTabInputStream, readName(): test
>>> KeyTab: load() entry length: 44; type: 3
>>> KeyTabInputStream, readName(): JAVALINUX.COM
>>> KeyTabInputStream, readName(): test
>>> KeyTab: load() entry length: 44; type: 1
Added key: 1version: 1
Added key: 3version: 1
Added key: 16version: 1
Added key: 23version: 1
Added key: 17version: 1
Ordering keys wrt default_tkt_enctypes list
default etypes for default_tkt_enctypes: 17 23 16 3 1.
>>> KdcAccessibility: reset
Added key: 1version: 1
Added key: 3version: 1
Added key: 16version: 1
Added key: 23version: 1
Added key: 17version: 1
Ordering keys wrt default_tkt_enctypes list
default etypes for default_tkt_enctypes: 17 23 16 3 1.
default etypes for default_tkt_enctypes: 17 23 16 3 1.
>>> KrbAsReq creating message
>>> KrbKdcReq send: kdc=dc.javalinux.com UDP:88, timeout=30000, number of retries =3, #bytes=148
>>> KDCCommunication: kdc=dc.javalinux.com UDP:88, timeout=30000,Attempt =1, #bytes=148
>>> KrbKdcReq send: #bytes read=215
>>>Pre-Authentication Data:
	 PA-DATA type = 19
	 PA-ETYPE-INFO2 etype = 17, salt = JAVALINUX.COMtest, s2kparams = null
	 PA-ETYPE-INFO2 etype = 23, salt = null, s2kparams = null
	 PA-ETYPE-INFO2 etype = 3, salt = JAVALINUX.COMtest, s2kparams = null

>>>Pre-Authentication Data:
	 PA-DATA type = 2
	 PA-ENC-TIMESTAMP
>>>Pre-Authentication Data:
	 PA-DATA type = 16

>>>Pre-Authentication Data:
	 PA-DATA type = 15

>>> KdcAccessibility: remove dc.javalinux.com
>>> KDCRep: init() encoding tag is 126 req type is 11
>>>KRBError:
	 sTime is Sun Dec 01 17:39:46 SGT 2013 1385890786000
	 suSec is 659764
	 error code is 25
	 error Message is Additional pre-authentication required
	 realm is JAVALINUX.COM
	 sname is krbtgt/JAVALINUX.COM
	 eData provided.
	 msgType is 30
>>>Pre-Authentication Data:
	 PA-DATA type = 19
	 PA-ETYPE-INFO2 etype = 17, salt = JAVALINUX.COMtest, s2kparams = null
	 PA-ETYPE-INFO2 etype = 23, salt = null, s2kparams = null
	 PA-ETYPE-INFO2 etype = 3, salt = JAVALINUX.COMtest, s2kparams = null

>>>Pre-Authentication Data:
	 PA-DATA type = 2
	 PA-ENC-TIMESTAMP
>>>Pre-Authentication Data:
	 PA-DATA type = 16

>>>Pre-Authentication Data:
	 PA-DATA type = 15

KrbAsReqBuilder: PREAUTH FAILED/REQ, re-send AS-REQ
default etypes for default_tkt_enctypes: 17 23 16 3 1.
Added key: 1version: 1
Added key: 3version: 1
Added key: 16version: 1
Added key: 23version: 1
Added key: 17version: 1
Ordering keys wrt default_tkt_enctypes list
default etypes for default_tkt_enctypes: 17 23 16 3 1.
Added key: 1version: 1
Added key: 3version: 1
Added key: 16version: 1
Added key: 23version: 1
Added key: 17version: 1
Ordering keys wrt default_tkt_enctypes list
default etypes for default_tkt_enctypes: 17 23 16 3 1.
default etypes for default_tkt_enctypes: 17 23 16 3 1.
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbAsReq creating message
>>> KrbKdcReq send: kdc=dc.javalinux.com UDP:88, timeout=30000, number of retries =3, #bytes=235
>>> KDCCommunication: kdc=dc.javalinux.com UDP:88, timeout=30000,Attempt =1, #bytes=235
>>> KrbKdcReq send: #bytes read=1340
>>> KdcAccessibility: remove dc.javalinux.com
Added key: 1version: 1
Added key: 3version: 1
Added key: 16version: 1
Added key: 23version: 1
Added key: 17version: 1
Ordering keys wrt default_tkt_enctypes list
default etypes for default_tkt_enctypes: 17 23 16 3 1.
Added key: 1version: 1
Added key: 3version: 1
Added key: 16version: 1
Added key: 23version: 1
Added key: 17version: 1
Ordering keys wrt default_tkt_enctypes list
default etypes for default_tkt_enctypes: 17 23 16 3 1.
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbAsRep cons in KrbAsReq.getReply test
principal is test@JAVALINUX.COM
Will use keytab
Commit Succeeded 

Found ticket for test@JAVALINUX.COM to go to krbtgt/JAVALINUX.COM@JAVALINUX.COM expiring on Mon Dec 02 03:39:46 SGT 2013
Entered Krb5Context.initSecContext with state=STATE_NEW
Service ticket not found in the subject
>>> Credentials acquireServiceCreds: same realm
default etypes for default_tgs_enctypes: 17 23 16 3 1.
>>> CksumType: sun.security.krb5.internal.crypto.RsaMd5CksumType
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbKdcReq send: kdc=dc.javalinux.com UDP:88, timeout=30000, number of retries =3, #bytes=1307
>>> KDCCommunication: kdc=dc.javalinux.com UDP:88, timeout=30000,Attempt =1, #bytes=1307
>>> KrbKdcReq send: #bytes read=1272
>>> KdcAccessibility: remove dc.javalinux.com
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
default etypes for default_tgs_enctypes: 17 23 16 3 1.
>>> CksumType: sun.security.krb5.internal.crypto.RsaMd5CksumType
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbKdcReq send: kdc=dc.javalinux.com UDP:88, timeout=30000, number of retries =3, #bytes=1306
>>> KDCCommunication: kdc=dc.javalinux.com UDP:88, timeout=30000,Attempt =1, #bytes=1306
>>> KrbKdcReq send: #bytes read=1270
>>> KdcAccessibility: remove dc.javalinux.com
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
>>> KrbApReq: APOptions are 00100000 00000000 00000000 00000000
>>> EType: sun.security.krb5.internal.crypto.Aes128CtsHmacSha1EType
Krb5Context setting mySeqNumber to: 230256766
Created InitSecContextToken:
0000: 01 00 6E 82 09 B1 30 82   09 AD A0 03 02 01 05 A1  ..n...0.........
0010: 03 02 01 0E A2 07 03 05   00 20 00 00 00 A3 82 03  ......... ......
0020: D0 61 82 03 CC 30 82 03   C8 A0 03 02 01 05 A1 0F  .a...0..........
0030: 1B 0D 4A 41 56 41 4C 49   4E 55 58 2E 43 4F 4D A2  ..JAVALINUX.COM.
0040: 23 30 21 A0 03 02 01 00   A1 1A 30 18 1B 04 48 54  #0!.......0...HT
0050: 54 50 1B 10 64 63 2E 6A   61 76 61 6C 69 6E 75 78  TP..dc.javalinux
0060: 2E 63 6F 6D A3 82 03 89   30 82 03 85 A0 03 02 01  .com....0.......
0070: 12 A1 03 02 01 03 A2 82   03 77 04 82 03 73 C9 1C  .........w...s..
0080: 91 58 05 CC E4 26 55 C6   DE 27 B9 41 62 8A FE 68  .X...&U..'.Ab..h
0090: 6B 05 F4 D1 6C D9 A4 61   1B 02 CC DF AF 67 E4 6A  k...l..a.....g.j
00A0: D7 F0 F3 ED 27 AE ED D1   E3 54 34 00 F3 5F 27 1E  ....'....T4.._'.
00B0: 4E 6E 7E 45 B0 5A E7 1D   59 12 1B E9 48 2A B0 30  Nn.E.Z..Y...H*.0
00C0: 6D 66 8A 24 8F 58 45 5E   B4 B2 71 FB 5A F1 7A A4  mf.$.XE^..q.Z.z.
00D0: C0 42 9B 63 2A 55 36 23   FC 5F 29 E8 3F 65 4D 74  .B.c*U6#._).?eMt
00E0: BE 88 83 C9 C7 D4 2B A5   8F E9 67 53 71 92 18 70  ......+...gSq..p
00F0: F4 21 8A BB 37 2C 54 F4   A1 FA 3C F4 0A 1C 61 0D  .!..7,T...<...a.
0100: BD 69 75 08 F6 57 F6 0C   62 BE 33 4E D6 00 53 3A  .iu..W..b.3N..S:
0110: 50 D6 20 3A 2C AF 0B EA   CB 6F 4F FF EF 53 60 96  P. :,....oO..S`.
0120: 94 54 4D 66 78 74 75 F1   DC FC 9B EA B3 81 64 7C  .TMfxtu.......d.
0130: D1 6C 58 3F 67 ED D6 6F   54 C8 9B E8 1B 0B 66 20  .lX?g..oT.....f 
0140: A6 90 11 71 C6 B5 B6 4F   83 2D 6F 57 E0 2A 34 FB  ...q...O.-oW.*4.
0150: 58 50 5C 35 3A 18 81 F5   2B FE 56 9F 7E 1D D0 C5  XP\5:...+.V.....
0160: 7A 51 82 AB E9 EC 98 75   FB AF 57 CA D8 04 A7 75  zQ.....u..W....u
0170: D1 D2 A6 EC E2 C8 EC 25   7A BA D0 1A DC 7C FB 48  .......%z......H
0180: 16 F8 C6 D0 41 B3 FC 98   B1 FD C0 51 46 E2 22 93  ....A......QF.".
0190: 42 59 5C D0 03 50 4D 6B   4A 67 D9 D3 F2 46 B1 A5  BY\..PMkJg...F..
01A0: 24 4E 22 E8 99 F4 0B F3   94 26 30 4C 36 8C 64 11  $N"......&0L6.d.
01B0: 91 83 B4 E5 0B BA 35 BD   A7 1B 52 7B 47 CE 26 C6  ......5...R.G.&.
01C0: C8 6A 5A 4A 63 FC 68 08   6D 05 51 EA 48 D5 ED 30  .jZJc.h.m.Q.H..0
01D0: BC A3 71 91 14 F5 F3 63   34 3A BF 45 7E FF 18 2B  ..q....c4:.E...+
01E0: 2F 56 C1 2D E3 37 4C 62   B7 1D B1 23 9E 82 4D 15  /V.-.7Lb...#..M.
01F0: C3 FF F3 A6 48 D5 8E 14   C8 5C 59 E5 00 BF 52 F4  ....H....\Y...R.
0200: CD B7 42 1B 23 3A 5F 90   29 1B BC B2 E7 5B 6A 91  ..B.#:_.)....[j.
0210: F3 A2 CA A6 6C 80 52 1C   31 BD 89 68 E9 36 66 38  ....l.R.1..h.6f8
0220: 35 CE C9 7B 1A 1B 86 CC   5B EF F3 52 6B FF 44 2D  5.......[..Rk.D-
0230: 79 4D 03 FA C7 03 57 94   0C CF 13 58 8E 1C 2E B0  yM....W....X....
0240: B0 4F E5 BF FB CE B6 BC   07 6D 7E 61 D8 97 19 90  .O.......m.a....
0250: 18 C4 C4 51 F5 F7 0C 96   97 A7 09 03 A0 05 67 26  ...Q..........g&
0260: 48 90 E3 99 C9 E3 6C CA   60 22 53 F3 F2 08 DF B0  H.....l.`"S.....
0270: 7C 28 D3 3E 7A 30 D0 27   C1 56 7F D9 DF C9 C3 6C  .(.>z0.'.V.....l
0280: 66 D6 6A FF 59 BC FF A2   90 35 10 FB 2E BA F1 32  f.j.Y....5.....2
0290: 13 A4 39 AC BA 1E 4B 46   D3 88 CB D8 1E 7A EC B3  ..9...KF.....z..
02A0: 1D 95 02 EA 0A 0A 6A 33   52 62 0F CA 93 2D FC 00  ......j3Rb...-..
02B0: 06 D7 E3 4D 7C 20 1D A2   F8 B3 16 89 1D 80 20 19  ...M. ........ .
02C0: FE 37 55 AC 3F 2B BE 2F   FF DC 3D 82 86 2F 0D A1  .7U.?+./..=../..
02D0: 62 AF 6B F1 19 9E 9E 58   6B 92 7D 17 51 68 0B ED  b.k....Xk...Qh..
02E0: 05 5A CC E2 7B 8D 34 A8   BB F7 67 EA 34 E1 BC 38  .Z....4...g.4..8
02F0: 3D 21 E5 5F 20 64 A7 F3   16 39 03 AC D9 4A 71 02  =!._ d...9...Jq.
0300: D0 CD AA AF B9 17 A9 46   3C BD CA E8 DD 27 0E 45  .......F<....'.E
0310: 62 54 F7 CD BE 62 38 0F   C9 83 BD 02 9E 5A A2 38  bT...b8......Z.8
0320: 73 0C 48 53 55 93 FF A2   9C B2 BE D2 5A 79 D6 BF  s.HSU.......Zy..
0330: 40 49 AB F3 26 1D D6 38   7B 6A 9A 10 8B 93 0B CE  @I..&..8.j......
0340: 9E FE 49 19 6D 12 B6 BB   8C 4E 36 EF 03 AB FE D6  ..I.m....N6.....
0350: 78 27 47 BE 0B B8 B5 C0   84 C9 4C 85 C1 64 93 57  x'G.......L..d.W
0360: 3E 54 D3 C5 1D C6 00 59   3B 70 CC EC 4D 6C BD CC  >T.....Y;p..Ml..
0370: 3A 7D 1A FB AB 4D DE E1   83 4D 17 95 49 EC 86 F1  :....M...M..I...
0380: E8 DB E2 8D 05 17 B6 CE   F3 1A FE AC 45 60 1C B9  ............E`..
0390: F8 4D A0 68 6F 3C 95 A7   4A 5D 82 FD E0 58 C2 01  .M.ho<..J]...X..
03A0: 69 DD E3 5F FA C8 CB 01   DB 71 EA 19 38 F3 8E 93  i.._.....q..8...
03B0: 50 D7 E8 E1 6E 12 19 9D   24 FE 20 39 F3 75 59 C2  P...n...$. 9.uY.
03C0: 40 6A 94 16 FD C4 83 D3   A5 A2 3E 1B 7D E2 9B 5B  @j........>....[
03D0: A7 C9 77 8F 3B 49 81 5B   30 8E 53 C7 76 3F 02 87  ..w.;I.[0.S.v?..
03E0: 7A 20 5A E0 71 C6 37 1D   AB 94 CE 06 22 C6 9E DE  z Z.q.7....."...
03F0: 91 A4 82 05 C2 30 82 05   BE A0 03 02 01 11 A2 82  .....0..........
0400: 05 B5 04 82 05 B1 2A A5   51 B3 64 B2 15 E1 D4 B8  ......*.Q.d.....
0410: 00 31 46 33 EC E4 E4 1F   5C 0F 99 04 3C E7 83 68  .1F3....\...<..h
0420: 98 3C 79 F3 9D 4A CE 7E   C0 F7 23 70 CE 5F EB DD  .<y..J....#p._..
0430: 71 40 36 1E E8 B9 FD 5D   AC 9F 62 1C DC A9 1B 7F  q@6....]..b.....
0440: 5E 2F AD 6C 80 06 2F B1   E1 78 11 A5 B9 2F E9 E5  ^/.l../..x.../..
0450: C2 D6 58 9B 6A 33 13 90   FF 61 62 88 67 63 BD EC  ..X.j3...ab.gc..
0460: 5A 63 5C 2B 88 EA E9 F0   AF 78 A5 29 0E D5 DC 61  Zc\+.....x.)...a
0470: 9D 65 BA E5 6E 18 EC 89   6A 21 0F A6 DA 5A 1F D9  .e..n...j!...Z..
0480: BA 49 BA F4 E8 41 58 84   2E D5 21 56 C3 57 21 71  .I...AX...!V.W!q
0490: 69 1B E8 4C 33 05 CD D9   70 FD F2 68 2D 0A C7 42  i..L3...p..h-..B
04A0: 31 C2 25 B5 AE 83 DA DF   C9 99 66 D0 C2 7B 8E 02  1.%.......f.....
04B0: BC 9A 67 F3 66 F3 91 A0   18 B3 81 7B C8 7F 14 16  ..g.f...........
04C0: 12 B1 E0 49 7E A1 41 27   8F D6 EF 02 AA 23 9A 6E  ...I..A'.....#.n
04D0: 75 C3 49 37 FB 18 3B 0E   9C FF A0 6F A5 1A C7 D0  u.I7..;....o....
04E0: 96 CF 74 ED 0D 07 A9 57   32 69 4A B4 A2 04 15 38  ..t....W2iJ....8
04F0: C1 68 66 05 9C FF 12 97   F3 4D 70 55 3B F0 F4 91  .hf......MpU;...
0500: 58 22 95 AD 21 35 4E 8F   15 F5 70 65 08 EE 1B 3E  X"..!5N...pe...>
0510: C3 4E 9E 0E CF AC D5 37   A4 E1 1B 8A 22 34 F5 CC  .N.....7...."4..
0520: 59 CF 3F 98 D1 1A 33 C9   5F 7B CB 15 B1 90 22 76  Y.?...3._....."v
0530: F5 8E 23 E1 F9 74 B8 50   ED F0 5E 89 D5 E4 EB 03  ..#..t.P..^.....
0540: 5E FF 71 92 DA 15 DE 29   ED 12 04 8B 68 E3 C9 C3  ^.q....)....h...
0550: EF DF 8B 31 B7 52 16 5F   2E C8 D9 4B 62 83 94 BB  ...1.R._...Kb...
0560: E3 E7 C6 2C CD E7 C8 F0   31 2F 2F 26 20 E3 08 7A  ...,....1//& ..z
0570: 93 9A 4D 7A 12 D3 B3 B2   A9 41 FE 3C 48 02 F1 32  ..Mz.....A.<H..2
0580: FF BB 75 A0 81 B1 27 AB   FE 94 10 9D 8B 18 01 95  ..u...'.........
0590: 49 BD BD 2B 3D C2 8C 09   33 C8 27 50 E4 E6 CA 2B  I..+=...3.'P...+
05A0: 13 6C 3E 0C B9 22 F8 9E   36 0E 41 83 08 E9 16 00  .l>.."..6.A.....
05B0: FA CB 51 37 B1 54 01 E3   61 17 AA 30 5C D5 16 77  ..Q7.T..a..0\..w
05C0: 28 91 68 09 2B A6 53 8D   C5 5A BE 20 FB E2 CF B7  (.h.+.S..Z. ....
05D0: 3E 0D 72 3D 17 50 E3 B6   29 B1 8C A2 E2 E4 01 D8  >.r=.P..).......
05E0: BF 63 ED 52 47 F1 B0 45   16 D9 97 A8 DB 44 03 BD  .c.RG..E.....D..
05F0: E1 D2 B6 D5 89 3F C8 43   7B AA D5 D5 E9 A9 33 F3  .....?.C......3.
0600: 4B F5 84 1C D5 EF 26 CE   45 F0 86 96 6E 44 88 CB  K.....&.E...nD..
0610: 41 DD 3E 5B 70 C0 72 34   90 3F 50 6E AB 12 96 41  A.>[p.r4.?Pn...A
0620: 41 F3 12 C0 70 6E 38 0C   04 59 CB DA DB 3F 44 42  A...pn8..Y...?DB
0630: 6F 4B 8F 52 5D A5 3D 82   46 ED EB E5 E9 E8 01 6A  oK.R].=.F......j
0640: EF 59 66 42 8E 52 99 CC   7C CE 2A 29 01 FB 8D 60  .YfB.R....*)...`
0650: B2 FF 51 5B 72 0F 03 C4   81 86 2F 52 37 C9 F3 FC  ..Q[r...../R7...
0660: 39 53 E9 72 F0 66 0C F9   58 F3 EF DB 91 46 B4 81  9S.r.f..X....F..
0670: E9 41 92 E6 9F 4C 42 62   86 51 7B 2D E0 05 FE 79  .A...LBb.Q.-...y
0680: C6 A8 D0 40 E6 F1 B2 1A   D6 6D 43 66 20 55 9A 4D  ...@.....mCf U.M
0690: B8 03 BD B1 65 85 AD 7D   85 E5 3B 76 AE E0 EB A4  ....e.....;v....
06A0: E4 3C EE 94 59 7B 07 13   23 0A 4C 14 98 A4 52 02  .<..Y...#.L...R.
06B0: 2C 6F 4F 56 EC 16 84 F4   BF AB 0F 14 87 E3 2E 98  ,oOV............
06C0: 9F DF C9 D3 27 84 E3 26   E5 67 74 9D EF 34 1C BA  ....'..&.gt..4..
06D0: 4A D6 15 38 84 32 B5 F9   F7 FC 0B FA D6 60 D6 EB  J..8.2.......`..
06E0: 44 6B CA 05 A3 DD 91 36   AB 75 76 C5 A1 1D C2 C8  Dk.....6.uv.....
06F0: B6 68 3F 6A AD B2 92 85   61 9F 58 4A 82 03 7A 45  .h?j....a.XJ..zE
0700: B7 42 47 5E 0F 5D A4 12   12 A7 4C 29 51 9A C8 D7  .BG^.]....L)Q...
0710: 8B 34 45 53 30 41 B3 6D   7E C7 0A B8 EF 17 22 2E  .4ES0A.m......".
0720: 9C 46 B6 B2 0E C7 5B D0   E5 E7 68 B8 24 11 39 7F  .F....[...h.$.9.
0730: DD F5 31 F0 7B B1 C2 E9   F4 02 67 FE CF D1 80 1B  ..1.......g.....
0740: 41 F0 8D 57 86 8F 3C F8   7E EE DA 48 61 F1 DB 19  A..W..<....Ha...
0750: 95 E7 BE DC 95 92 88 F7   ED 53 F6 80 3E 40 F0 CB  .........S..>@..
0760: 73 EA EC 48 C4 00 6A BB   57 00 EF C3 6D 8F C0 35  s..H..j.W...m..5
0770: A5 21 FB F9 2E 86 19 F0   FD 51 EE 7B 9D E1 3A DE  .!.......Q....:.
0780: 2E ED F5 50 9D 73 F5 6B   2C 40 05 75 73 5C 09 87  ...P.s.k,@.us\..
0790: B6 EF 38 28 EE 44 E1 A6   A2 9C DC 2C E3 23 93 74  ..8(.D.....,.#.t
07A0: 36 AE A7 12 6F 02 F3 0A   EA 76 E3 4B BD 0D EE CE  6...o....v.K....
07B0: 26 BF 3B A1 84 DF 72 FE   F9 62 4E 7E 93 30 9B C0  &.;...r..bN..0..
07C0: 7D 6C C5 7B F5 F1 F0 A2   D9 3A B4 7D D0 79 05 6F  .l.......:...y.o
07D0: 63 D6 F9 0F 92 69 17 1A   04 49 06 4F D3 4E 75 56  c....i...I.O.NuV
07E0: AA A9 1A 67 48 A1 83 E0   B6 0F 69 F6 BC 68 D2 26  ...gH.....i..h.&
07F0: D5 5A F6 6A 5B 5F C4 DF   21 59 ED 18 98 94 4E 6A  .Z.j[_..!Y....Nj
0800: 41 2B 77 4F 51 74 33 A0   FF 6B 84 39 70 60 C4 30  A+wOQt3..k.9p`.0
0810: EE 04 04 E7 B5 B0 85 F6   A8 E1 50 C2 B2 D7 38 53  ..........P...8S
0820: 0D 4A 39 2F B8 3E C2 F1   DD 2C 6A 15 9B 25 EF EB  .J9/.>...,j..%..
0830: 40 9D EB F0 B9 77 FE CE   41 14 14 5C 67 83 93 D6  @....w..A..\g...
0840: B5 6C E1 AD 1F 3B 51 DC   4F E0 F0 9C FC D1 86 1C  .l...;Q.O.......
0850: C0 5A 53 EA 5E 95 54 55   F1 4F 98 15 61 C7 03 DD  .ZS.^.TU.O..a...
0860: 46 2C 1C 96 09 AC C1 1C   57 D6 27 55 99 41 7C D4  F,......W.'U.A..
0870: 08 B7 C7 C3 AE FB E8 15   C3 02 7D 4F 64 41 A6 67  ...........OdA.g
0880: 87 21 21 D4 26 72 6F 0A   7A 0A FF 4A 27 AA E3 CE  .!!.&ro.z..J'...
0890: DF 7A DE 74 AF 13 07 48   43 5F BE D1 6B BD 73 F7  .z.t...HC_..k.s.
08A0: 73 C6 9B 07 AC 37 23 26   97 BB 81 DF 89 27 7E 17  s....7#&.....'..
08B0: 47 C8 76 21 25 89 C6 1D   14 F2 BD 7E 0F E8 5E 04  G.v!%.........^.
08C0: 9B BE 57 60 16 D2 41 3E   8A 7B B4 41 80 D6 4E A8  ..W`..A>...A..N.
08D0: 9B BF 0A CB 57 23 26 18   1F 6C BA EB 58 73 8D 43  ....W#&..l..Xs.C
08E0: 0C 30 FD 56 6D 07 98 04   46 D0 91 62 DA 96 71 0B  .0.Vm...F..b..q.
08F0: 26 CF 86 DB C2 46 BA B6   A7 36 80 F4 DE 34 57 C3  &....F...6...4W.
0900: C6 6C BA 5F 0B 32 85 34   27 A6 92 0A 13 89 1C B1  .l._.2.4'.......
0910: C3 2E 60 B8 05 F8 3F 04   89 13 00 68 5F 84 57 68  ..`...?....h_.Wh
0920: 91 D2 F3 FA FF 01 52 9E   CD 75 63 79 10 22 CF 0D  ......R..ucy."..
0930: 98 36 5E 90 28 52 CC 06   9E F4 A5 7E 5F 8E 3A AB  .6^.(R......_.:.
0940: DD 30 95 87 1D D8 9A 7F   0F F1 55 00 28 17 70 D0  .0........U.(.p.
0950: 5B 8B B1 AE 1C 38 09 15   B4 0C 02 28 F8 BC E2 67  [....8.....(...g
0960: FD 78 FE 61 BF 36 9C 5A   DF 2E 8B 72 0A F7 66 24  .x.a.6.Z...r..f$
0970: 74 CD 4C 9D A9 13 CE 28   63 AA DF 84 FC 6A 3A D0  t.L....(c....j:.
0980: 06 10 57 DA 92 34 81 8A   ED 17 99 A4 3E 23 25 67  ..W..4......>#%g
0990: 8D EA 58 FB 7E 45 48 F4   5F 21 80 8B A3 E7 F2 E0  ..X..EH._!......
09A0: 31 33 33 01 78 2F 28 F9   B0 D0 4A DB 81 40 D2 57  133.x/(...J..@.W
09B0: 9C C4 30 C7 2A 80 3B                               ..0.*.;

----------------------------------------
HTTP/1.1 200 OK
----------------------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IIS7</title>
<style type="text/css">
<!--
body {
	color:#000000;
	background-color:#B3B3B3;
	margin:0;
}

#container {
	margin-left:auto;
	margin-right:auto;
	text-align:center;
	}

a img {
	border:none;
}

-->
</style>
</head>
<body>
<div id="container">
<a href="http://go.microsoft.com/fwlink/?linkid=66138&amp;clcid=0x409"><img src="welcome.png" alt="IIS7" width="571" height="411" /></a>
</div>
</body>
</html>
----------------------------------------

让你的U盘同时支持linux , mac 和windows

很简单,免去了你去买几百块U盘的麻烦。

使用exFAT格式, 最新的mac和windows 已经默认支持exFAT, linux(ubuntu)下的 解决方案也很简单

sudo apt-get install exfat-fuse

 

exFATExtended File Allocation Table),又名FAT64,是一种特别适合于闪存文件系统,最先从微软Windows Embedded CE 6.0导入这种文件系统,后来再延伸到Windows Vista Service Pack 1操作系统中[3]。由于NTFS文件系统的一些数据格式规定所限,对快存存储器而言exFAT显得更具优势。

关于exFAT格式的详细介绍请看这里http://zh.wikipedia.org/wiki/ExFAT