文章來源 : Wireshark圖解教程(簡介、抓包、過濾器)配置
Wireshark是世界上最流行的網絡分析工具。這個強大的工具可以捕捉網絡中的數據,並為用戶提供關於網絡和上層協議的各種信息。與很多其他網 絡工具一樣,Wireshark也使用pcap network library來進行封包捕捉。可破解局 域網內QQ、郵箱、msn、賬號等的密碼!!
在成功運行Wireshark之後,我們就可以進入下一步,更進一步了解這個強大的工具。
1: //
2: // 調用 jIE Class
3: //
4: jIE MyBrowser;
5: private void CreateIE()
6: {
7: MyBrowser = new jIE();
8: Win32.SetParent(MyBrowser.HWND, pnlWeb.Handle);
9:
10: MyBrowser.Browser.FullScreen = true;
11: }
12:
13: public void Navigate()
14: {
15: MyBrowser.Browser.Navigate(@"http://www.google.com.tw");
16: //webBrowser1.Navigate(MyUrl);
17: }
18:
19: private void FormBrowser_FormClosing(object sender, FormClosingEventArgs e)
20: {
21: jIE.CloseAll();
22: }
23:
24: ====================================
25:
26: class jIE : Object
27: {
28: static public List<SHDocVw.InternetExplorer> IEs = new List<SHDocVw.InternetExplorer>();
29: static public void Remove(SHDocVw.InternetExplorer ie)
30: {
31: int idx = IEs.IndexOf(ie);
32: try { IEs[idx].Quit(); }
33: catch { }
34: try { IEs.RemoveAt(idx); }
35: catch { }
36: }
37: static public void CloseAll()
38: {
39: for (int i = IEs.Count - 1; i >= 0; i--)
40: {
41: try { IEs[i].Quit(); }
42: catch { }
43: try { IEs.RemoveAt(i); }
44: catch { }
45: }
46: }
47:
48: /* 建構式 */
49: public jIE()
50: {
51: mBrowser = new SHDocVw.InternetExplorer();
52: IEs.Add(mBrowser);
53:
54: mBrowser.ToolBar = 0;
55: mBrowser.AddressBar = false;
56: mBrowser.StatusBar = false;
57: mBrowser.MenuBar = false;
58:
59: mBrowser.Visible = true;
60: mBrowser.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler(OnQuit);
61: }
62: public jIE(string URL)
63: {
64: mBrowser = new SHDocVw.InternetExplorer();
65: IEs.Add(mBrowser);
66:
67: // Win32.SetParent((System.IntPtr)MyBrowser.HWND, pnlWeb.Handle);
68:
69: mBrowser.ToolBar = 0;
70: mBrowser.AddressBar = false;
71: mBrowser.StatusBar = false;
72: mBrowser.MenuBar = false;
73:
74: //mBrowser.Width = pnlWeb.Width;
75: //mBrowser.Height = pnlWeb.Height;
76: mBrowser.Top = 0;
77: mBrowser.Left = 0;
78: mBrowser.Navigate(URL);
79: mBrowser.Visible = true;
80:
81: mBrowser.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler(OnQuit);
82: }
83:
84: /* 欄位 */
85: private SHDocVw.InternetExplorer mBrowser;
86:
87: /* 屬性 */
88: public SHDocVw.InternetExplorer Browser { get { return mBrowser; } set { mBrowser = value; } }
89: public int ToolBar { get { return mBrowser.ToolBar; } set { mBrowser.ToolBar = value; } }
90: public int Left { get { return mBrowser.Left; } set { mBrowser.Left = value; } }
91: public int Top { get { return mBrowser.Top; } set { mBrowser.Top = value; } }
92: public int Width { get { return mBrowser.Width; } set { mBrowser.Width = value; } }
93: public int Height { get { return mBrowser.Height; } set { mBrowser.Height = value; } }
94:
95: public bool AddressBar { get { return mBrowser.AddressBar; } set { mBrowser.AddressBar = value; } }
96: public bool StatusBar { get { return mBrowser.StatusBar; } set { mBrowser.StatusBar = value; } }
97: public bool MenuBar { get { return mBrowser.MenuBar; } set { mBrowser.MenuBar = value; } }
98: public bool Visible { get { return mBrowser.Visible; } set { mBrowser.Visible = value; } }
99: public System.IntPtr HWND { get { return (System.IntPtr)mBrowser.HWND; } }
100:
101: /* 方法 */
102: public void ReSize(int L, int T, int W, int H)
103: {
104: mBrowser.Width = W;
105: mBrowser.Height = H;
106: mBrowser.Top = T;
107: mBrowser.Left = L;
108: }
109:
110: /* 事件 */
111: public void OnQuit()
112: {
113: jIE.Remove(this.mBrowser);
114: }
115:
116: }
虛擬機上有四張NICs Adapter,在 ESXi 上移植OS 後,發生網卡驅動不支持現象。
看不懂又找不到問題,最後決定手動重建。
1. 到 CentOS 作業系統中刪除檔案 70-persistent-net.rules
rm -rf /etc/udev/rules.d/70-persistent-net.rules
2. 修改 /etc/sysconfig/network-scripts 下的四個檔案 ifcfg-eth0、ifcfg-eth1、ifcfg-eth2、ifcfg-eth3 (
remove MAC address
)vi /etc/sysconfig/network-scripts/ifcfg-eth0
1: DEVICE=eth0
2: TYPE=Ethernet
3: UUID=8c1b4007-428f-4fb3-89df-8a699b4b8947
4: ONBOOT=yes
5: NM_CONTROLLED=yes
6: BOOTPROTO=none
7: DEFROUTE=yes
8: IPV4_FAILURE_FATAL=yes
9: IPV6INIT=no
10: IPADDR=192.168.0.100
11: PREFIX=24
12: LAST_CONNECT=1383997776
3. 關閉該OS
sync
sync
init 0
4. 重建VM 的 Network Adapter,給予正確的Adapter Type (E1000)
5. 開啟 OS,並檢視 Network Adapter 是否正常
# 使用 ifconfig ,經過濾器,檢出包含 "eth" 的Line
ifconfig |grep eth# 使用 ifconfig ,經過濾器,檢出包含 "inet" 的Line
ifconfig |grep inet# 檢視 eth0~3 狀態
mii-tool eth0 eth1 eth2 eth3eth0: negotiated 100baseTx-FD, link ok
eth1: negotiated 100baseTx-FD, link ok
eth2: negotiated 100baseTx-FD, link ok
eth3: negotiated 100baseTx-FD, link ok6. 重啟網路
/etc/init.d/network restart
vmnic
|
MAC
|
Func
Name |
Network
Adapter |
MAC
(vmOS) |
eth
name
|
IP-Address
|
說明
| |
0
|
xx:40
|
M1
|
1
|
78
|
eth0
|
10.20.13.101/24
GW:10.20.13.1
|
接WAN1的Router LAN
| |
1
|
xx:41
|
M2
|
2
|
82
|
eth1
|
10.21.13.101/24
GW:10.21.13.1
|
接WAN2的Router LAN
| |
2
|
xx:67
|
MC
|
3
|
8c
|
eth2
|
10.30.13.100/24
| ||
3
|
xx:98
|
ST
|
4
|
96
|
eth3
|
10.40.13.101/24
| ||
4
|
xx:99
|
x
|
x
|
x
|
x
|
x
| ||
chkconfig NetworkManager offservice NetworkManager stop
# 重啟網路 #
service network restart
chkconfig –level 35 iptables off/etc/init.d/iptables stopiptables –P INPUT DROP
1: ##Add routing ip address write to routing table.
2: ##Add route table of wan2
3: ip route add 10.21.13.0/24 dev eth1 src 10.21.13.101 table wan2
4: ip route add 127.0.0.1/8 dev lo scope link table wan2
5: ip route add default via 10.21.13.1 dev eth1 table wan2
6:
7: ##Add route table of wan1
8: ip route add 10.20.13.0/24 dev eth0 src 10.20.13.101 table wan1
9: ip route add 127.0.0.1/8 dev lo scope link table wan1
10: ip route add default via 10.20.13.1 dev eth0 table wan1
11:
12: ##Add rule to route table wan1 and wan2:
13: ip rule add from 10.21.13.101 table wan2
14: ip rule add from 10.20.13.101 table wan1
15:
16: ##Replace default route ip address.
17: ip route add default scope global nexthop via 10.20.13.1 dev eth0 weight 1 nexthop via 10.21.13.1 dev eth1 weight 1
18:
About how to remove old NIC setting of CentOS 6.4.
1. Go into /etc/udev/rules.d and delete the 70-persistent-net.rules file.
2. edit /etc/sysconfig/network-scripts/ifcfg-eth0 remove MAC address then save configurations.
3. Reboot system. Done