{"id":428,"date":"2015-07-31T08:46:18","date_gmt":"2015-07-31T06:46:18","guid":{"rendered":"https:\/\/olkn.myvnc.com\/?p=428"},"modified":"2015-12-01T08:57:51","modified_gmt":"2015-12-01T07:57:51","slug":"connect-to-tcp-port-using-bash-only","status":"publish","type":"post","link":"https:\/\/olkn.myvnc.com\/?p=428","title":{"rendered":"connect to TCP port using bash only"},"content":{"rendered":"<p>The device \/dev\/tcp\/<hostname>\/<port> may be used to access the TCP stack<\/p>\n<p>here is an example using redirects to connect to a specific service<\/p>\n<p><code>exec 7<>\/dev\/tcp\/www.google.com\/80; cat <&#038;5 &#038; cat >&5; exec 5>&-<\/code><\/p>\n<p>exec is used to redirect to a new file descriptor 7 whereas the cat redirects descriptor 7 to STDOUT. And finally the descriptor is cleaned up with the last exec.<\/p>\n<p>Checking a remote port with just cat<br \/>\ncat < \/dev\/tcp\/<ip adress>\/<port>\n","protected":false},"excerpt":{"rendered":"<p>The device \/dev\/tcp\/\/ may be used to access the TCP stack here is an example using redirects to connect to a specific service exec 7\/dev\/tcp\/www.google.com\/80; cat &#038;5; exec 5>&#038;- exec is used to redirect to a new file descriptor 7 whereas the cat redirects descriptor 7 to STDOUT. And finally the descriptor is cleaned up &hellip; <a href=\"https:\/\/olkn.myvnc.com\/?p=428\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">connect to TCP port using bash only<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[35,148,47,79,147,149],"class_list":["post-428","post","type-post","status-publish","format-standard","hentry","category-sniplets","tag-administration","tag-bash","tag-connect","tag-linux","tag-network","tag-tools"],"_links":{"self":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts\/428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=428"}],"version-history":[{"count":2,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions"}],"predecessor-version":[{"id":458,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=\/wp\/v2\/posts\/428\/revisions\/458"}],"wp:attachment":[{"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/olkn.myvnc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}