如何在全球互联网上使用反向 shell?
我对计算机和黑客技术非常陌生。 我的问题是:
- 如何在全球 IP 上使用反向 shell?
- 我是否需要服务器,或者在路由器上运行的电脑/Raspberry Pi 可以工作吗?
- 我们的路由器有一个动态IP,但它不会经常改变。这可能会带来麻烦吗?
谢谢!
I'm very new to computers and hacking.
The questions I have:
- How does one use a reverse shell over a global IP?
- Do I need a server or will my pc/Raspberry Pi running on my router work?
- Our Router has a dynamic IP, but it doesn't change often. Might this cause trouble?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如何在全球互联网上使用反向 Shell(针对初学者)
好的,您是黑客新手,并且希望通过互联网获得反向 Shell。这是使用 nc (Netcat)、socat 和 ngrok 执行此操作的简单方法。它适合初学者,即使您的路由器的 IP 是动态的,它也能工作。
第 1 步:设置侦听器
您需要一个侦听器来捕获反向 shell。在您的 PC 上启动它:
使用 Netcat:
或者,如果您喜欢 socat(如果您必须建立基于套接字的连接,则需要 Netcat 的精美版本):
第 2 步:使用 ngrok 获取公共 IP
您的电脑位于路由器后面,因此它没有全局 IP。这就是 ngrok 拯救世界的地方。
运行此命令将端口 4444 公开到互联网:
Ngrok 会输出如下内容:
这是您的公共 IP 和端口。把它写下来(或者让 ngrok 保持运行)。
第 3 步:获取反向 shell
现在,在目标计算机上(当然是您正在黑客攻击的机器……当然是道德的),您将使用此公共 IP 和端口作为反向 shell。将 43.43.34.23 和 98234 替换为您的 ngrok 详细信息。
一些反向 shell 示例:
使用 Bash(如果有):
使用 Netcat:
使用 Python(如果没有 Bash/Netcat):
有很多选项,您选择取决于系统
步骤 4:捕获 shell
返回到您的侦听器。
当目标机器运行反向 shell 命令时,您将看到连接。
现在,您将在目标上拥有一个远程 shell系统!$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
How to Use a Reverse Shell Over Global Internet (For Beginners)
Okay, so you’re new to hacking and want to get a reverse shell over the internet. Here’s a simple way to do it using nc (Netcat), socat, and ngrok. It’s beginner-friendly and works even if your router’s IP is dynamic.
Step 1: Set up a listener
You need a listener to catch the reverse shell. Fire this up on your PC:
With Netcat:
Or, if you like socat (fancy version of Netcat if you have to make socket based connection):
Step 2: Use ngrok to get a public IP
Your PC is behind a router, so it doesn’t have a global IP. This is where ngrok saves the day.
Run this command to expose port 4444 to the internet:
Ngrok will spit out something like this:
That’s your public IP and port. Write it down (or just keep ngrok running).
Step 3: Get the reverse shell
Now, on the target machine (the one you’re hacking... ethically, of course), you’ll use this public IP and port for the reverse shell. Replace 43.43.34.23 and 98234 with your ngrok details.
Some reverse shell examples:
Using Bash (if available):
Using Netcat:
Using Python (if Bash/Netcat isn’t there):
There are many of options, you choose depends on the system
Step 4: Catch the shell
Go back to your listener.
When the target machine runs the reverse shell command, you’ll see the connection.
You’ll now have a remote shell on the target system!$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
<代码>1。如何通过全局 IP 使用反向 shell?
您需要在设备上托管一个侦听器,然后需要对路由器进行端口转发以允许公开访问侦听器。
<代码>2。我需要服务器吗?或者我的电脑/树莓派在路由器上运行可以工作吗?
任何电脑/树莓派都可以。唯一需要注意的是,反向 shell 仅在设备打开时才接受连接。
<代码>3。我们的路由器有一个动态IP,但它不会经常改变。这可能会造成麻烦吗?
如果您的路由器的公共IP地址发生变化,那么您当前部署的所有客户端都将停止工作。要么准备好在每次更改时重新制作它们,要么为您的路由器设置动态 DNS 并使用它来创建二进制文件。
1. How does one use a reverse shell over a global IP?
You need to host a listener on your device, then your need to port forward your router to allow the listener to be publicly accessible.
2. Do I need a server or will my pc/Raspberry Pi running on my router work?
Any pc/raspberry pi is fine. Only thing to note is that the reverse shell will only accept connections if the device is turned on.
3. Our Router has a dynamic IP, but it doesn't change often. Might this cause trouble?
If your router's public IP address changes, then all your currently deployed clients will stop working. Either be prepared to remake them each time it changes, or setup dynamic DNS for your router and use that to create your binaries.