Skip to content

Commit

Permalink
Merge pull request #507 from projectdiscovery/dev
Browse files Browse the repository at this point in the history
Interactsh v1.1.2
  • Loading branch information
ehsandeep committed Mar 19, 2023
2 parents 14231ab + 605e84f commit efbfc67
Show file tree
Hide file tree
Showing 12 changed files with 217 additions and 66 deletions.
2 changes: 1 addition & 1 deletion .github/docker/client/Dockerfile
@@ -1,5 +1,5 @@
# Base
FROM golang:1.20.1-alpine AS builder
FROM golang:1.20.2-alpine AS builder
RUN apk add --no-cache git build-base gcc musl-dev
WORKDIR /app
COPY . /app
Expand Down
2 changes: 1 addition & 1 deletion .github/docker/server/Dockerfile
@@ -1,5 +1,5 @@
# Base
FROM golang:1.20.1-alpine AS builder
FROM golang:1.20.2-alpine AS builder
RUN apk add --no-cache git build-base gcc musl-dev
WORKDIR /app
COPY . /app
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dockerhub-server.yml
Expand Up @@ -37,6 +37,6 @@ jobs:
with:
context: .
file: .github/docker/server/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm
platforms: linux/amd64,linux/arm64
push: true
tags: projectdiscovery/interactsh-server:latest,projectdiscovery/interactsh-server:${{ steps.meta.outputs.TAG }}
tags: projectdiscovery/interactsh-server:latest,projectdiscovery/interactsh-server:${{ steps.meta.outputs.TAG }}
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -76,6 +76,10 @@ FILTER:
-http-only display only http interaction in CLI output
-smtp-only display only smtp interactions in CLI output

UPDATE:
-up, -update update interactsh-client to latest version
-duc, -disable-update-check disable automatic interactsh-client update check

OUTPUT:
-o string output file to write interaction data
-json write output in JSONL(ines) format
Expand Down Expand Up @@ -329,6 +333,10 @@ CONFIG:
-ds, -disk disk based storage
-dsp, -disk-path string disk storage path

UPDATE:
-up, -update update interactsh-server to latest version
-duc, -disable-update-check disable automatic interactsh-server update check

SERVICES:
-dns-port int port to use for dns service (default 53)
-http-port int port to use for http service (default 80)
Expand All @@ -352,6 +360,7 @@ DEBUG:
-ep, -enable-pprof enable pprof debugging server
-health-check, -hc run diagnostic check up
-metrics enable metrics endpoint
-v, -verbose display verbose interaction
```

We are using GoDaddy for domain name and DigitalOcean droplet for the server, a basic $5 droplet should be sufficient to run self-hosted Interactsh server. If you are not using GoDaddy, follow your registrar's process for creating / updating DNS entries.
Expand Down
17 changes: 17 additions & 0 deletions cmd/interactsh-client/main.go
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/projectdiscovery/interactsh/pkg/settings"
fileutil "github.com/projectdiscovery/utils/file"
folderutil "github.com/projectdiscovery/utils/folder"
updateutils "github.com/projectdiscovery/utils/update"
)

var (
Expand Down Expand Up @@ -60,6 +61,11 @@ func main() {
flagSet.BoolVar(&cliOptions.Asn, "asn", false, " include asn information of remote ip in json output"),
)

flagSet.CreateGroup("update", "Update",
flagSet.CallbackVarP(options.GetUpdateCallback("interactsh-client"), "update", "up", "update interactsh-client to latest version"),
flagSet.BoolVarP(&cliOptions.DisableUpdateCheck, "disable-update-check", "duc", false, "disable automatic interactsh-client update check"),
)

flagSet.CreateGroup("output", "Output",
flagSet.StringVar(&cliOptions.Output, "o", "", "output file to write interaction data"),
flagSet.BoolVar(&cliOptions.JSON, "json", false, "write output in JSONL(ines) format"),
Expand Down Expand Up @@ -87,6 +93,17 @@ func main() {
os.Exit(0)
}

if !cliOptions.DisableUpdateCheck {
latestVersion, err := updateutils.GetVersionCheckCallback("interactsh-client")()
if err != nil {
if cliOptions.Verbose {
gologger.Error().Msgf("interactsh version check failed: %v", err.Error())
}
} else {
gologger.Info().Msgf("Current interactsh version %v %v", options.Version, updateutils.GetVersionDescription(options.Version, latestVersion))
}
}

if cliOptions.Config != defaultConfigLocation {
if err := flagSet.MergeConfigFile(cliOptions.Config); err != nil {
gologger.Fatal().Msgf("Could not read config: %s\n", err)
Expand Down
19 changes: 19 additions & 0 deletions cmd/interactsh-server/main.go
Expand Up @@ -28,6 +28,7 @@ import (
folderutil "github.com/projectdiscovery/utils/folder"
iputil "github.com/projectdiscovery/utils/ip"
stringsutil "github.com/projectdiscovery/utils/strings"
updateutils "github.com/projectdiscovery/utils/update"
)

var (
Expand Down Expand Up @@ -69,6 +70,11 @@ func main() {
flagSet.StringVarP(&cliOptions.DiskStoragePath, "disk-path", "dsp", "", "disk storage path"),
)

flagSet.CreateGroup("update", "Update",
flagSet.CallbackVarP(options.GetUpdateCallback("interactsh-server"), "update", "up", "update interactsh-server to latest version"),
flagSet.BoolVarP(&cliOptions.DisableUpdateCheck, "disable-update-check", "duc", false, "disable automatic interactsh-server update check"),
)

flagSet.CreateGroup("services", "Services",
flagSet.IntVar(&cliOptions.DnsPort, "dns-port", 53, "port to use for dns service"),
flagSet.IntVar(&cliOptions.HttpPort, "http-port", 80, "port to use for http service"),
Expand All @@ -86,12 +92,14 @@ func main() {
flagSet.IntVar(&cliOptions.FtpPort, "ftp-port", 21, "port to use for ftp service"),
flagSet.StringVar(&cliOptions.FTPDirectory, "ftp-dir", "", "ftp directory - temporary if not specified"),
)

flagSet.CreateGroup("debug", "Debug",
flagSet.BoolVar(&cliOptions.Version, "version", false, "show version of the project"),
flagSet.BoolVar(&cliOptions.Debug, "debug", false, "start interactsh server in debug mode"),
flagSet.BoolVarP(&cliOptions.EnablePprof, "enable-pprof", "ep", false, "enable pprof debugging server"),
flagSet.BoolVarP(&healthcheck, "hc", "health-check", false, "run diagnostic check up"),
flagSet.BoolVar(&cliOptions.EnableMetrics, "metrics", false, "enable metrics endpoint"),
flagSet.BoolVarP(&cliOptions.Verbose, "verbose", "v", false, "display verbose interaction"),
)

if err := flagSet.Parse(); err != nil {
Expand All @@ -109,6 +117,17 @@ func main() {
os.Exit(0)
}

if !cliOptions.DisableUpdateCheck {
latestVersion, err := updateutils.GetVersionCheckCallback("interactsh-client")()
if err != nil {
if cliOptions.Verbose {
gologger.Error().Msgf("interactsh version check failed: %v", err.Error())
}
} else {
gologger.Info().Msgf("Current interactsh version %v %v", options.Version, updateutils.GetVersionDescription(options.Version, latestVersion))
}
}

if cliOptions.Config != defaultConfigLocation {
if err := flagSet.MergeConfigFile(cliOptions.Config); err != nil {
gologger.Fatal().Msgf("Could not read config: %s\n", err)
Expand Down
53 changes: 39 additions & 14 deletions go.mod
Expand Up @@ -13,15 +13,15 @@ require (
github.com/json-iterator/go v1.1.12
github.com/karlseguin/ccache/v2 v2.0.8
github.com/libdns/libdns v0.2.1
github.com/mackerelio/go-osstat v0.2.3
github.com/miekg/dns v1.1.51
github.com/mackerelio/go-osstat v0.2.4
github.com/miekg/dns v1.1.52
github.com/pkg/errors v0.9.1
github.com/projectdiscovery/asnmap v1.0.1
github.com/projectdiscovery/asnmap v1.0.2
github.com/projectdiscovery/goflags v0.1.8
github.com/projectdiscovery/gologger v1.1.8
github.com/projectdiscovery/retryabledns v1.0.21
github.com/projectdiscovery/retryablehttp-go v1.0.12
github.com/projectdiscovery/utils v0.0.14
github.com/projectdiscovery/retryablehttp-go v1.0.13
github.com/projectdiscovery/utils v0.0.17-0.20230316120449-87a826142a90
github.com/remeh/sizedwaitgroup v1.0.0
github.com/rs/xid v1.4.0
github.com/stretchr/testify v1.8.2
Expand All @@ -35,38 +35,63 @@ require (
)

require (
aead.dev/minisign v0.2.0 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // indirect
github.com/Mzack9999/go-http-digest-auth-client v0.6.1-0.20220414142836-eb8883508809 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/andres-erbsen/clock v0.0.0-20160526145045-9e14626cd129 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/charmbracelet/glamour v0.6.0 // indirect
github.com/cheggaaa/pb/v3 v3.1.2 // indirect
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.8.1 // indirect
github.com/dsnet/compress v0.0.1 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-github/v30 v30.1.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/klauspost/cpuid/v2 v2.1.1 // indirect
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mholt/acmez v1.0.4 // indirect
github.com/mholt/archiver v3.1.1+incompatible // indirect
github.com/microcosm-cc/bluemonday v1.0.21 // indirect
github.com/microcosm-cc/bluemonday v1.0.23 // indirect
github.com/minio/selfupdate v0.6.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/nwaples/rardecode v1.1.0 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/projectdiscovery/blackrock v0.0.0-20221025011524-9e4efe804fb4 // indirect
github.com/projectdiscovery/mapcidr v1.1.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
github.com/ulikunitz/xz v0.5.8 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yuin/goldmark v1.5.4 // indirect
github.com/yuin/goldmark-emoji v1.0.1 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a // indirect
golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/tools v0.5.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20230224173230-c95f2b4c22f2 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.5.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/djherbis/times.v1 v1.3.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)

0 comments on commit efbfc67

Please sign in to comment.