{"id":1381,"date":"2017-04-29T15:30:40","date_gmt":"2017-04-29T14:30:40","guid":{"rendered":"https:\/\/www.phillips321.co.uk\/?p=1381"},"modified":"2019-05-23T08:42:14","modified_gmt":"2019-05-23T07:42:14","slug":"netkit-ipv6-test-lab","status":"publish","type":"post","link":"https:\/\/www.phillips321.co.uk\/2017\/04\/29\/netkit-ipv6-test-lab\/","title":{"rendered":"NetKit IPv6 Test Lab"},"content":{"rendered":"<p>So IPv6 is on the rise and I needed something simple to play with IPv6. I decided the best port of call would be spinning up a <a href=\"https:\/\/netkit-ng.github.io\" target=\"_blank\">netkit<\/a> lab inside a VM. I quickly built a light weight ubuntu 16.04&#215;64 machine and installed netkit. (Installation is pretty simple, just <a href=\"https:\/\/netkit-ng.github.io\" target=\"_blank\">follow the details on the homepage<\/a>)<\/p>\n<p>I then downloaded the <a href=\"http:\/\/wiki.netkit.org\/contributed_labs\/Sandro_Doro\/\" target=\"_blank\">Lab hosted here<\/a> which is perfect and has everything you need to get things going. Thanks to S.Doro and others for this.<\/p>\n<p><a href=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-14.50.23.png\"><img loading=\"lazy\" src=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-14.50.23-300x155.png\" alt=\"\" width=\"300\" height=\"155\" class=\"aligncenter size-medium wp-image-1382\" srcset=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-14.50.23-300x155.png 300w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-14.50.23-768x398.png 768w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-14.50.23-1024x530.png 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>The next thing I wanted to do was add some specific tools to the images of each box, specifically <a href=\"https:\/\/github.com\/vanhauser-thc\/thc-ipv6\" target=\"_blank\">THC tools<\/a> and <a href=\"https:\/\/nmap.org\" target=\"_blank\">nmap<\/a> so that I could practise host discovery techniques.<\/p>\n<p>The easiest way to do this is to simply mount the virtual drive image, chroot into it and then apt-get what you want.<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">mkdir<\/span> <span class=\"sy0\">\/<\/span>mnt<span class=\"sy0\">\/<\/span>nkfs<br \/>\n<span class=\"kw2\">mount<\/span> netkit-fs-i386-F7.0 <span class=\"sy0\">\/<\/span>mnt<span class=\"sy0\">\/<\/span>nkfs<br \/>\n<span class=\"kw2\">chroot<\/span> <span class=\"sy0\">\/<\/span>mnt<span class=\"sy0\">\/<\/span>nkfs<br \/>\n<span class=\"kw3\">echo<\/span> 8.8.8.8 <span class=\"sy0\">&amp;<\/span>gt;<span class=\"sy0\">&amp;<\/span>gt; <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>resolve.conf<br \/>\n<span class=\"kw2\">apt-get update<\/span><br \/>\n<span class=\"kw2\">apt-get install<\/span> <span class=\"kw2\">nmap<\/span> thc-ipv6<br \/>\n<span class=\"kw3\">exit<\/span><br \/>\n<span class=\"kw2\">umount<\/span> <span class=\"sy0\">\/<\/span>mnt<span class=\"sy0\">\/<\/span>nkfs<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Now when you boot up the netkit lab you&#8217;ll have nmap and atk6-* tools at your disposal.<br \/>\n<a href=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-16.53.47.png\"><img loading=\"lazy\" src=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-16.53.47-300x142.png\" alt=\"\" width=\"300\" height=\"142\" class=\"aligncenter size-medium wp-image-1384\" srcset=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-16.53.47-300x142.png 300w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-16.53.47-768x363.png 768w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-16.53.47-1024x484.png 1024w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2017\/04\/Screen-Shot-2017-04-29-at-16.53.47.png 1478w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Updates for x64 ubuntu installs (thanks Hillier):<\/h2>\n<p>If error you need i386 packages:<br \/>\n<a href=\"https:\/\/blog.teststation.org\/ubuntu\/2016\/05\/12\/installing-32-bit-software-on-ubuntu-16.04\/\">https:\/\/blog.teststation.org\/ubuntu\/2016\/05\/12\/installing-32-bit-software-on-ubuntu-16.04\/<\/a><\/p>\n<p>The next challenge I had was the current netkit base image used a depreciated mirror so I had to update my apt sources, I used:<br \/>\n<a href=\"https:\/\/gist.github.com\/rohitrawat\/60a04e6ebe4a9ec1203eac3a11d4afc1\">https:\/\/gist.github.com\/rohitrawat\/60a04e6ebe4a9ec1203eac3a11d4afc1<\/a><br \/>\nFinally I wanted to test setting routing statically on a box and chose to extend the current lab. I added a second router between the pc1 and pc2 switches. To do this I did the following:<\/p>\n<p>copy the r1.disk to r3.disk<\/p>\n<p>create r3.startup<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/>6<br \/>7<br \/>8<br \/>9<br \/>10<br \/>11<br \/>12<br \/>13<br \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">cat<\/span> r3.startup<br \/>\n<span class=\"kw2\">ip link<\/span> <span class=\"kw1\">set<\/span> eth0 address 00:00:00:00:00:01<br \/>\n<span class=\"kw2\">ip link<\/span> <span class=\"kw1\">set<\/span> eth0 up<br \/>\n<span class=\"kw2\">ip<\/span> <span class=\"re5\">-6<\/span> addr add fd88:<span class=\"nu0\">8844<\/span>:468d:<span class=\"nu0\">1<\/span>::<span class=\"nu0\">17<\/span><span class=\"sy0\">\/<\/span><span class=\"nu0\">64<\/span> dev eth0<br \/>\n<span class=\"co0\">#<\/span><br \/>\n<span class=\"kw2\">ip link<\/span> <span class=\"kw1\">set<\/span> eth1 address 00:00:00:00:00:09<br \/>\n<span class=\"kw2\">ip link<\/span> <span class=\"kw1\">set<\/span> eth1 up<br \/>\n<span class=\"kw2\">ip<\/span> <span class=\"re5\">-6<\/span> addr add fd88:<span class=\"nu0\">8844<\/span>:468d:<span class=\"nu0\">3<\/span>::<span class=\"nu0\">19<\/span><span class=\"sy0\">\/<\/span><span class=\"nu0\">64<\/span> dev eth1<br \/>\n<span class=\"co0\">#<\/span><br \/>\n<span class=\"co0\">#ip -6 route add default via fd88:8844:468d:2::10<\/span><br \/>\n<span class=\"co0\">#<\/span><br \/>\n<span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;1&quot;<\/span> <span class=\"sy0\">&amp;<\/span>gt; <span class=\"sy0\">\/<\/span>proc<span class=\"sy0\">\/<\/span>sys<span class=\"sy0\">\/<\/span>net<span class=\"sy0\">\/<\/span>ipv6<span class=\"sy0\">\/<\/span>conf<span class=\"sy0\">\/<\/span>all<span class=\"sy0\">\/<\/span>forwarding<br \/>\nmade a folder called r3<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Added the following lines to lab.conf<\/p>\n<div class=\"codecolorer-container bash vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/><\/div><\/td><td><div class=\"bash codecolorer\">r3<span class=\"br0\">&#91;<\/span><span class=\"nu0\">0<\/span><span class=\"br0\">&#93;<\/span>=<span class=\"st0\">&quot;A&quot;<\/span><br \/>\nr3<span class=\"br0\">&#91;<\/span><span class=\"nu0\">1<\/span><span class=\"br0\">&#93;<\/span>=<span class=\"st0\">&quot;C&quot;<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Then when you are on PC1 you can test pinging over the default route to pc2. To break the route I went to a router and downed an interface to break the route. Then you can statically set a route on pc1 via the other router.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So IPv6 is on the rise and I needed something simple to play with IPv6. I decided the best port of call would be spinning up a netkit lab inside a VM. I quickly built a light weight ubuntu 16.04&#215;64 machine and installed netkit. (Installation is pretty simple, just follow the details on the homepage) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1382,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[471,470,473,474,472],"_links":{"self":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/1381"}],"collection":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/comments?post=1381"}],"version-history":[{"count":5,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/1381\/revisions"}],"predecessor-version":[{"id":1425,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/1381\/revisions\/1425"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media\/1382"}],"wp:attachment":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media?parent=1381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/categories?post=1381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/tags?post=1381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}