官方網站:http://www.maxmind.com/app/ip-location
本地下載:csharp2_1.8
※請自行去官方網站下載最新版的 GeoIP.dat。
本地下載的檔案包含範例,如下圖所示:
只需利用 GeoIP 的 API 功能即可輕鬆取的 IP 相關資訊。
.Net 可以輕鬆利用 WebBrowser 製作網頁截圖功能!
程式碼如下:
private void Main_Load(object sender, EventArgs e)
{
WebBrowser wb = new WebBrowser();
this.Controls.Add(wb);
wb.Url = new Uri("http://www.google.com.tw/"); //要截取的網址
while (wb.ReadyState != WebBrowserReadyState.Complete) Application.DoEvents(); //偵測網頁是否載入完畢
//如果寬度小於1024,就以1024為寬度,高度自動偵測
wb.Width = 1024;
Application.DoEvents();
wb.Width = wb.Document.Body.ScrollRectangle.Width;
if (wb.Width < 1024) wb.Width = 1024;
Application.DoEvents();
wb.Height = wb.Document.Body.ScrollRectangle.Height;
Application.DoEvents();
//截圖儲存為圖片
using (Bitmap bmp = new Bitmap(wb.Width, wb.Height))
{
wb.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
EncoderParameters myEncoderParameters = new EncoderParameters(1);
myEncoderParameters.Param[0] = new EncoderParameter(System.Drawing.Imaging.Encoder.Compression, 100);
bmp.Save("儲存檔案路徑", GetEncoder(System.Drawing.Imaging.ImageFormat.Jpeg), myEncoderParameters);
}
}
/// <summary>
/// IMG編碼產生
/// </summary>
/// <param name="format"></param>
/// <returns></returns>
private ImageCodecInfo GetEncoder(ImageFormat format)
{
ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders();
foreach (ImageCodecInfo codec in codecs)
{
if (codec.FormatID == format.Guid) return codec;
}
return null;
}.Net 只需要利用 NGif 就可以輕鬆讀取及編輯GIF檔案。
官方網站下載:http://www.codeproject.com/Articles/11505/NGif-Animated-GIF-Encoder-for-NET
本地下載:NGif
將 GIF 圖檔,每個影格取出來,並且儲存,範例程式如下:
using Gif.Components;
GifDecoder gd = new GifDecoder();
gd.Read("檔案路徑");
for (int i = 0; i < gd.GetFrameCount(); i++)
{
Image image = gd.GetFrame(i);
image.Save("儲存路徑");
}以下為 Hash DoS 攻擊程式,只供 學術研究 及 測試使用,請勿用於攻擊他人伺服器,否則一切責任由攻擊者負責!
測試攻擊程式下載:DoS
以下為 Hash DoS 攻擊方式說明,只供 學術研究 及 測試使用,請勿用於攻擊他人伺服器,否則一切責任由攻擊者負責!
只需利用此字串,帶入到網址後方即可!或者使用POST的方式發送。
例如: http://xxxx.com.tw?index.aspx?3QBZJK5ZX=&NEUQ7BWAV6=&6902D0YP6J=...
2011 年終的 28C3 最有新聞性的演講大概就屬 Hash DoS 攻擊,相關連結:
- Effective Denial of Service attacks against web application platforms
- n.runs-SA-2011.004 - web programming languages and platforms - DoS through hash table
- Effective DoS attacks against Web Application Plattforms
目前發現所有 Web 程式都會受到 Hash table 漏洞影響,微軟也緊急出OOB patch。
這個攻擊原理其實在2003 的usenix security 就提出只是當時只有沒有引起太大的注意。
簡單說就是產生大量的 Hash collision 的 key,就會塞到同一個 bucket,讓 hash搜尋時間變成 O(n^2),很快就可以把 CPU 資源吃完。
本篇利用 csid3lib 讀取 MP3 中的 ID3 檔案資訊。
官方網站下載:http://sourceforge.net/projects/csid3lib/
本地下載:csid3lib-v0.5-src
本篇利用 ExifMetadata 讀取 圖片 內的 EXIF 資訊。
本地下載:ExifMetadata
本篇利用 ExifLibrary v0.16 讀取 圖片 內的 EXIF 資訊。
官方網站下載:http://code.google.com/p/exiflibrary/
本地下載:ExifLibrary_v0.16
C# 如果要製作,簡體繁體轉換,只需要參考 Microsoft.VisualBasic 即可方便製作簡繁轉換。
程式碼如下:
using Microsoft.VisualBasic;
//將繁體中文字轉換成簡體中文
string str = Strings.StrConv("繁體轉簡體測試", VbStrConv.SimplifiedChinese, 2052);
//簡體中文 (GB2312) 系統的 LocaleID (LCID) 為 2052
Console.WriteLine(str);
//將簡體中文字轉換成繁體中文
str = Strings.StrConv(str, VbStrConv.TraditionalChinese, 1028);
//繁體中文 (Big5) 系統的 LocaleID (LCID) 為 1028
Console.WriteLine(str);