• 大小: 717KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: C#
  • 标签: FiddlerCore  证书  代理  

资源简介

(想免费提供,但是资源分没有0的选项不好意思)在网上找了好多关于FiddlerCore的抓包工具,但是大多都要收费,所以自己根据已有代码和自己这几天的学习,写了一个。参考https://thebot.net/threads/c-source-fiddler-core-example-https-hotmail-captcha.283784/ [C#][Source] Fiddler Core Example, Https, Hotmail Captcha http://fiddler.wikidot.com/fiddlercore-demo 此代码提供了两种方式抓取Session回话,1.通过使用系统代理,2.通过自定义代理WebProxy.Start(8877); 使用时代码的第35和39行为系统代理设置。

资源截图

代码片段和文件信息

using Fiddler;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using FiddlerCoreTest.FiddlerCore;
namespace FiddlerCoreTest
{
    class Program
    {
        static void Main(string[] args)
        {

          
            #region AttachEventListeners
            //使用FiddlerCore中的事件可以适当的与UI线程同步(系统的线程是不知道页面是如何变化的)
            //如果线程不安全,可以采用Monitor加锁的方式解决问题
            Fiddler.FiddlerApplication.OnNotification += FiddlerCoreEventHandler.FiddlerApplicaiton_OnNotficaiton;
            Fiddler.FiddlerApplication.Log.OnLogString += FiddlerCoreEventHandler.FiddlerApplication_Log_OnLogString;

            Fiddler.FiddlerApplication.BeforeRequest += FiddlerCoreEventHandler.FiddlerApplicaiton_BeforeRequest;
            //Fiddler.FiddlerApplication.BeforeResponse += FiddlerCoreEventHandler.FiddlerApplicaiton_BeforeResponse;

            Fiddler.FiddlerApplication.AfterSessionComplete += FiddlerCoreEventHandler.FiddlerApplication_AfterSessionComplete;

            //使用Ctrl+c退出当前应用程序时触发此事件
            Console.CancelKeyPress += new ConsoleCancelEventHandler(FiddlerAssistMethod.Console_CancelKeyPress);
            #endregion AttachEventListeners

            Console.WriteLine(String.Format(“Starting {0}...“ Fiddler.FiddlerApplication.GetVersionString()));

            //为了演示的目的,我们将禁止连接使用无效证书的HTTPS站点。
            //Fiddler.CONFIG.IgnoreServerCertErrors = false;

            //因为我们选择了解密HTTPS通信,makecert.exe必须
            //在应用程序文件夹中出现。
            //Fiddler.FiddlerApplication.Startup(8877 true true);

            WebProxy.Start(8877);

            #region  选择操作 c、l、q


            Console.WriteLine(“Hit CTRL+C to end session.“);

            bool bDone = false;
            do
            {
                Console.WriteLine(“Enter a command [C=clear; L=list Q=quit]:“);
                Console.Write(“>“);
                ConsoleKeyInfo cki = Console.ReadKey();
                Console.WriteLine();
                switch (cki.KeyChar)
                {
                    case ‘c‘:
                        Monitor.Enter(FiddlerCoreEventHandler.oAllSessions);
                        FiddlerCoreEventHandler.oAllSessions.Clear();
                        Monitor.Exit(FiddlerCoreEventHandler.oAllSessions);
                        FiddlerAssistMethod.WriteCommandResponse(“Clear...“);
                        break;

                    case ‘l‘:
                        FiddlerAssistMethod.WriteSessionList(FiddlerCoreEventHandler.oAllSessions);
                        break;

                    case ‘q‘:
                        bDone = true;
                        FiddlerAssistMethod.DoQuit();
                        break;
                }
            } while (!bDone);
        }
            #endregion

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-16 11:03  FiddlerCoreTest\
     文件         187  2018-04-13 10:14  FiddlerCoreTest\App.config
     目录           0  2018-04-16 11:03  FiddlerCoreTest\FiddlerCore\
     文件        3291  2018-04-13 17:42  FiddlerCoreTest\FiddlerCore\Autoclicker.cs
     文件        1192  2018-04-14 13:47  FiddlerCoreTest\FiddlerCore\Certificate.cs
     文件        7469  2018-04-13 17:45  FiddlerCoreTest\FiddlerCore\CommonCla.cs
     文件        3280  2018-04-13 17:29  FiddlerCoreTest\FiddlerCore\FiddlerAssistMethod.cs
     文件        3124  2018-04-13 17:37  FiddlerCoreTest\FiddlerCore\FiddlerEventHandlerTingTing.cs
     文件        1686  2018-04-13 17:49  FiddlerCoreTest\FiddlerCore\WebProxy.cs
     文件        3990  2018-04-13 17:50  FiddlerCoreTest\FiddlerCoreTest.csproj
     文件        3168  2018-04-16 10:37  FiddlerCoreTest\Program.cs
     目录           0  2018-04-16 11:03  FiddlerCoreTest\Properties\
     文件        1372  2018-04-13 10:14  FiddlerCoreTest\Properties\AssemblyInfo.cs
     目录           0  2018-04-16 11:03  FiddlerCoreTest\SourceCodeFile\
     文件        2883  2018-04-13 17:28  FiddlerCoreTest\SourceCodeFile\源代码FiddlerCoreCode.txt
     目录           0  2018-04-16 11:03  FiddlerCoreTest\bin\
     目录           0  2018-04-16 11:03  FiddlerCoreTest\bin\Debug\
     文件      479744  2018-04-10 17:20  FiddlerCoreTest\bin\Debug\BCMakeCert.dll
     文件       36680  2018-04-10 17:20  FiddlerCoreTest\bin\Debug\CertMaker.dll
     文件      405320  2018-04-10 17:20  FiddlerCoreTest\bin\Debug\FiddlerCore4.dll
     文件      369355  2018-04-10 17:20  FiddlerCoreTest\bin\Debug\FiddlerCore4.xml
     文件       15872  2018-04-16 10:37  FiddlerCoreTest\bin\Debug\FiddlerCoreTest.exe
     文件         187  2018-04-13 10:14  FiddlerCoreTest\bin\Debug\FiddlerCoreTest.exe.config
     文件       44544  2018-04-16 10:37  FiddlerCoreTest\bin\Debug\FiddlerCoreTest.pdb
     文件       23168  2018-04-16 10:39  FiddlerCoreTest\bin\Debug\FiddlerCoreTest.vshost.exe
     文件         187  2018-04-13 10:14  FiddlerCoreTest\bin\Debug\FiddlerCoreTest.vshost.exe.config
     文件         490  2013-03-18 17:00  FiddlerCoreTest\bin\Debug\FiddlerCoreTest.vshost.exe.manifest
     文件      465408  2018-03-27 10:28  FiddlerCoreTest\bin\Debug\Newtonsoft.Json.dll
     文件      469230  2018-03-27 10:28  FiddlerCoreTest\bin\Debug\Newtonsoft.Json.xml
     文件       55632  2018-04-10 17:20  FiddlerCoreTest\bin\Debug\makecert.exe
     目录           0  2018-04-16 11:03  FiddlerCoreTest\bin\Release\
............此处省略12个文件信息

评论

共有 条评论