{"id":92,"date":"2011-05-25T20:30:24","date_gmt":"2011-05-25T19:30:24","guid":{"rendered":"http:\/\/www.phillips321.co.uk\/?p=92"},"modified":"2011-07-13T10:45:49","modified_gmt":"2011-07-13T09:45:49","slug":"cisco-pix-firewall-config-that-needs-understanding","status":"publish","type":"post","link":"https:\/\/www.phillips321.co.uk\/2011\/05\/25\/cisco-pix-firewall-config-that-needs-understanding\/","title":{"rendered":"Cisco PIX firewall config that needs understanding?"},"content":{"rendered":"<p>So, you&#8217;ve been given a cisco config from a pix firewall using<\/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 \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"st_h\">'show run'<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>and you&#8217;ve looked through it and it seems a ballache to understand. We know we could use nipper but you either have to pay a wedge for the <a href=\"http:\/\/www.titania-security.com\/\">professional version<\/a> of suffer with the <a href=\"http:\/\/packetstormsecurity.org\/search\/?q=nipper\">free version<\/a>.<\/p>\n<p>After a little googling I found a few tools to help along the way.<br \/>\n<a href=\"http:\/\/www.fwbuilder.org\/\">fwbuilder<\/a> looks good but doesn&#8217;t support pix as of yet, maybe something to keep an eye on? &#8211; Installation is easy on debian systems:<\/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 \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw3\">echo<\/span> <span class=\"st0\">&quot;deb http:\/\/packages.fwbuilder.org\/deb\/stable\/ maverick contrib&quot;<\/span> <span class=\"sy0\">&gt;&gt;<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span>apt<span class=\"sy0\">\/<\/span>sources.list<br \/>\n<span class=\"kw2\">wget<\/span> http:<span class=\"sy0\">\/\/<\/span>www.fwbuilder.org<span class=\"sy0\">\/<\/span>PACKAGE-GPG-KEY-fwbuilder.asc<br \/>\n<span class=\"kw2\">apt-key add<\/span> PACKAGE-GPG-KEY-fwbuilder.asc<br \/>\n<span class=\"kw2\">apt-get update<\/span><br \/>\n<span class=\"kw2\">apt-get install<\/span> fwbuilder<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><a href=\"http:\/\/code.google.com\/p\/fwconfigparser\/\">fwconfigparser<\/a> is a a php script that takes input from a process.txt file and outputs as html &#8211; Quick installation via svn<\/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 \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">svn checkout<\/span> http:<span class=\"sy0\">\/\/<\/span>fwconfigparser.googlecode.com<span class=\"sy0\">\/<\/span>svn<span class=\"sy0\">\/<\/span>trunk<span class=\"sy0\">\/<\/span> fwconfigparser<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p><a href=\"http:\/\/code.google.com\/p\/routerdefense\/\">routerdefense<\/a> uses a cisco config to offer security recommendations (i guess like nipper?) &#8211; Quick installation via svn<\/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 \/><\/div><\/td><td><div class=\"bash codecolorer\"><span class=\"kw2\">svn checkout<\/span> http:<span class=\"sy0\">\/\/<\/span>routerdefense.googlecode.com<span class=\"sy0\">\/<\/span>svn<span class=\"sy0\">\/<\/span>trunk<span class=\"sy0\">\/<\/span> routerdefense<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>Unfortunately i could not use fwbuilder as it didn&#8217;t support pix firewalls so i cant demonstrate it here, maybe i can throw something together in the future. (Keep an eye on this for updates)<\/p>\n<p>fwconfigparser is as simple as copying the index.php to a browsable web directory and in the same directory placing the config file with the name process.txt<br \/>\n<a href=\"http:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2011\/05\/fwconfigparser.png\"><img loading=\"lazy\" class=\"alignnone size-medium wp-image-96\" title=\"fwconfigparser\" src=\"http:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2011\/05\/fwconfigparser-300x211.png\" alt=\"fwconfigparser\" width=\"300\" height=\"211\" srcset=\"https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2011\/05\/fwconfigparser-300x211.png 300w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2011\/05\/fwconfigparser-1024x722.png 1024w, https:\/\/www.phillips321.co.uk\/wp-content\/uploads\/2011\/05\/fwconfigparser.png 1049w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This helped but the next thing i played with was routerdefense.<br \/>\nIt&#8217;s not obvious at first what is happening when you try to run<\/p>\n<div class=\"codecolorer-container text vibrant\" style=\"overflow:auto;white-space:nowrap;width:100%;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/><\/div><\/td><td><div class=\"text codecolorer\">launch.sh<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>but after catting the file it becomes clear that the usage is as follows:<\/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 \/><\/div><\/td><td><div class=\"bash codecolorer\">python main.py <span class=\"re5\">-c<\/span> <span class=\"sy0\">\/<\/span>root<span class=\"sy0\">\/<\/span>config.txt <span class=\"re5\">-t<\/span> <span class=\"sy0\">\/<\/span>pentest<span class=\"sy0\">\/<\/span>audit<span class=\"sy0\">\/\/<\/span>template.conf<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<p>After an attempt to run the file it seems that for some reason it doesn&#8217;t work with either of the two configs i had \ud83d\ude41<\/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 \/>14<br \/>15<br \/>16<br \/>17<br \/>18<br \/>19<br \/><\/div><\/td><td><div class=\"bash codecolorer\">root<span class=\"sy0\">@<\/span>GnackTrackR7:<span class=\"sy0\">\/<\/span>pentest<span class=\"sy0\">\/<\/span>audit<span class=\"sy0\">\/<\/span>routerdefense<span class=\"co0\"># python main.py -c \/root\/config.txt -t \/pentest\/audit\/routerdefense\/template.conf <\/span><br \/>\n<br \/>\n______ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;_ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ______ &nbsp; &nbsp; &nbsp;__<br \/>\n<span class=\"sy0\">|<\/span> ___ \\ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"sy0\">|<\/span> &nbsp;_ &nbsp;\\ &nbsp; &nbsp;<span class=\"sy0\">\/<\/span> _<span class=\"sy0\">|<\/span><br \/>\n<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>_<span class=\"sy0\">\/<\/span> <span class=\"sy0\">\/<\/span>___ &nbsp;_ &nbsp; _<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>_ ___ _ __ &nbsp;<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>___<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>_ ___ _ __ &nbsp;___ &nbsp;___<br \/>\n<span class=\"sy0\">|<\/span> &nbsp; &nbsp;<span class=\"sy0\">\/\/<\/span> _ \\<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> __<span class=\"sy0\">\/<\/span> _ \\ <span class=\"st_h\">'__| | | | \/ _ \\ &nbsp;_\/ _ \\ '<\/span>_ \\<span class=\"sy0\">\/<\/span> __<span class=\"sy0\">|\/<\/span> _ <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>\\ \\ <span class=\"br0\">&#40;<\/span>_<span class=\"br0\">&#41;<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>_<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">||<\/span> &nbsp;__<span class=\"sy0\">\/<\/span> <span class=\"sy0\">|<\/span> &nbsp; &nbsp;<span class=\"sy0\">|<\/span> <span class=\"sy0\">|\/<\/span> <span class=\"sy0\">\/<\/span> &nbsp;__<span class=\"sy0\">\/<\/span> <span class=\"sy0\">||<\/span> &nbsp;__<span class=\"sy0\">\/<\/span> <span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span> \\__ \\ &nbsp;__<span class=\"sy0\">\/<\/span><br \/>\n\\_<span class=\"sy0\">|<\/span> \\_\\___<span class=\"sy0\">\/<\/span> \\__,_<span class=\"sy0\">|<\/span>\\__\\___<span class=\"sy0\">|<\/span>_<span class=\"sy0\">|<\/span> &nbsp; &nbsp;<span class=\"sy0\">|<\/span>___<span class=\"sy0\">\/<\/span> \\___<span class=\"sy0\">|<\/span>_<span class=\"sy0\">|<\/span> \\___<span class=\"sy0\">|<\/span>_<span class=\"sy0\">|<\/span> <span class=\"sy0\">|<\/span>_<span class=\"sy0\">|<\/span>___<span class=\"sy0\">\/<\/span>\\___<span class=\"sy0\">|<\/span><br \/>\n<br \/>\n=<span class=\"br0\">&#91;<\/span> Cisco IOS security assessment tool<br \/>\n=<span class=\"br0\">&#91;<\/span> http:<span class=\"sy0\">\/\/<\/span>www.packetfault.org<br \/>\n=<span class=\"br0\">&#91;<\/span> version 0.5.1<br \/>\n<br \/>\nTraceback <span class=\"br0\">&#40;<\/span>most recent call <span class=\"kw2\">last<\/span><span class=\"br0\">&#41;<\/span>:<br \/>\n&nbsp; File <span class=\"st0\">&quot;main.py&quot;<\/span>, line <span class=\"nu0\">97<\/span>, <span class=\"kw1\">in<\/span> <span class=\"sy0\">&lt;<\/span>module<span class=\"sy0\">&gt;<\/span><br \/>\n&nbsp; &nbsp; consoleCfg = parseConsole<span class=\"br0\">&#40;<\/span>lines<span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; File <span class=\"st0\">&quot;\/pentest\/audit\/routerdefense\/common.py&quot;<\/span>, line <span class=\"nu0\">250<\/span>, <span class=\"kw1\">in<\/span> parseConsole<br \/>\n&nbsp; &nbsp; <span class=\"kw1\">for<\/span> i <span class=\"kw1\">in<\/span> range<span class=\"br0\">&#40;<\/span>lineConLocation + <span class=\"nu0\">1<\/span>, len<span class=\"br0\">&#40;<\/span>lines<span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span>:<br \/>\nUnboundLocalError: <span class=\"kw3\">local<\/span> variable <span class=\"st_h\">'lineConLocation'<\/span> referenced before assignment<br \/>\nroot<span class=\"sy0\">@<\/span>GnackTrackR7:<span class=\"sy0\">\/<\/span>pentest<span class=\"sy0\">\/<\/span>audit<span class=\"sy0\">\/<\/span>routerdefense<span class=\"co0\">#<\/span><\/div><\/td><\/tr><\/tbody><\/table><\/div>\n","protected":false},"excerpt":{"rendered":"<p>So, you&#8217;ve been given a cisco config from a pix firewall using 1&#8217;show run&#8217; and you&#8217;ve looked through it and it seems a ballache to understand. We know we could use nipper but you either have to pay a wedge for the professional version of suffer with the free version. After a little googling I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4,1],"tags":[56,53,52,50,54,55,51],"_links":{"self":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/92"}],"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=92"}],"version-history":[{"count":9,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/92\/revisions"}],"predecessor-version":[{"id":187,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/posts\/92\/revisions\/187"}],"wp:attachment":[{"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/media?parent=92"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/categories?post=92"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phillips321.co.uk\/wp-json\/wp\/v2\/tags?post=92"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}