用asio寫埠掃瞄器?繆繆數行而已

2021-05-27 05:11:31 字數 1024 閱讀 1838

用asio寫網路,簡直是種享受啊,貼出來交流交流,**直接拷到新工程的main.cpp裡編譯就行了

#include #include #include using namespace boost::asio;

#include using boost::system::error_code;

#include using boost::bind;

#include using std::cout;

using std::endl;

#include using std::strcmp;

#include using std::atoi;

typedef boost::shared_ptrsocket_sp;

void conn_handler(socket_sp sock, ip::tcp::endpoint ep, const error_code& ec)

if (ec != error::operation_aborted)

}void scan_ip(const char* start, const char* end, unsigned short port)

io_service io_service;

boost::thread_group tg;

do } while (false);

tg.join_all();

}void scan_port(const char* ip, unsigned short start, unsigned short end)

io_service io_service;

boost::thread_group tg;

do } while (false);

tg.join_all();

}int main(int argc, char* argv)

else if (0 == strcmp(cmd, "--port"))

}else

return 0;

}

TCP埠掃瞄器

乙個基於python3的tcp埠掃瞄器 原理 就是和不同的埠進行tcp連線,能連線成功就表示此埠是開放的,不能連線成就表示此埠是關閉的。import socket import re import threading import time lock threading.lock threads l...

埠掃瞄器(masscan)

s.exe號稱史上最快 3分鐘掃完全網 掃瞄器小巧而精緻,大小僅僅8k,但是使用上有諸多限制,例如僅支援再winserver2003 上無條件使用,放到其它系統上就要對系統做一些配置,不然無法支援syn方式掃瞄,這顯然不夠友好。nmap掃瞄器,能探知系統型別是否存活等,但是同時獲得更詳細的資訊也就意...

Go埠掃瞄器

這次呢,咱們來實現乙個簡單的tcp埠掃瞄器!也來體驗一下黑客的風采!我們在使用tcp進行連線時,需要知道對方機器的ip port 連線成功的話,流程如下。有正常,就有失敗,如果被連線方關閉的話,流程如下。還有一種可能是,埠開放,但是 防火牆攔截,流程如下。本質理解之後,就可以開始擼 了。在go中,我...