Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sulaiman-coder authored and sulaiman-coder committed Oct 31, 2023
1 parent 577c74a commit cf3141c
Show file tree
Hide file tree
Showing 14 changed files with 151 additions and 159 deletions.
47 changes: 26 additions & 21 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,40 @@
version: 2
updates:

# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "Type: Maintenance"

# Maintain dependencies for go modules
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
target-branch: "main"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "Type: Maintenance"
allow:
- dependency-name: "github.com/khulnasoft-lab/*"

# Maintain dependencies for docker
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore"
include: "scope"
labels:
- "Type: Maintenance"
# # Maintain dependencies for docker
# - package-ecosystem: "docker"
# directory: "/"
# schedule:
# interval: "weekly"
# target-branch: "dev"
# commit-message:
# prefix: "chore"
# include: "scope"
# labels:
# - "Type: Maintenance"
#
# # Maintain dependencies for GitHub Actions
# - package-ecosystem: "github-actions"
# directory: "/"
# schedule:
# interval: "weekly"
# target-branch: "dev"
# commit-message:
# prefix: "chore"
# include: "scope"
# labels:
# - "Type: Maintenance"
17 changes: 17 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
changelog:
exclude:
authors:
- dependabot
categories:
- title: 🎉 New Features
labels:
- "Type: Enhancement"
- title: 🐞 Bugs Fixes
labels:
- "Type: Bug"
- title: 🔨 Maintenance
labels:
- "Type: Maintenance"
- title: Other Changes
labels:
- "*"
2 changes: 1 addition & 1 deletion .github/workflows/autorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x

- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Test
run: go test ./...
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/dep-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🤖 dep auto merge

on:
pull_request:
branches:
- main
workflow_dispatch:

permissions:
pull-requests: write
issues: write
repository-projects: write

jobs:
automerge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.DEPENDABOT_PAT }}

- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
github-token: ${{ secrets.DEPENDABOT_PAT }}
target: all
6 changes: 3 additions & 3 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.20.x
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3.6.0
uses: golangci/golangci-lint-action@v3.7.0
with:
version: latest
args: --timeout 5m
Expand Down
2 changes: 1 addition & 1 deletion example/impersonate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func main() {

ctx := context.Background()

target := "www.khulnasoft.com"
target := "www.projectdiscovery.io"

conn, err := fd.DialTLSWithConfigImpersonate(ctx, "tcp", target+":443", &tls.Config{InsecureSkipVerify: true}, impersonate.Random, nil)
if err != nil || conn == nil {
Expand Down
2 changes: 1 addition & 1 deletion example/simple/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func main() {

ctx := context.Background()

target := "www.khulnasoft.com"
target := "www.projectdiscovery.io"

conn, err := fd.DialTLS(ctx, "tcp", target+":443")
if err != nil || conn == nil {
Expand Down
4 changes: 2 additions & 2 deletions fastdialer/dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func testDialer(t *testing.T, options Options) {

// valid resolution + cache
ctx := context.Background()
conn, err := fd.Dial(ctx, "tcp", "www.khulnasoft.com:80")
conn, err := fd.Dial(ctx, "tcp", "www.projectdiscovery.io:80")
if err != nil || conn == nil {
t.Errorf("couldn't connect to target: %s", err)
}
conn.Close()
// retrieve cached data
data, err := fd.GetDNSData("www.khulnasoft.com")
data, err := fd.GetDNSData("www.projectdiscovery.io")
if err != nil || data == nil {
t.Errorf("couldn't retrieve dns data: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion fastdialer/ja3/extmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var defaultExtensionMap = map[string]utls.TLSExtension{
},
"18": &utls.SCTExtension{},
"21": &utls.UtlsPaddingExtension{GetPaddingLen: utls.BoringPaddingStyle},
"23": &utls.UtlsExtendedMasterSecretExtension{},
"23": &utls.ExtendedMasterSecretExtension{},
"28": &utls.FakeRecordSizeLimitExtension{},
"35": &utls.SessionTicketExtension{},
"43": &utls.SupportedVersionsExtension{Versions: []uint16{
Expand Down
17 changes: 8 additions & 9 deletions fastdialer/ja3/ja3.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"strconv"
"strings"

tls "github.com/refraction-networking/utls"
utls "github.com/refraction-networking/utls"
)

Expand Down Expand Up @@ -45,10 +44,10 @@ func ParseWithJa3(ja3 string) (*utls.ClientHelloSpec, error) {
}

extMap := getExtensionMap()
extMap["10"] = &tls.SupportedCurvesExtension{Curves: supportedCurves}
extMap["11"] = &tls.SupportedPointsExtension{SupportedPoints: supportedPoints}
extMap["10"] = &utls.SupportedCurvesExtension{Curves: supportedCurves}
extMap["11"] = &utls.SupportedPointsExtension{SupportedPoints: supportedPoints}

return &tls.ClientHelloSpec{
return &utls.ClientHelloSpec{
TLSVersMin: vid,
TLSVersMax: vid,
CipherSuites: cipherSuites,
Expand Down Expand Up @@ -87,8 +86,8 @@ func parseCipherSuites(cipherToken string) ([]uint16, error) {
return cipherSuites, nil
}

func parseExtensions(extensionToken string) ([]tls.TLSExtension, error) {
var extensions []tls.TLSExtension
func parseExtensions(extensionToken string) ([]utls.TLSExtension, error) {
var extensions []utls.TLSExtension
extensionToken = cleanup(extensionToken)
if extensionToken == "" {
return nil, errors.New("no extensions provided")
Expand All @@ -104,8 +103,8 @@ func parseExtensions(extensionToken string) ([]tls.TLSExtension, error) {
return extensions, nil
}

func parseSupportedCurves(supportedCurvesToken string) ([]tls.CurveID, error) {
var supportedCurves []tls.CurveID
func parseSupportedCurves(supportedCurvesToken string) ([]utls.CurveID, error) {
var supportedCurves []utls.CurveID
supportedCurvesToken = cleanup(supportedCurvesToken)
if supportedCurvesToken == "" {
return supportedCurves, nil
Expand All @@ -116,7 +115,7 @@ func parseSupportedCurves(supportedCurvesToken string) ([]tls.CurveID, error) {
if err != nil {
return nil, err
}
supportedCurves = append(supportedCurves, tls.CurveID(cid))
supportedCurves = append(supportedCurves, utls.CurveID(cid))
}
return supportedCurves, nil
}
Expand Down
43 changes: 21 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,35 @@ go 1.20
require (
github.com/dimchansky/utfbom v1.1.1
github.com/khulnasoft-lab/hmap v0.0.17
github.com/khulnasoft-lab/networkpolicy v0.0.8
github.com/khulnasoft-lab/retryabledns v1.0.32
github.com/khulnasoft-lab/utils v0.0.46
github.com/pkg/errors v0.9.1
github.com/refraction-networking/utls v1.3.3
github.com/refraction-networking/utls v1.5.4
github.com/stretchr/testify v1.8.4
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6
github.com/zmap/zcrypto v0.0.0-20230422215203-9a665e1e9968
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1
github.com/zmap/zcrypto v0.0.0-20220803033029-557f3e4940be
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db
golang.org/x/net v0.17.0
)

require (
github.com/khulnasoft-lab/blackrock v0.0.3 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.6.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

require (
github.com/akrylysov/pogreb v0.10.1 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gaukas/godicttls v0.0.3 // indirect
github.com/gaukas/godicttls v0.0.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/khulnasoft-lab/networkpolicy v0.0.8
github.com/klauspost/compress v1.16.6 // indirect
github.com/khulnasoft-lab/blackrock v0.0.3 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/microcosm-cc/bluemonday v1.0.25 // indirect
github.com/miekg/dns v1.1.55 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/miekg/dns v1.1.56 // indirect
github.com/nxadm/tail v1.4.11 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/quic-go/quic-go v0.37.4 // indirect
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
github.com/tidwall/btree v1.4.3 // indirect
Expand All @@ -53,7 +44,15 @@ require (
github.com/tidwall/pretty v1.2.0 // indirect
github.com/tidwall/rtred v0.1.2 // indirect
github.com/tidwall/tinyqueue v0.1.1 // indirect
github.com/weppos/publicsuffix-go v0.30.1-0.20230422193905-8fecedd899db // indirect
github.com/weppos/publicsuffix-go v0.15.1-0.20220724114530-e087fba66a37 // indirect
github.com/yl2chen/cidranger v1.0.2 // indirect
github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect
github.com/zmap/rc2 v0.0.0-20131011165748-24b9757f5521 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.13.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit cf3141c

Please sign in to comment.