2010年10月5日 星期二

WinPcap

WinPcap是Windows平臺下一個專業網路資料包捕獲開發包,是為Libpcap在 Windows平臺下實現資料包的捕獲而設計的。在設計WinPcap時參照了Libpcap,使用方法與LibPcap相似。使用WinPcap開發 包,可以把在Linux下基於Libpcap的程式很容易地移植到Windows平臺下。WinPcap是在BSD許可證下發佈地,它主要由加利福尼亞地 Lawrence Berkeley Laboratory開發。WinPcap地下載網址為:http://winpcap.polito.it/ 。目前有不少軟體都使用了WinPcap開發包,其中最為著名的是Ethereal。它是一個免費的網路通訊協定分析軟體,其對資料包解析的細緻程度甚至 高於業界著名的Sniffer和WildPackets;

WinPcap有三個模組構成:
第一個模組NPF(Netgroup Packet Filter),是一個虛擬裝置驅動程式檔。它的功能是過濾資料包,並把這些資料包原封不動地傳給使用者態模組,這個過程中包括了一些作業系統特有的代 碼。
第二個模組packet.dll是一組用戶級的函式程式庫,為win32平臺提供了一個公共的介面。不同版本的Windows系統都有自己的 內核模組和使用者層模組。Packet.dll用於解決這些不同。調用Packet.dll的程式可以運行在不同版本的Windows平臺上,而無需重新 編譯。
第三個模組資料包高級驅動程式庫(wpcap.dll)與作業系統無關,它提供了更加高層、抽象的函數,含有諸如產生篩檢程式,用戶級緩衝 等高級功能。

Libnet

Libnet是一個專業的網路資料包構造和發送開發包,它是一個高層次的API函式程式庫,允許開發者構造和發送網路資料包。Libnet提供了一個對底 層網路資料包進行構造、修改和發送的高級介面。它隱藏了很多底層細節,省去了很多麻煩,如多路技術、緩衝區管理、網路資料包頭資訊、位元組流順序、作業系 統相容性,以及校驗和計算問題等。Libnet主要提供了在IP層和鏈路層構造網路資料包的功能和一些非常有用的協助工具。使用Libnet可以非常輕 鬆、快捷地構造任何形式的網路資料包,開發各種各樣的網路安全應用程式,甚至非常複雜的程式。Libnet主要用C語言寫成,提供了低層網路資料包的構 造、處理和發送功能.他的主要特點是:

.高層介面:Libnet主要用C語言寫成
.資料包構造:Libnet提供了一系列的 TCP/IP資料包文的構造函數以方便使用者使用。
.資料包的處理:Libnet提供了一系列的輔助函數,利用這些輔助函數,説明使用者簡化那些 煩瑣的事務性的程式設計工作
.資料包發送:Libnet允許用戶在兩種不同的資料包發送方法中選擇。
另外Libnet允許程式獲得對資料 包的絕對的控制,其中一些是傳統的網路程式介面所不提供的。
Libnet提供兩種將資料包發送到網路的介面:原始通訊端(raw socket)介面和鏈路層(Link Layer)介面。本文選取的是鏈路層介面進行設計的。

2010年10月4日 星期一

OPENVPN Server enable NAT routing

Here you should can connect with OpenVPN server thru VPN. However general web browsing will be accomplished with direct connections that bypass the VPN.
If you want to browse web thru VPN , please continue to follow the steps below.

1. Add the following directive to the server configuration file 'server.conf'
push "redirect-gateway def1"
push "dhcp-option DNS 168.95.1.1"

2. Setting NAT routing for VPN client on server
#vi /etc/openvpn/start-nat.sh
   #!/bin/bash

   ipt="/sbin/iptables"

   # Clean the all rules
   $ipt -F
   $ipt -X
   $ipt -t nat -F
   $ipt -t nat -X

   # Enable ip_forward
   echo "1" > /proc/sys/net/ipv4/ip_forward

   # For NAT routing
   $ipt -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
   $ipt -t nat -L

#cd /etc/openvpn
#./start-nat.sh


2010年10月1日 星期五

OPENVPN Client issue for Windows

在建立connection時,出現

NOTE: could not get adapter index for \DEVICE\TCPIP_{9A17EDDE-8CCC-474E-ABE6-8DBE7DAB42CB}, status=55 : 指定的網路資源或裝置無法再使用。 

原來是因為安裝Commview的關係,只要將TAP-Win32 Adapter中的 Commview相關元件 uncheck即可.

2010年9月27日 星期一

Reverse SSH Tunnel (反向 ssh 連線)

Gmail IMAP, SMTP, POP3 設定值

IMAP
  • imap.gmail.com
  • Port: 993
  • Use SSL: Yes
SMTP
  • smtp.gmail.com
  • Port for TLS/STARTTLS: 587
  • Port for SSL: 465
POP3
  • pop.gmail.com
  • Port: 995
  • Use SSL: Yes

Meld : Diff and merge tool.

Meld is a visual diff and merge tool. You can compare two or three files and edit them in place (diffs update dynamically). You can compare two or three folders and launch file comparisons. You can browse and view a working copy from popular version control systems such such as CVS, Subversion, Bazaar-ng and Mercurial. Look at the screenshots page for more detailed features.


How to repair and clone disk with ddrescue

  ddrescue  is a tool that can be used to repair and clone disks on a  Linux system . This includes hard drives, partitions, DVD discs, flas...