Skip to content

Commit 1c3fc93

Browse files
committed
Merge branch 'dev'
2 parents 63301f6 + 8a49853 commit 1c3fc93

File tree

12 files changed

+144
-488
lines changed

12 files changed

+144
-488
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
- Dynamic HTTP Response control
3636
- Self-Hosted Interactsh Server
3737
- Multiple domain support **(self-hosted)**
38-
- NTLM/SMB/FTP/RESPONDER Listener **(self-hosted)**
38+
- NTLM/SMB/FTP(S)/RESPONDER Listener **(self-hosted)**
3939
- Wildcard / Protected Interactions **(self-hosted)**
4040
- Customizable Index / File hosting **(self-hosted)**
4141
- Customizable Payload Length **(self-hosted)**
@@ -363,6 +363,7 @@ SERVICES:
363363
-ftp start ftp agent (authenticated)
364364
-smb-port int port to use for smb service (default 445)
365365
-ftp-port int port to use for ftp service (default 21)
366+
-ftps-port int port to use for ftps service (default 990)
366367
-ftp-dir string ftp directory - temporary if not specified
367368

368369
DEBUG:
@@ -381,13 +382,13 @@ We are using GoDaddy for domain name and DigitalOcean droplet for the server, a
381382

382383
## Configuring Interactsh domain
383384

384-
- Navigate to `https://dcc.godaddy.com/manage/{{domain}}/dns/hosts`
385-
- Advanced Features → Host names → Add → Submit `ns1`, `ns2` with your `SERVER_IP` as value
385+
- Navigate to `https://dcc.godaddy.com/control/portfolio/{{domain}}/settings?subtab=hostnames`
386+
- Add → Submit `ns1`, `ns2` with your `SERVER_IP` as value
386387

387388
<img width="1288" alt="gdd-hostname" src="https://user-images.githubusercontent.com/8293321/135175512-135259fb-0490-4038-845a-0b62b1b8f549.png">
388389

389-
- Navigate to `https://dns.godaddy.com/{{domain}}/nameservers`
390-
- I'll use my own nameservers &rarr; Submit `ns1.INTERACTSH_DOMAIN`, `ns2.INTERACTSH_DOMAIN`
390+
- Navigate to `https://dcc.godaddy.com/control/dnsmanagement?domainName={{domain}}&subtab=nameservers`
391+
- Change Nameservers &rarr; I'll use my own nameservers &rarr; Submit `ns1.INTERACTSH_DOMAIN`, `ns2.INTERACTSH_DOMAIN`
391392

392393
<img width="1288" alt="gdd-ns" src="https://user-images.githubusercontent.com/8293321/135175627-ea9639fd-353d-441b-a9a4-dae7f540d0ae.png">
393394

@@ -744,7 +745,7 @@ interactsh-server -d hackwithautomation.com -cert hackwithautomation.com.crt -pr
744745

745746
### FTP
746747

747-
FTP support can be enabled with the `-ftp` flag and is recommended for self-hosted instances only. The FTP agent simulates a fully-functional FTP server agent with authentication that captures authentications with every file operation. By default, the agent listens on port 21 (this can be changed with the `-ftp-port` flag) and lists in read-only mode the content of the OS default temporary directory (customizable with the `-ftp-dir` option).
748+
FTP support can be enabled with the `-ftp` flag and is recommended for self-hosted instances only. The FTP agent simulates a fully-functional FTP server agent with authentication that captures authentications with every file operation. By default, the agent listens for clear text FTP on port 21 (this can be changed with the `-ftp-port` flag) and tls FTP on port 990 (this can be changed with the `-ftps-port` flag) and lists in read-only mode the content of the OS default temporary directory (customizable with the `-ftp-dir` option). The ftp engine uses the custom certificate and private key if provided or it will extract the certificate and private key from the first acme domain if provided.
748749
Example of starting the FTP daemon and capturing a login interaction:
749750

750751
```console

cmd/interactsh-server/main.go

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ func main() {
9292
flagSet.BoolVar(&cliOptions.Ftp, "ftp", false, "start ftp agent (authenticated)"),
9393
flagSet.IntVar(&cliOptions.SmbPort, "smb-port", 445, "port to use for smb service"),
9494
flagSet.IntVar(&cliOptions.FtpPort, "ftp-port", 21, "port to use for ftp service"),
95+
flagSet.IntVar(&cliOptions.FtpsPort, "ftps-port", 990, "port to use for ftps service"),
9596
flagSet.StringVar(&cliOptions.FTPDirectory, "ftp-dir", "", "ftp directory - temporary if not specified"),
9697
)
9798

@@ -257,7 +258,11 @@ func main() {
257258
go dnsTcpServer.ListenAndServe(dnsTcpAlive)
258259
go dnsUdpServer.ListenAndServe(dnsUdpAlive)
259260

260-
var tlsConfig *tls.Config
261+
var (
262+
tlsConfig *tls.Config
263+
domainCerts []tls.Certificate
264+
certFiles []acme.CertificateFiles
265+
)
261266
switch {
262267
case cliOptions.CertificatePath != "" && cliOptions.PrivateKeyPath != "":
263268
var domain string
@@ -275,7 +280,8 @@ func main() {
275280
for idx, domain := range cliOptions.Domains {
276281
trimmedDomain := strings.TrimSuffix(domain, ".")
277282
hostmaster := serverOptions.Hostmasters[idx]
278-
domainCerts, acmeErr := acme.HandleWildcardCertificates(fmt.Sprintf("*.%s", trimmedDomain), hostmaster, acmeStore, cliOptions.Debug)
283+
var acmeErr error
284+
domainCerts, certFiles, acmeErr = acme.HandleWildcardCertificates(fmt.Sprintf("*.%s", trimmedDomain), hostmaster, acmeStore, cliOptions.Debug)
279285
if acmeErr != nil {
280286
gologger.Error().Msgf("An error occurred while applying for a certificate, error: %v", acmeErr)
281287
gologger.Error().Msgf("Could not generate certs for auto TLS, https will be disabled")
@@ -290,6 +296,9 @@ func main() {
290296
}
291297
}
292298

299+
serverOptions.Certificates = domainCerts
300+
serverOptions.CertFiles = certFiles
301+
293302
// manually cleans up stale OCSP from storage
294303
acme.CleanupStorage()
295304

@@ -318,12 +327,13 @@ func main() {
318327
defer ldapServer.Close()
319328

320329
ftpAlive := make(chan bool)
330+
ftpsAlive := make(chan bool)
321331
if cliOptions.Ftp {
322332
ftpServer, err := server.NewFTPServer(serverOptions)
323333
if err != nil {
324334
gologger.Fatal().Msgf("Could not create FTP server: %s", err)
325335
}
326-
go ftpServer.ListenAndServe(tlsConfig, ftpAlive) //nolint
336+
go ftpServer.ListenAndServe(tlsConfig, ftpAlive, ftpsAlive) //nolint
327337
}
328338

329339
responderAlive := make(chan bool)
@@ -385,6 +395,10 @@ func main() {
385395
service = "FTP"
386396
network = "TCP"
387397
port = serverOptions.FtpPort
398+
case status = <-ftpsAlive:
399+
service = "FTPS"
400+
network = "TCP"
401+
port = serverOptions.FtpsPort
388402
case status = <-responderAlive:
389403
service = "Responder"
390404
network = "TCP"

cmd/interactsh-server/smb_server.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import sys
22
from impacket import smbserver
33

4+
def configure_shares(server):
5+
shares = ["IPC$", "ADMIN$", "C$", "PRINT$", "FAX$", "NETLOGON", "SYSVOL"]
6+
for share in shares:
7+
server.removeShare(share)
8+
49
log_filename = "log.txt"
510
if len(sys.argv) >= 2:
611
log_filename = sys.argv[1]
@@ -10,7 +15,7 @@
1015

1116
server = smbserver.SimpleSMBServer(listenAddress="0.0.0.0", listenPort=port)
1217
server.setSMB2Support(True)
13-
server.addShare("interactsh", "/interactsh")
18+
configure_shares(server)
1419
server.setSMBChallenge('')
1520
server.setLogFile(log_filename)
1621
server.start()

go.mod

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ require (
1414
github.com/mackerelio/go-osstat v0.2.4
1515
github.com/miekg/dns v1.1.56
1616
github.com/pkg/errors v0.9.1
17-
github.com/projectdiscovery/asnmap v1.0.6
18-
github.com/projectdiscovery/goflags v0.1.40
17+
github.com/projectdiscovery/asnmap v1.1.0
18+
github.com/projectdiscovery/goflags v0.1.54
1919
github.com/projectdiscovery/gologger v1.1.12
2020
github.com/projectdiscovery/ldapserver v1.0.2-0.20240219154113-dcc758ebc0cb
21-
github.com/projectdiscovery/retryabledns v1.0.56
22-
github.com/projectdiscovery/retryablehttp-go v1.0.48
23-
github.com/projectdiscovery/utils v0.0.78
21+
github.com/projectdiscovery/retryabledns v1.0.62
22+
github.com/projectdiscovery/retryablehttp-go v1.0.63
23+
github.com/projectdiscovery/utils v0.1.1
2424
github.com/remeh/sizedwaitgroup v1.0.0
2525
github.com/rs/xid v1.5.0
26-
github.com/stretchr/testify v1.8.4
26+
github.com/stretchr/testify v1.9.0
2727
github.com/syndtr/goleveldb v1.0.0
2828
go.uber.org/multierr v1.11.0
2929
go.uber.org/ratelimit v0.3.0
@@ -50,16 +50,17 @@ require (
5050
github.com/cloudflare/circl v1.3.7 // indirect
5151
github.com/cnf/structhash v0.0.0-20201127153200-e1b16c1ebc08 // indirect
5252
github.com/davecgh/go-spew v1.1.1 // indirect
53-
github.com/denisbrodbeck/machineid v1.0.1 // indirect
5453
github.com/dimchansky/utfbom v1.1.1 // indirect
5554
github.com/dlclark/regexp2 v1.8.1 // indirect
5655
github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect
5756
github.com/fatih/color v1.15.0 // indirect
5857
github.com/gaukas/godicttls v0.0.4 // indirect
58+
github.com/go-ole/go-ole v1.2.6 // indirect
5959
github.com/golang/protobuf v1.5.3 // indirect
6060
github.com/golang/snappy v0.0.4 // indirect
6161
github.com/google/go-github/v30 v30.1.0 // indirect
6262
github.com/google/go-querystring v1.1.0 // indirect
63+
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
6364
github.com/gorilla/css v1.0.0 // indirect
6465
github.com/klauspost/compress v1.16.7 // indirect
6566
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
@@ -68,6 +69,7 @@ require (
6869
github.com/logrusorgru/aurora v2.0.3+incompatible // indirect
6970
github.com/lor00x/goldap v0.0.0-20180618054307-a546dffdd1a3 // indirect
7071
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
72+
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
7173
github.com/mattn/go-colorable v0.1.13 // indirect
7274
github.com/mattn/go-isatty v0.0.19 // indirect
7375
github.com/mattn/go-runewidth v0.0.14 // indirect
@@ -83,15 +85,19 @@ require (
8385
github.com/olekukonko/tablewriter v0.0.5 // indirect
8486
github.com/pierrec/lz4/v4 v4.1.2 // indirect
8587
github.com/pmezard/go-difflib v1.0.0 // indirect
88+
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
8689
github.com/projectdiscovery/blackrock v0.0.1 // indirect
87-
github.com/projectdiscovery/fastdialer v0.0.59 // indirect
88-
github.com/projectdiscovery/hmap v0.0.39 // indirect
89-
github.com/projectdiscovery/mapcidr v1.1.16 // indirect
90-
github.com/projectdiscovery/networkpolicy v0.0.7 // indirect
90+
github.com/projectdiscovery/fastdialer v0.1.1 // indirect
91+
github.com/projectdiscovery/hmap v0.0.45 // indirect
92+
github.com/projectdiscovery/machineid v0.0.0-20240226150047-2e2c51e35983 // indirect
93+
github.com/projectdiscovery/mapcidr v1.1.34 // indirect
94+
github.com/projectdiscovery/networkpolicy v0.0.8 // indirect
9195
github.com/quic-go/quic-go v0.42.0 // indirect
9296
github.com/refraction-networking/utls v1.5.4 // indirect
9397
github.com/rivo/uniseg v0.4.4 // indirect
9498
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d // indirect
99+
github.com/shirou/gopsutil/v3 v3.23.7 // indirect
100+
github.com/shoenig/go-m1cpu v0.1.6 // indirect
95101
github.com/tidwall/btree v1.6.0 // indirect
96102
github.com/tidwall/buntdb v1.3.0 // indirect
97103
github.com/tidwall/gjson v1.14.4 // indirect
@@ -100,13 +106,16 @@ require (
100106
github.com/tidwall/pretty v1.2.1 // indirect
101107
github.com/tidwall/rtred v0.1.2 // indirect
102108
github.com/tidwall/tinyqueue v0.1.1 // indirect
109+
github.com/tklauser/go-sysconf v0.3.12 // indirect
110+
github.com/tklauser/numcpus v0.6.1 // indirect
103111
github.com/ulikunitz/xz v0.5.11 // indirect
104-
github.com/ulule/deepcopier v0.0.0-20200430083143-45decc6639b6 // indirect
105112
github.com/weppos/publicsuffix-go v0.30.1-0.20230422193905-8fecedd899db // indirect
106113
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
107114
github.com/yl2chen/cidranger v1.0.2 // indirect
108115
github.com/yuin/goldmark v1.5.4 // indirect
109116
github.com/yuin/goldmark-emoji v1.0.1 // indirect
117+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
118+
github.com/zcalusic/sysinfo v1.0.2 // indirect
110119
github.com/zeebo/blake3 v0.2.3 // indirect
111120
github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect
112121
github.com/zmap/zcrypto v0.0.0-20230422215203-9a665e1e9968 // indirect
@@ -117,6 +126,7 @@ require (
117126
golang.org/x/net v0.23.0 // indirect
118127
golang.org/x/oauth2 v0.11.0 // indirect
119128
golang.org/x/sys v0.18.0 // indirect
129+
golang.org/x/term v0.18.0 // indirect
120130
golang.org/x/text v0.14.0 // indirect
121131
golang.org/x/tools v0.13.0 // indirect
122132
google.golang.org/appengine v1.6.7 // indirect

0 commit comments

Comments
 (0)