Skip to content

Commit e323c5f

Browse files
authored
Merge pull request #77 from boy-hack/dev
i18n: translate all Chinese content to English
2 parents 11c5a91 + 3a43bde commit e323c5f

43 files changed

Lines changed: 1547 additions & 1545 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/ksubdomain/device.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ import (
1010

1111
var deviceCommand = &cli.Command{
1212
Name: "device",
13-
Usage: "列出系统所有可用的网卡信息",
13+
Usage: "List all available network interfaces on the system",
1414
Flags: []cli.Flag{},
1515
Action: func(c *cli.Context) error {
16-
// 否则列出所有可用的网卡
16+
// List all available network interfaces
1717
deviceNames, deviceMap := device.GetAllIPv4Devices()
1818

1919
if len(deviceNames) == 0 {
20-
gologger.Warningf("未找到可用的IPv4网卡\n")
20+
gologger.Warningf("No available IPv4 network interfaces found\n")
2121
return nil
2222
}
2323

24-
gologger.Infof("系统发现 %d 个可用的网卡:\n", len(deviceNames))
24+
gologger.Infof("Found %d available network interface(s):\n", len(deviceNames))
2525

2626
for i, name := range deviceNames {
2727
ip := deviceMap[name]
28-
gologger.Infof("[%d] 网卡名称: %s\n", i+1, name)
29-
gologger.Infof(" IP地址: %s\n", ip.String())
28+
gologger.Infof("[%d] Interface: %s\n", i+1, name)
29+
gologger.Infof(" IP Address: %s\n", ip.String())
3030
fmt.Println("")
3131
}
3232
ether, err := device.AutoGetDevices([]string{"1.1.1.1", "8.8.8.8"})
3333
if err != nil {
34-
gologger.Errorf("获取网卡信息失败: %s\n", err.Error())
34+
gologger.Errorf("Failed to get network interface info: %s\n", err.Error())
3535
return nil
3636
}
3737
device.PrintDeviceInfo(ether)

cmd/ksubdomain/enum.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ var enumCommand = &cli.Command{
6868
filename := c.String("domain-list")
6969
f, err := os.Open(filename)
7070
if err != nil {
71-
gologger.Fatalf("打开文件:%s 出现错误:%s", filename, err.Error())
71+
gologger.Fatalf("Failed to open file %s: %s", filename, err.Error())
7272
}
7373
defer f.Close()
7474
scanner := bufio.NewScanner(f)
@@ -85,7 +85,7 @@ var enumCommand = &cli.Command{
8585
ok, ips := runner.IsWildCard(sub)
8686
if ok {
8787
wildIPS = append(wildIPS, ips...)
88-
gologger.Infof("发现泛解析域名:%s", sub)
88+
gologger.Infof("Wildcard domain detected: %s", sub)
8989
}
9090
}
9191
}
@@ -105,7 +105,7 @@ var enumCommand = &cli.Command{
105105
} else {
106106
f2, err := os.Open(filename)
107107
if err != nil {
108-
gologger.Fatalf("打开文件:%s 出现错误:%s", c.String("filename"), err.Error())
108+
gologger.Fatalf("Failed to open file %s: %s", c.String("filename"), err.Error())
109109
}
110110
defer f2.Close()
111111
iofile := bufio.NewScanner(f2)
@@ -118,7 +118,7 @@ var enumCommand = &cli.Command{
118118
}
119119
}
120120
}()
121-
// 取域名的dns,加入到resolver中
121+
// Load domain's DNS records, add to resolver list
122122
specialDns := make(map[string][]string)
123123
defaultResolver := options.GetResolvers(c.StringSlice("resolvers"))
124124
// Support both old (ns) and new (use-ns-records) parameter names
@@ -142,13 +142,13 @@ var enumCommand = &cli.Command{
142142
processBar = nil
143143
}
144144

145-
// 输出到屏幕
145+
// Output to screen
146146
if c.Bool("quiet") {
147147
processBar = nil
148148
}
149149
var screenWriter outputter.Output
150150

151-
// 美化输出模式
151+
// Beautified output mode
152152
if c.Bool("beautify") || c.Bool("color") {
153153
useColor := c.Bool("color") || c.Bool("beautify")
154154
onlyDomain := c.Bool("only-domain")
@@ -197,7 +197,7 @@ var enumCommand = &cli.Command{
197197
}
198198
writer = append(writer, p)
199199
default:
200-
gologger.Fatalf("输出类型错误:%s 暂不支持 (支持: txt, json, csv, jsonl)", outputType)
200+
gologger.Fatalf("Unsupported output type: %s (supported: txt, json, csv, jsonl)", outputType)
201201
}
202202
}
203203
// Support both old (band) and new (bandwidth) parameter names

cmd/ksubdomain/test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import (
88

99
var testCommand = &cli.Command{
1010
Name: string(options.TestType),
11-
Usage: "测试本地网卡的最大发送速度",
11+
Usage: "Test the maximum sending speed of the local network interface",
1212
Flags: []cli.Flag{
1313
&cli.StringFlag{
1414
Name: "eth",
1515
Aliases: []string{"e"},
16-
Usage: "指定网卡名称,获取该网卡的详细信息",
16+
Usage: "Specify network interface name to get its detailed information",
1717
},
1818
},
1919
Action: func(c *cli.Context) error {

cmd/ksubdomain/verify.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ var commonFlags = []cli.Flag{
8282
&cli.BoolFlag{
8383
Name: "only-domain",
8484
Aliases: []string{"od"},
85-
Usage: "只输出域名,不显示IP (修复 Issue #67)",
85+
Usage: "Only output domain names, do not display IP (Fix Issue #67)",
8686
Value: false,
8787
},
8888
&cli.IntFlag{
@@ -169,15 +169,15 @@ var verifyCommand = &cli.Command{
169169
}
170170
}
171171
render := make(chan string)
172-
// 读取文件
172+
// Read domains from file
173173
go func() {
174174
for _, line := range domains {
175175
render <- line
176176
}
177177
if c.String("filename") != "" {
178178
f2, err := os.Open(c.String("filename"))
179179
if err != nil {
180-
gologger.Fatalf("打开文件:%s 出现错误:%s", c.String("filename"), err.Error())
180+
gologger.Fatalf("Failed to open file %s: %s", c.String("filename"), err.Error())
181181
}
182182
defer f2.Close()
183183
iofile := bufio.NewScanner(f2)
@@ -189,15 +189,15 @@ var verifyCommand = &cli.Command{
189189
close(render)
190190
}()
191191

192-
// 输出到屏幕
192+
// Output to screen
193193
if c.Bool("quiet") {
194194
processBar = nil
195195
}
196196

197197
var screenWriter outputter.Output
198198
var err error
199199

200-
// 美化输出模式
200+
// Beautified output mode
201201
if c.Bool("beautify") || c.Bool("color") {
202202
useColor := c.Bool("color") || c.Bool("beautify")
203203
onlyDomain := c.Bool("only-domain")
@@ -239,14 +239,14 @@ var verifyCommand = &cli.Command{
239239
p := output2.NewCsvOutput(outputFile, wildFilterMode)
240240
writer = append(writer, p)
241241
case "jsonl":
242-
// JSONL (JSON Lines) 格式: 每行一个 JSON,便于流式处理
242+
// JSONL (JSON Lines) format: One JSON per line for streaming
243243
p, err := output2.NewJSONLOutput(outputFile)
244244
if err != nil {
245245
gologger.Fatalf(err.Error())
246246
}
247247
writer = append(writer, p)
248248
default:
249-
gologger.Fatalf("输出类型错误:%s 暂不支持 (支持: txt, json, csv, jsonl)", outputType)
249+
gologger.Fatalf("Unsupported output type: %s (supported: txt, json, csv, jsonl)", outputType)
250250
}
251251
}
252252
resolver := options.GetResolvers(c.StringSlice("resolvers"))

dev.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
【已过时,待重写】
1+
[Outdated — pending rewrite]
22

3-
一个简单的调用例子
4-
注意: 不要启动多个ksubdomain,ksubdomain启动一个就可以发挥最大作用。
3+
A simple usage example.
4+
Note: Do not start multiple instances of ksubdomain. A single instance is enough to achieve maximum performance.
55

66
```go
77
package main
@@ -55,26 +55,28 @@ func main() {
5555
r.Close()
5656
}
5757
```
58-
可以看到调用很简单,就是填写`options`参数,然后调用runner启动就好了,重要的是options填什么。
59-
options的参数结构
58+
59+
As you can see, the usage is straightforward: fill in the `options` struct and call the runner to start. The key is knowing what to put in each option field.
60+
61+
Options struct definition:
6062
```go
6163
type Options struct {
62-
Rate int64 // 每秒发包速率
63-
Domain io.Reader // 域名输入
64-
DomainTotal int // 扫描域名总数
65-
Resolvers []string // dns resolvers
66-
Silent bool // 安静模式
67-
TimeOut int // 超时时间 单位(秒)
68-
Retry int // 最大重试次数
69-
Method string // verify模式 enum模式 test模式
70-
DnsType string // dns类型 a ns aaaa
71-
Writer []outputter.Output // 输出结构
64+
Rate int64 // Packet send rate per second
65+
Domain io.Reader // Domain input
66+
DomainTotal int // Total number of domains to scan
67+
Resolvers []string // DNS resolvers
68+
Silent bool // Silent mode
69+
TimeOut int // Timeout in seconds
70+
Retry int // Maximum retry count
71+
Method string // verify mode / enum mode / test mode
72+
DnsType string // DNS record type: a, ns, aaaa
73+
Writer []outputter.Output // Output handlers
7274
ProcessBar processbar.ProcessBar
73-
EtherInfo *device.EtherTable // 网卡信息
75+
EtherInfo *device.EtherTable // Network adapter info
7476
}
7577
```
76-
1. ksubdomain底层接口只是一个dns验证器,如果要通过一级域名枚举,需要把全部的域名都放入`Domain`字段中,可以看enum参数是怎么写的 `cmd/ksubdomain/enum.go`
77-
2. Write参数是一个outputter.Output接口,用途是如何处理DNS返回的接口,ksubdomain已经内置了三种接口在 `runner/outputter/output`中,主要作用是把数据存入内存、数据写入文件、数据打印到屏幕,可以自己实现这个接口,实现自定义的操作。
78-
3. ProcessBar参数是一个processbar.ProcessBar接口,主要用途是将程序内`成功个数``发送个数``队列数``接收数``失败数``耗时`传递给用户,实现这个参数可以时时获取这些。
79-
4. EtherInfo是*device.EtherTable类型,用来获取网卡的信息,一般用函数`options.GetDeviceConfig()`即可自动获取网卡配置。
8078

79+
1. The underlying interface of ksubdomain is just a DNS validator. If you want to enumerate subdomains from a root domain, you need to put all the full domain names into the `Domain` field. See how the enum command does it in `cmd/ksubdomain/enum.go`.
80+
2. The `Writer` field is an `outputter.Output` interface that defines how DNS responses are handled. ksubdomain ships with three built-in implementations in `runner/outputter/output`: store data in memory, write data to a file, and print data to the screen. You can implement this interface yourself for custom behavior.
81+
3. The `ProcessBar` field is a `processbar.ProcessBar` interface. Its purpose is to expose internal statistics—success count, sent count, queue length, received count, failed count, and elapsed time—to the caller in real time.
82+
4. `EtherInfo` is of type `*device.EtherTable` and is used to obtain network adapter information. You can usually just call `options.GetDeviceConfig()` to auto-detect the adapter configuration.

pkg/core/conf/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ package conf
33
const (
44
Version = "2.4"
55
AppName = "KSubdomain"
6-
Description = "无状态子域名爆破工具"
6+
Description = "Stateless subdomain brute-force tool"
77
)

pkg/core/options/device.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import (
55
"github.com/boy-hack/ksubdomain/v2/pkg/device"
66
)
77

8-
// GetDeviceConfig 获取网卡配置信息
9-
// 改进版本:优先通过路由表获取网卡信息,不依赖配置文件缓存
8+
// GetDeviceConfig retrieves network interface configuration.
9+
// Improved version: prioritizes getting interface info via routing table, no dependency on config file cache.
1010
func GetDeviceConfig(dnsServer []string) *device.EtherTable {
11-
// 使用改进的自动识别方法,优先通过路由表获取,不依赖配置文件
11+
// Use improved auto-detection method: routing table first, no config file dependency
1212
ether, err := device.AutoGetDevicesImproved(dnsServer)
1313
if err != nil {
14-
gologger.Fatalf("自动识别外网网卡失败: %v\n", err)
14+
gologger.Fatalf("Failed to auto-detect external network interface: %v\n", err)
1515
}
1616

1717
device.PrintDeviceInfo(ether)

pkg/core/options/options.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ const (
1818
)
1919

2020
type Options struct {
21-
Rate int64 // 每秒发包速率
22-
Domain chan string // 域名输入
23-
Resolvers []string // dns resolvers
24-
Silent bool // 安静模式
25-
TimeOut int // 超时时间 单位(秒)
26-
Retry int // 最大重试次数
27-
Method OptionMethod // verify模式 enum模式 test模式
28-
Writer []outputter.Output // 输出结构
21+
Rate int64 // Packet sending rate per second
22+
Domain chan string // Domain input channel
23+
Resolvers []string // DNS resolvers
24+
Silent bool // Silent mode
25+
TimeOut int // Timeout in seconds
26+
Retry int // Maximum retry count
27+
Method OptionMethod // verify / enum / test mode
28+
Writer []outputter.Output // Output handlers
2929
ProcessBar processbar.ProcessBar
30-
EtherInfo *device2.EtherTable // 网卡信息
31-
SpecialResolvers map[string][]string // 可针对特定域名使用的dns resolvers
32-
WildcardFilterMode string // 泛解析过滤模式: "basic", "advanced", "none"
30+
EtherInfo *device2.EtherTable // Network interface info
31+
SpecialResolvers map[string][]string // DNS resolvers for specific domains
32+
WildcardFilterMode string // Wildcard filter mode: "basic", "advanced", "none"
3333
WildIps []string
34-
Predict bool // 是否开启预测模式
34+
Predict bool // Enable prediction mode
3535
}
3636

3737
func Band2Rate(bandWith string) int64 {
@@ -53,7 +53,7 @@ func Band2Rate(bandWith string) int64 {
5353
default:
5454
gologger.Fatalf("unknown bandwith suffix '%s' (supported suffixes are G,M and K)\n", suffix)
5555
}
56-
packSize := int64(80) // 一个DNS包大概有74byte
56+
packSize := int64(80) // A DNS packet is approximately 74 bytes
5757
rate = rate / packSize
5858
return rate
5959
}
@@ -68,8 +68,8 @@ func GetResolvers(resolvers []string) []string {
6868
defaultDns := []string{
6969
"1.1.1.1",
7070
"8.8.8.8",
71-
"180.76.76.76", //百度公共 DNS
72-
"180.184.1.1", //火山引擎
71+
"180.76.76.76", // Baidu Public DNS
72+
"180.184.1.1", // Volcengine
7373
"180.184.2.2",
7474
}
7575
rs = defaultDns

0 commit comments

Comments
 (0)