簡體   English   中英

“#awk '/open/{print $2}' hostdiscovery.gnmap > livehosts.txt”需要一個 windows Nmap 行

[英]Need a windows Nmap line for “# awk '/open/{print $2}' hostdiscovery.gnmap > livehosts.txt”

我需要在第一次掃描端口后執行此步驟,之后我有一個hostdiscovery.gnmap文件,這是我的下一步:

awk '/open/{print $2}' hostdiscovery.gnmap > livehosts.txt

但這是一個 Linux 命令行,我正在為這個項目使用 windows 我需要在我的 PC 上執行...你知道我如何獲得類似的 Z0F4137ED1502B5045D6083AA258B5C4Z2 命令嗎?

這是我在第 2 步的來源: https://www.networkstraining.com/nmap-commands-cheat-sheet/

使用 Powershell:

ForEach ( $lin in Get-Content hostdiscovery.gnmap ) { if ($lin -like "*open*") { $wrds=$lin.Split(" "); Write-Output $wrds[1] } } >> livehosts.txt

逐行讀取文件hostdiscovery.gnmap,然后如果該行包含“open”,則將該行拆分為數組wrds並打印第一個索引(第二個單詞)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM