{"id":26323046,"url":"https://github.com/usamikinoko/kankan","last_synced_at":"2026-02-10T16:13:00.268Z","repository":{"id":276285844,"uuid":"928742442","full_name":"usamikinoko/kankan","owner":"usamikinoko","description":"轻量级内网穿透工具","archived":false,"fork":false,"pushed_at":"2025-02-07T10:20:33.000Z","size":25,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T18:32:02.494Z","etag":null,"topics":["golang","network","penetration-testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/usamikinoko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-07T06:42:40.000Z","updated_at":"2025-02-10T03:06:21.000Z","dependencies_parsed_at":"2025-02-07T10:42:14.205Z","dependency_job_id":null,"html_url":"https://github.com/usamikinoko/kankan","commit_stats":null,"previous_names":["ma5hr00m/kankan","usamikinoko/kankan"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usamikinoko%2Fkankan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usamikinoko%2Fkankan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usamikinoko%2Fkankan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usamikinoko%2Fkankan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usamikinoko","download_url":"https://codeload.github.com/usamikinoko/kankan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243762249,"owners_count":20343979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","network","penetration-testing-tools"],"created_at":"2025-03-15T17:16:20.035Z","updated_at":"2026-02-10T16:13:00.228Z","avatar_url":"https://github.com/usamikinoko.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kankan\n\n[![Go Version](https://img.shields.io/badge/Go-1.23.5-blue.svg)](https://golang.org/doc/devel/release.html)\n[![License](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nKankan is a lightweight and secure intranet penetration tool written in Go.\n\n## Usage\n\n### Server (Public Network)\n\n```bash\n# Basic usage\nkankans.exe -bind 0.0.0.0 -port 8080 -proxy 8081 -key your-secret-key\n\n# Advanced configuration\nkankans.exe -bind 0.0.0.0 -port 8080 -proxy 8081 -key your-secret-key -max-conn 100 -timeout 30s -heartbeat 10s -buffer 4096\n```\n\n### Client (Internal Network)\n\n```bash\n# Basic usage - Expose local web service (TCP mode)\nkankanc.exe -server your-server-ip -sport 8080 -local 127.0.0.1 -lport 80 -key your-secret-key\n\n# UDP mode - Expose local UDP service\nkankanc.exe -server your-server-ip -sport 8080 -local 127.0.0.1 -lport 53 -key your-secret-key -udp\n\n# Advanced configuration\nkankanc.exe -server your-server-ip -sport 8080 -local 127.0.0.1 -lport 80 -key your-secret-key -max-retry 5 -retry-delay 5s -buffer 8192\n```\n\n## Features\n\n### Security\n- AES-256 encryption with dynamic nonce for data protection\n- SHA-256 based key derivation for secure key management\n- Message authentication to prevent tampering\n\u003e Path: `/pkg/crypto/crypto.go`\n```go\nfunc NewCrypto(key string) (*Crypto, error) {\n    h := sha256.New()\n    h.Write([]byte(key))\n    keyBytes := h.Sum(nil)\n    block, err := aes.NewCipher(keyBytes)\n    // ...\n}\n```\n\n### Traffic Obfuscation\n- HTTP/WebSocket protocol simulation\n- Dynamic padding and jitter\n- Common browser User-Agent rotation\n- TLS-like traffic patterns\n\u003e Path: `/pkg/protocol/protocol.go`\n```go\ntype ObfuscationConfig struct {\n    EnableHTTP    bool\n    EnableWSS     bool\n    PaddingRange  [2]int\n    JitterRange   time.Duration\n    FragmentSize  int\n    EnableTLSLike bool\n    DynamicPort   bool\n    PortRange     [2]int\n}\n```\n\n### Performance\n- Worker pool for efficient connection handling\n- Buffer pool for memory optimization\n- LZ4 compression for data transfer\n\u003e Path: `/kankans/main.go`\n```go\ntype Server struct {\n    workerPool  *WorkerPool\n    bufferPool  sync.Pool\n    metrics     *Metrics\n    // ...\n}\n\nbufPool: sync.Pool{\n    New: func() interface{} {\n        return make([]byte, 0, 4096)\n    },\n}\n```\n\n### Protocol Support\n- TCP proxy with automatic reconnection\n- UDP proxy with session management\n- Dynamic port allocation\n\u003e Path: `/kankans/main.go`\n```go\ntype UDPSession struct {\n    clientAddr *net.UDPAddr\n    localConn  *net.UDPConn\n    lastSeen   time.Time\n    crypto     *crypto.Crypto\n}\n```\n\n### Monitoring \u0026 Management\n- Real-time metrics collection\n- Connection and traffic statistics\n- Automatic cleanup of inactive sessions\n\u003e Path: `/kankans/main.go`\n```go\ntype Metrics struct {\n    activeConnections int32\n    totalConnections  uint64\n    totalBytes        uint64\n    totalPackets      uint64\n    lastMinuteBytes   uint64\n    lastMinutePackets uint64\n    // ...\n}\n```\n\n## How It Works\n\n```mermaid\nsequenceDiagram\n    participant C as Client\n    participant KC as KankanC\n    participant KS as KankanS\n    participant U as User\n\n    C-\u003e\u003eKC: Local Service\n    KC-\u003e\u003eKS: Encrypted Connection\n    Note over KC,KS: Session Establishment\u003cbr/\u003e\u0026 Heartbeat\n    U-\u003e\u003eKS: Access Request\n    KS-\u003e\u003eKC: Forward Request\n    KC-\u003e\u003eC: Forward to Service\n    C-\u003e\u003eKC: Service Response\n    KC-\u003e\u003eKS: Encrypted Response\n    KS-\u003e\u003eU: Final Response\n\n    Note over KC,KS: Continuous\u003cbr/\u003eConnection Monitor\n```\n\nThe diagram above illustrates the basic workflow:\n1. KankanC establishes an encrypted connection with KankanS\n2. KankanC maintains the connection through heartbeat mechanism\n3. When a user accesses KankanS, the request is forwarded to KankanC\n4. KankanC forwards the request to the local service and returns the response\n5. All data transmission between KankanC and KankanS is encrypted\n\n## Command Line Options\n\n### Server Options\n- `-bind`: Bind address (default: \"0.0.0.0\")\n- `-port`: Control server port (default: 8080)\n- `-proxy`: Proxy server port (default: 8081)\n- `-key`: Encryption key (required)\n- `-max-conn`: Maximum connections (default: 1000)\n- `-timeout`: Connection timeout (default: 30s)\n- `-heartbeat`: Heartbeat interval (default: 10s)\n- `-buffer`: Buffer size in bytes (default: 4096)\n- `-cleanup`: Cleanup interval (default: 60s)\n- `-log-level`: Log level (debug/info/warn/error, default: info)\n- `-idle-timeout`: Idle connection timeout (default: 300s)\n\n### Client Options\n- `-server`: Remote server address (required)\n- `-sport`: Remote server port (default: 8080)\n- `-local`: Local service address (default: \"127.0.0.1\")\n- `-lport`: Local service port (required)\n- `-key`: Encryption key (required)\n- `-udp`: Enable UDP mode for UDP service forwarding\n- `-max-retry`: Maximum reconnection attempts (default: 3)\n- `-retry-delay`: Delay between reconnection attempts (default: 3s)\n- `-buffer`: Buffer size in bytes (default: 4096)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusamikinoko%2Fkankan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusamikinoko%2Fkankan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusamikinoko%2Fkankan/lists"}