{"id":13774870,"url":"https://github.com/roccomuso/nc","last_synced_at":"2025-09-14T05:31:17.940Z","repository":{"id":57309159,"uuid":"90661820","full_name":"roccomuso/nc","owner":"roccomuso","description":"Porting Netcat in Node.js. CLI util. :computer:","archived":false,"fork":false,"pushed_at":"2021-10-29T11:25:23.000Z","size":42,"stargazers_count":24,"open_issues_count":4,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T11:49:30.644Z","etag":null,"topics":["backdoor","cli","net","netcat","nodejs","porting","server","tcp","udp","util"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/roccomuso.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}},"created_at":"2017-05-08T18:51:47.000Z","updated_at":"2025-07-08T12:20:17.000Z","dependencies_parsed_at":"2022-09-09T19:11:41.476Z","dependency_job_id":null,"html_url":"https://github.com/roccomuso/nc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/roccomuso/nc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roccomuso","download_url":"https://codeload.github.com/roccomuso/nc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roccomuso%2Fnc/sbom","scorecard":{"id":781600,"data":{"date":"2025-08-11","repo":{"name":"github.com/roccomuso/nc","commit":"f481b354f140f91fb3dabf23f1fac908dcae258b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T05:02:42.970Z","repository_id":57309159,"created_at":"2025-08-23T05:02:42.970Z","updated_at":"2025-08-23T05:02:42.970Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275063204,"owners_count":25398934,"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","status":"online","status_checked_at":"2025-09-14T02:00:10.474Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["backdoor","cli","net","netcat","nodejs","porting","server","tcp","udp","util"],"created_at":"2024-08-03T17:01:31.142Z","updated_at":"2025-09-14T05:31:17.691Z","avatar_url":"https://github.com/roccomuso.png","language":"JavaScript","funding_links":["https://patreon.com/roccomuso"],"categories":["\u003ca id=\"b35965810463fb97b1ca26d94a8b62f0\"\u003e\u003c/a\u003eNetcat"],"sub_categories":[],"readme":"# nc\n\n[![NPM Version](https://img.shields.io/npm/v/nc.svg)](https://www.npmjs.com/package/nc)\n![node](https://img.shields.io/node/v/nc.svg)\n[![Dependency Status](https://david-dm.org/roccomuso/nc.png)](https://david-dm.org/roccomuso/nc)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/roccomuso\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\nPorting Netcat in Node.js. CLI util. :computer:\n\nTo embed it in your Node.js app use the [netcat](https://github.com/roccomuso/netcat) package instead. This is meant to be used as a standalone tool, but it's not fully equal to the original implementation of netcat.\n\n| Linux | Mac OS | Windows |\n|-------|--------|---------|\n| :white_check_mark: | :white_check_mark: | :white_check_mark: |\n\n## What you can do\n\n- [x] TCP \u0026 UDP\n- [x] Backdoor (Reverse Shell)\n- [x] Honeypot\n- [x] File transfer\n- [x] Port forwarding\n- [ ] Proxy\n- [x] Web Server \u0026 HTTP Client\n- [x] Port scanning\n\n## Install\n\n    $ npm install -g nc\n\n## Usage\n\n    $ nc -l -p port [- options] [hostname] [port]\n\nAvailable options:\n\n```\n-c shell commands    as `-e’; use /bin/sh to exec [dangerous!!]\n-e filename          program to exec after connect [dangerous!!]\n-b                   allow broadcasts\n-h                   this cruft\n-i secs              delay interval for lines sent, ports scanned\n-k set               keepalive option on socket\n-l                   listen mode, for inbound connects\n-n                   numeric-only IP addresses, no DNS\n-o file              hex dump of traffic\n-p port              local port number\n-r                   randomize local and remote ports\n-s addr              local source address\n-u                   UDP mode\n-U                   Listen or connect to a UNIX domain socket\n-v                   verbose\n-w secs              timeout for connects and final net reads (client-side)\n-z                   zero-I/O mode [used for scanning]\n```\n\n#### Server: Listen for inbound\n\n    $ nc -l -p 2389\n\n#### Client mode\n\n    $ nc localhost 2389\n\nOpening a raw connection to port `2389`.\n\n#### Transfer file\n\n| Server side         | Client side                        |\n|---------------------|------------------------------------|\n| `nc -l 2389 \u003e test` | \u003ccode\u003ecat testfile \u0026#124; nc localhost 2389\u003c/code\u003e |\n\n#### Timeout support\n\n    $ nc -w 10 localhost 2389\n\nConnection above would be terminated after 10 seconds.\n\n#### Force netcat server to stay up\n\n    $ nc -kl 2389\n\nIn this way the server remains up even if the client got disconnected.\n\n#### Netcat execute\n\nA far more exciting thing to do is to get a quick shell going on a remote machine by using the `-l` or `listen` option and the `-e` or `execute` option. When a connection is made, Netcat executes the program of your choice and connects the `stdin` and `stdout` of the program to the network connection.\n\n    $ nc -l -p 23 -e /bin/sh\n\n#### Retrieve a website Homepage\n\nLet's create a HTTP request file `get.txt` that contains the following line and then a blank\nline:\n\n```\nGET / HTTP/1.0\n\n```\n\nTo use Netcat to retrieve the home page of a web site use:\n\n    $ nc -v www.website.com 80 \u003c get.txt\n\nYou will see Netcat make a connection to port 80, send the text contained in the file `get.txt`, and then output the web server's response to `stdout`.\n\n#### Configure netcat client to retry on disconnect\n\nIn a normal scenario, if the nc client disconnect, it will not retry the connection.\nWith the `--retry \u003csecs\u003e` or `-R \u003csecs\u003e` param, it will retry the connection after tot seconds.\n\n    $ nc -R 5 localhost 2389\n\n#### Unix socket file\n\nIf you have docker, let's try to list our containers' images connecting to the docker unix socket file:\n\n```sh\n$ echo -e \"GET /images/json HTTP/1.0\\r\\n\" | nc -U /var/run/docker.sock\n```\n\nPS. for this example root permissions are required: `sudo su`.\n\n#### Netcat as a Proxy\n\n```sh\n$ mkfifo /tmp/fifo\n$ nc -l -k -p 8080 \u003c/tmp/fifo | nc website.com 80 \u003e/tmp/fifo\n```\n\n#### Netcat as a simple port scanner\n\n    $ nc -z 192.168.1.100 1-255\n\n#### Dump hex traffic\n\nIf you use the `-o` option you can dump all hex traffic.\n\n    $ nc 127.0.0.1 4445 -o /tmp/log.txt\n\n#### UDP Protocol\n\nBy default all the sockets that nc utility creates are TCP protocols but this utility also works with UDP protocol. To enable UDP protocol the -u flag is used.\n\n| Server side         | Client side                        |\n|---------------------|------------------------------------|\n| `nc -u -l -p 2389` | `nc -u localhost 2389` |\n\n#### Send a UDP message\n\n    $ echo 'message' | nc -w 1 -u 192.168.1.111 514\n\nPipe via UDP (-u) with a wait time (-w) of 1 second to `192.168.1.111` on port `514`.\n\n## DEBUG\n\nDebug matches the verbose mode.\nYou can enable it with the `-v` param or the env var `DEBUG=nc`. This module uses the node implementation of [netcat](https://github.com/roccomuso/netcat) under the hood, to debug both use: `DEBUG=netcat:*,nc`.\n\n\n## Author\n\nRocco Musolino ([@roccomuso](https://twitter.com/roccomuso))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fnc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froccomuso%2Fnc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froccomuso%2Fnc/lists"}