Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

arbitrary TCP and UDP connections and listens (Netcat for Python).

License

NotificationsYou must be signed in to change notification settings

bw0rth/pync

Repository files navigation

pync pync



Name

pync - arbitrary TCP and UDP connections and listens (Netcat for Python).

Synopsis

Unix
pync [-46bCDdhklnruvz] [-c string] [-e filename] [-I length]     [-i interval] [-O length] [-P proxyuser] [-p source_port]     [-q seconds] [-s source] [-T keyword] [-w timeout]     [-X proto] [-x addr[:port]]     [-Y pyfile] [-y pycode] [dest] [port]
Windows
py -m pync [-46bCDdhklnruvz] [-c string] [-e filename] [-I length]           [-i interval] [-O length] [-P proxyuser] [-p source_port]           [-q seconds] [-s source] [-T keyword] [-w timeout]           [-X proto] [-x addr[:port]]           [-Y pyfile] [-y pycode] [dest] [port]
Python
importpyncargs='''[-46bCDdhklnruvz] [-c string] [-e filename] [-I length]          [-i interval] [-O length] [-P proxyuser] [-p source_port]          [-q seconds] [-s source] [-T keyword] [-w timeout]          [-X proto] [-x addr[:port]]          [-Y pyfile] [-y pycode] [dest] [port]'''pync.run(args,stdin,stdout,stderr)

Description

Inspired by theBlack Hat Python book,the goal ofpync is to create an easy to use library thatprovidesNetcat-like functionality for Python developers.

Common uses include:

Installation

pync should work on any system withPythoninstalled (version 2.7 or higher).

Use Python's pip command to installpync straight from github:

Unix
python -m pip install https://github.com/bw0rth/pync/archive/main.zip
Windows
py -m pip install https://github.com/bw0rth/pync/archive/main.zip

Usage

Options

OptionDescription
-4Use IPv4 addresses only
-6Use IPv6 addresses only
-bAllow broadcast
-CSend CRLF as line-ending
-c stringspecify shell commands to exec after connect (use with caution).
-DEnable the debug socket option
-dDetach from stdin
-e filenamespecify filename to exec after connect (use with caution).
-h,--helpshow available options and exit.
-I lengthTCP receive buffer length
-i secsDelay interval for lines sent, ports scanned
-kKeep inbound sockets open for multiple connects
-lListen mode, for inbound connects
-nSuppress name/port resolutions
-O lengthTCP send buffer length
-P proxy_usernameUsername for proxy authentication
-p source_portSpecify local port for remote connects
-q secondsquit after EOF on stdin and delay of seconds
-rRandomize remote ports
-s sourceLocal source address
-T toskeywordSet IP Type of Service
-uUDP mode [default: TCP]
-vVerbose
-w secsTimeout for connects and final net reads
-X proxy_protocolProxy protocol: "4", "5" (SOCKS) or "connect"
-x proxy_address[:port]Specify proxy address and port
-Y pyfilespecify python file to exec after connect (use with caution).
-y pycodespecify python code to exec after connect (use with caution).
-zZero-I/O mode [used for scanning]
destThe destination host name or ip to connect or bind to
portThe port number to connect or bind to

API Reference

Examples

ExampleDescription
chat.pySimple chat protocol with a custom username
upload.pySimple file upload (use with caution).
download.pySimple file download (use with caution).
echo.pyEcho client/server
proxy.pySimple TCP proxy server
pyshell.pyReverse or bind python interpreter shell (use with caution).
scan.pySimple TCP connect port scanner
shell.pyReverse or bind remote system shell (use with caution).
sock.pyUsing sockets with pync

See Also

Caveats

UDP port scans will always succeed (i.e report the port as open), rendering the -uz combination of flagsrelatively useless.


[8]ページ先頭

©2009-2025 Movatter.jp