Giter Club home page Giter Club logo

cycletls-dotnet's Introduction

Project is under development

CycleTLS-dotnet

.NET client for https://github.com/Danny-Dasilva/CycleTLS to spoof TLS/JA3 fingerprints.

.netstandard2.0 supported

Installation

After some time I'll release nuget package.

Right now you need npm install cycletls in any directory and copy dist from node_modules/cycletls to directory with your solution.

Usage

Potential problem: you need to kill index or index.exe manually if your Visual Studio created this as not child process. This problem will be solved soon.

using CycleTLS;
using Microsoft.Extensions.Logging;

var logger = LoggerFactory.Create(b => b.AddConsole()).CreateLogger<CycleTLSClient>();

CycleTLSClient client = new CycleTLSClient(logger);

client.InitializeServerAndClient();

// To find your ja3 you can use https://kawayiyi.com/tls or https://tls.peet.ws/
// Lib uses default Ja3 = "771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-51-57-47-53-10,0-23-65281-10-11-35-16-5-51-43-13-45-28-21,29-23-24-25-256-257,0"
// Lib uses default UserAgent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36"

//client.DefaultRequestOptions.Ja3 = "";
//client.DefaultRequestOptions.UserAgent = "";

// You can use httpbin.org service for your tests. It just echos your requests.

try
{
    CycleTLSRequestOptions options = new CycleTLSRequestOptions()
    {
        Url = "https://httpbin.org/cookies",
        Method = HttpMethod.Get.Method,
        Cookies = new List<System.Net.Cookie>()
        {
            new System.Net.Cookie("cookiename", "cookievalue")
        }
        //Body = ""
        //Proxy = "http://USERNAME:PASSWORD@IP:PORT",
        //Headers = new Dictionary<string, string>() { { "authorization", authToken } }
    };
    CycleTLSResponse response = await client.SendAsync(options);
    Console.WriteLine(response.Body);

    // Or just:
    Console.WriteLine((await client.SendAsync(HttpMethod.Get, "https://kawayiyi.com/tls")).Body);
}
catch (Exception e)
{
    Console.WriteLine("Request Failed: " + e.Message);
    throw;
}

Options class:

public class CycleTLSRequestOptions
{
    public string Url { get; set; };
    public string Method { get; set; };
    public Dictionary<string, string> Headers { get; set; };
    public string Body { get; set; };
    public string Ja3 { get; set; };
    public string UserAgent { get; set; };
    public string Proxy { get; set; };
    public List<Cookie> Cookies { get; set; };
    public int? Timeout { get; set; };
    public bool? DisableRedirect { get; set; };
    public List<string> HeaderOrder { get; set; };
    public bool? OrderAsProvided { get; set; };
}

Response class:

ublic class CycleTLSResponse
{
    public string RequestID { get; set; }
    public int Status { get; set; }
    public string Body { get; set; }
    public Dictionary<string, string> Headers { get; set; }
}

Contribution and help

Open pr or issue. Chat me in telegram @mnickw

cycletls-dotnet's People

Contributors

mnickw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.