{"id":23989585,"url":"https://github.com/cyberroute/scanme","last_synced_at":"2025-04-14T13:53:03.675Z","repository":{"id":216674422,"uuid":"739754167","full_name":"CyberRoute/scanme","owner":"CyberRoute","description":"A Golang package for scanning private and public IPs for open TCP ports 👁️","archived":false,"fork":false,"pushed_at":"2024-03-25T14:01:35.000Z","size":503,"stargazers_count":90,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-03-25T15:38:47.669Z","etag":null,"topics":["golang","gopacket","information-gathering","network-analysis","network-programming","network-security","nmap","nmap-scan","pcap","scanning","security-audit","security-scanner","security-tools","socket-programming","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CyberRoute.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}},"created_at":"2024-01-06T12:51:57.000Z","updated_at":"2024-04-23T14:01:14.527Z","dependencies_parsed_at":"2024-04-23T14:01:08.841Z","dependency_job_id":null,"html_url":"https://github.com/CyberRoute/scanme","commit_stats":null,"previous_names":["cyberroute/scanme"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fscanme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fscanme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fscanme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CyberRoute%2Fscanme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CyberRoute","download_url":"https://codeload.github.com/CyberRoute/scanme/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248891501,"owners_count":21178654,"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","gopacket","information-gathering","network-analysis","network-programming","network-security","nmap","nmap-scan","pcap","scanning","security-audit","security-scanner","security-tools","socket-programming","tcp"],"created_at":"2025-01-07T17:32:07.566Z","updated_at":"2025-04-14T13:53:03.662Z","avatar_url":"https://github.com/CyberRoute.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/CyberRoute/scanme/releases/latest\"\u003e\u003cimg alt=\"Release\" src=\"https://img.shields.io/github/release/CyberRoute/scanme.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/CyberRoute/scanme/actions/workflows/golangci-lint.yml/badge.svg?branch=main\"\u003e\u003cimg alt=\"golangci-lint\" src=\"https://img.shields.io/badge/golangci-lint-brightgreen.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://goreportcard.com/badge/github.com/CyberRoute/scanme\"\u003e\u003cimg alt=\"Go Report\" src=\"https://img.shields.io/badge/go%20report-A+-brightgreen.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/CyberRoute/scanme/blob/main/LICENSE\"\u003e\u003cimg alt=\"Software License\" src=\"https://img.shields.io/badge/license-GPL3-brightgreen.svg?style=flat\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://godoc.org/github.com/CyberRoute/scanme\"\u003e \u003cimg alt=\"Docs\" src=\"https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Scanme :eye:\n\nScanme is a Go package for network scanning using the GoPacket library. It allows scanning a single IP address for open ports.\nThis is not an attempt to rewrite **nmap**, probably the most popular scan, but learn more deeply about network scanning technics, parallelism\nis not yet implemented but will be coming soon. Despite scanning the 65k tcp ports serially it is pretty fast if compared with:\n\n```bash\nnmap -vvv -sS -p 1-65535 {target_IP}\nnmap -vvv -sT -p 1-65535 {target_IP}\n```\n\n## Features\n\n- **SYN Scan:** Perform SYN scans to identify open ports on a target host (supports IPv4 and IPv6).\n- **Connect Scan:** Perform a full TCP handshake on a target host (supports IPv4 and IPv6).\n- **ICMP Echo Request:** Send ICMP Echo Requests to discover live hosts on the network.\n- **Banners Grabbing:** An experimental feature so far on FTP, SSH, DNS, IRC, MYSQL, LDAPS, HTTP, HTTPS, NNTP, IMAP, POP.\n\n```\n2024/03/07 14:20:34 Port 21(ftp) open Banner: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\n2024/03/06 16:42:16 Port 22(ssh) open Banner: SSH-2.0-OpenSSH_7.4\n2024/03/07 14:20:34 Port 25(smtp) open Banner: 220-tomasi.dnshigh.com ESMTP Exim 4.96.2 #2 Thu, 07 Mar 2024 14:20:34 +0100\n2024/03/25 14:48:49 Port 53(domain) open Banner: dnsmasq-2.84rc2\n2024/03/07 14:20:34 Port 80(http) open Banner: Apache\n2024/03/12 14:50:39 Port 443(https) open Banner: Microsoft-IIS/10.0\n2024/03/07 14:20:34 Port 110(pop3) open Banner: +OK Dovecot ready.\n2024/03/07 14:20:34 Port 143(imap) open Banner: * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE NAMESPACE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] Dovecot ready.\n2024/03/06 16:43:36 Port 3306(mysql) open Banner: 8.0.36\n2024/03/07 14:15:59 Port 636(ldaps) open Banner: objectClass: [top vmwDseRoot]cn: [DSE Root]supportedLDAPVersion: [3]vmwPlatformServicesControllerVersion: [6.5.0]msDS-SiteName: [Default-First-Site]subSchemaSubEntry: [cn=aggregate,cn=schemacontext]defaultNamingContext: [dc=vsphere,dc=local]\n```\n\n## Example Simple scanner\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"/assets/scanme.png\" width=\"800px\"\u003c/img\u003e\n\u003c/div\u003e\n\n## Installation\n\n- On Linux, install `libpcap`\n```bash\nsudo apt install -y libpcap-dev\n```\n```bash\ngo get -u github.com/CyberRoute/scanme\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"flag\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/CyberRoute/scanme/scanme\"\n\t\"github.com/google/gopacket/routing\"\n)\n\nvar (\n\ttargetIP = flag.String(\"ip\", \"127.0.0.1\", \"IP address to bind the web UI server to.\")\n)\n\nfunc main() {\n\n\tflag.Parse()\n\tif *targetIP == \"\" {\n\t\tfmt.Println(\"No ip specified.\")\n\t\tflag.Usage()\n\t\tos.Exit(1)\n\t}\n\ttargetIP := *targetIP\n\n\tip := net.ParseIP(targetIP)\n\tif ip == nil {\n\t\tlog.Fatalf(\"Invalid IP address: %q\", targetIP)\n\t} else if ip = ip.To4(); ip == nil {\n\t\tlog.Fatalf(\"Non-IPv4 address provided: %q\", targetIP)\n\t}\n\n\tstartTime := time.Now() // Record the start time\n\n\trouter, err := routing.New()\n\tif err != nil {\n\t\tlog.Fatal(\"Routing error:\", err)\n\t}\n\n\tscanner, err := scanme.NewScanner(ip, router)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to create scanner for %v: %v\", ip, err)\n\t}\n\n\topenPorts, err := scanner.Synscan()\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to scan %v: %v\", ip, err)\n\n\t}\n\t// Process open ports\n\tfor port, service := range openPorts {\n\t\tlog.Printf(\"Port %v is %v\", port, service)\n\t}\n\n\tdefer scanner.Close()\n\n\telapsedTime := time.Since(startTime)\n\tlog.Printf(\"Execution time: %s\", elapsedTime)\n}\n```\n\n## Sample scan\n```\nalessandro@xps:~/Development/scanme$ sudo go run main.go -ip 172.16.168.131\n[sudo] password for alessandro:\n2024/01/11 15:04:53 scanning ip 172.16.168.131 with interface vmnet8, gateway \u003cnil\u003e, src 172.16.168.1\n2024/01/11 15:04:53 ICMP Echo Reply received from 172.16.168.131\n2024/01/11 15:04:54 last port scanned for 172.16.168.131 dst port 65535 assuming we've seen all we can\n2024/01/11 15:04:54 Port 445(microsoft-ds) is open\n2024/01/11 15:04:54 Port 139(netbios-ssn) is open\n2024/01/11 15:04:54 Port 143(imap) is open\n2024/01/11 15:04:54 Port 443(https) is open\n2024/01/11 15:04:54 Port 5001(commplex-link) is open\n2024/01/11 15:04:54 Port 8080(http-alt) is open\n2024/01/11 15:04:54 Port 8081(sunproxyadmin) is open\n2024/01/11 15:04:54 Port 22(ssh) is open\n2024/01/11 15:04:54 Port 80(http) is open\n2024/01/11 15:04:54 Execution time: 963.973315ms\n```\n\n## Contribute\nContributions are welcome! If you find any issues or have suggestions for improvement, please create an issue or pull request.\n\n## License\nScanme is developed by Alessandro Bresciani with some help from various projects and released with GPL license.\n\n## Acknowledgments\nInspired by and wanting to improve this https://github.com/google/gopacket/blob/master/examples/synscan/main.go\nTechnical details checked here https://nmap.org/book/synscan.html and obviously https://github.com/nmap/nmap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberroute%2Fscanme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcyberroute%2Fscanme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcyberroute%2Fscanme/lists"}