{"id":2371,"date":"2024-04-16T16:41:52","date_gmt":"2024-04-16T15:41:52","guid":{"rendered":"https:\/\/dradis.com\/blog\/?p=2371"},"modified":"2024-04-16T16:41:53","modified_gmt":"2024-04-16T15:41:53","slug":"top-10-tables-a-custom-dradis-script","status":"publish","type":"post","link":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/","title":{"rendered":"Top 10 tables &#8211; a custom Dradis script"},"content":{"rendered":"\n<p>Imagine, you scan a few hundred hosts to create a summary report. You want to show data on ports and operating systems without giving the end user hundreds of pages of data. Enter the &#8220;<a href=\"https:\/\/github.com\/securityroots\/dradispro-scripting\/blob\/main\/top10.rb\">Top 10<\/a>&#8221; script! <\/p>\n\n\n\n<p>Credit for this script idea goes to Chris from I.S. Partners. He reached out via the support inbox to see if we could create a &#8220;<a href=\"https:\/\/github.com\/securityroots\/dradispro-scripting\/blob\/main\/top10.rb\">Top 10<\/a>&#8221; script that would do the following: <\/p>\n\n\n\n<ol>\n<li>Create an array of all of the operating systems, ports\/protocols, and services in the project<\/li>\n\n\n\n<li>Deduplicate the arrays and count the number of instances<\/li>\n\n\n\n<li>Narrow down the array to the top 10 based on the number of instances<\/li>\n\n\n\n<li>Update a Content Block in the project with a textile table based on each array<\/li>\n<\/ol>\n\n\n\n<p>The script assumes that you have a Content Block with the Type field set to &#8220;Top10&#8221; with the following fields: <\/p>\n\n\n\n<ul>\n<li>PortScanning<\/li>\n\n\n\n<li>OSEnumeration<\/li>\n\n\n\n<li>ServiceEnumeration<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-12.45.55-PM.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1102\" height=\"769\" src=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-12.45.55-PM.png\" alt=\"\" class=\"wp-image-2372\"\/><\/a><\/figure>\n\n\n\n<p>Head to our scripting repo and check out the &#8220;<a href=\"https:\/\/github.com\/securityroots\/dradispro-scripting\/blob\/main\/top10.rb\">Top 10<\/a>&#8221; script. To use it: <br><br>1. SCP the top10.rb file to your instance (e.g. to the \/tmp folder)<br><br>2. In the browser, find the project ID of the project that you need to update. For example, if your project lives at <code>\/pro\/projects\/123<\/code> in the browser, the ID is 123.<br><br>3. Run the following in the command line as &#8220;dradispro&#8221;: <br><code>$ cd \/opt\/dradispro\/dradispro\/current\/<\/code><br><code>$ RAILS_ENV=production bin\/rails runner \/tmp\/top10.rb &lt;project_id&gt;<\/code><\/p>\n\n\n\n<p>You&#8217;ll need to sub in your project ID (Step #2 above) for &#8220;&lt;project_id&gt;&#8221; above! Example:<\/p>\n\n\n\n<p><code>$ RAILS_ENV=production bin\/rails runner \/tmp\/top10.rb 123<\/code><\/p>\n\n\n\n<p>When the script completes, you&#8217;ll see this output in the console:<\/p>\n\n\n\n<p><code>Port Scanning table updated!<br>Service Enumeration table updated!<br>OS Enumeration table updated!<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-12.52.36-PM.png\"><img decoding=\"async\" loading=\"lazy\" width=\"842\" height=\"90\" src=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-12.52.36-PM.png\" alt=\"\" class=\"wp-image-2373\"\/><\/a><\/figure>\n\n\n\n<p>After running the script, you can refresh the Top 10 content block to see the updated tables: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-1.01.41-PM.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1086\" height=\"677\" src=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-1.01.41-PM.png\" alt=\"\" class=\"wp-image-2374\"\/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-1.02.03-PM.png\"><img decoding=\"async\" loading=\"lazy\" width=\"1088\" height=\"712\" src=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-1.02.03-PM.png\" alt=\"\" class=\"wp-image-2375\"\/><\/a><\/figure>\n\n\n\n<p>Chris reported that with their largest Nessus file (125MB), the script was able to perform the calculations successfully in less than 30 seconds. We&#8217;re optimistic about a similar script&#8217;s performance with your projects. <\/p>\n\n\n\n<p>This script will need to be adjusted to meet your individual team&#8217;s specific requirements and preferences. But, we think it&#8217;s a promising option for teams who prefer not to use VBA or want to create similar tables in their Word reports. <\/p>\n\n\n\n<p>If you need any help customizing this script to meet your specific use case, please <a href=\"https:\/\/dradis.com\/contact.html\">reach out<\/a> to our <a href=\"https:\/\/dradis.com\/support\/#team-rachael\">support team<\/a>. Or, if you have ideas for improvements, please <a href=\"https:\/\/github.com\/securityroots\/dradispro-scripting\/fork\">fork the repo<\/a> and post in our <a href=\"https:\/\/discuss.dradisframework.org\/\">users forum<\/a>. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Imagine, you scan a few hundred hosts to create a summary report. You want to show data on ports and operating systems without giving the end user hundreds of pages of data. Enter the &#8220;Top 10&#8221; script! Credit for this script idea goes to Chris from I.S. Partners. He reached out via the support inbox [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[9,1],"tags":[],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Top 10 tables - a custom Dradis script - Dradis Framework Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 10 tables - a custom Dradis script - Dradis Framework Blog\" \/>\n<meta property=\"og:description\" content=\"Imagine, you scan a few hundred hosts to create a summary report. You want to show data on ports and operating systems without giving the end user hundreds of pages of data. Enter the &#8220;Top 10&#8221; script! Credit for this script idea goes to Chris from I.S. Partners. He reached out via the support inbox [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/\" \/>\n<meta property=\"og:site_name\" content=\"Dradis Framework Blog\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-16T15:41:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-16T15:41:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-12.45.55-PM.png\" \/>\n<meta name=\"author\" content=\"Rachael Carder\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dradisfw\" \/>\n<meta name=\"twitter:site\" content=\"@dradisfw\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rachael Carder\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/\",\"url\":\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/\",\"name\":\"Top 10 tables - a custom Dradis script - Dradis Framework Blog\",\"isPartOf\":{\"@id\":\"https:\/\/dradis.com\/blog\/#website\"},\"datePublished\":\"2024-04-16T15:41:52+00:00\",\"dateModified\":\"2024-04-16T15:41:53+00:00\",\"author\":{\"@id\":\"https:\/\/dradis.com\/blog\/#\/schema\/person\/978f2d4e6ffa56f0569a62775a8320bb\"},\"breadcrumb\":{\"@id\":\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dradis.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Top 10 tables &#8211; a custom Dradis script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dradis.com\/blog\/#website\",\"url\":\"https:\/\/dradis.com\/blog\/\",\"name\":\"Dradis Framework Blog\",\"description\":\"Information management for security teams\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dradis.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/dradis.com\/blog\/#\/schema\/person\/978f2d4e6ffa56f0569a62775a8320bb\",\"name\":\"Rachael Carder\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dradis.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c6fd1058f5864e774d11780f6ba80d56?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c6fd1058f5864e774d11780f6ba80d56?s=96&d=mm&r=g\",\"caption\":\"Rachael Carder\"},\"url\":\"https:\/\/dradis.com\/blog\/author\/rachkor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Top 10 tables - a custom Dradis script - Dradis Framework Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/","og_locale":"en_US","og_type":"article","og_title":"Top 10 tables - a custom Dradis script - Dradis Framework Blog","og_description":"Imagine, you scan a few hundred hosts to create a summary report. You want to show data on ports and operating systems without giving the end user hundreds of pages of data. Enter the &#8220;Top 10&#8221; script! Credit for this script idea goes to Chris from I.S. Partners. He reached out via the support inbox [&hellip;]","og_url":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/","og_site_name":"Dradis Framework Blog","article_published_time":"2024-04-16T15:41:52+00:00","article_modified_time":"2024-04-16T15:41:53+00:00","og_image":[{"url":"https:\/\/dradis.com\/blog\/wp-content\/uploads\/2024\/04\/Screen-Shot-2024-04-11-at-12.45.55-PM.png"}],"author":"Rachael Carder","twitter_card":"summary_large_image","twitter_creator":"@dradisfw","twitter_site":"@dradisfw","twitter_misc":{"Written by":"Rachael Carder","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/","url":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/","name":"Top 10 tables - a custom Dradis script - Dradis Framework Blog","isPartOf":{"@id":"https:\/\/dradis.com\/blog\/#website"},"datePublished":"2024-04-16T15:41:52+00:00","dateModified":"2024-04-16T15:41:53+00:00","author":{"@id":"https:\/\/dradis.com\/blog\/#\/schema\/person\/978f2d4e6ffa56f0569a62775a8320bb"},"breadcrumb":{"@id":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dradis.com\/blog\/2024\/04\/top-10-tables-a-custom-dradis-script\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dradis.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Top 10 tables &#8211; a custom Dradis script"}]},{"@type":"WebSite","@id":"https:\/\/dradis.com\/blog\/#website","url":"https:\/\/dradis.com\/blog\/","name":"Dradis Framework Blog","description":"Information management for security teams","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dradis.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/dradis.com\/blog\/#\/schema\/person\/978f2d4e6ffa56f0569a62775a8320bb","name":"Rachael Carder","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dradis.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c6fd1058f5864e774d11780f6ba80d56?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c6fd1058f5864e774d11780f6ba80d56?s=96&d=mm&r=g","caption":"Rachael Carder"},"url":"https:\/\/dradis.com\/blog\/author\/rachkor\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3ijVs-Cf","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":1155,"url":"https:\/\/dradis.com\/blog\/2019\/12\/year-in-review-a-future-dradis-feature\/","url_meta":{"origin":2371,"position":0},"title":"Year in Review &#8211; a future Dradis feature","date":"December 23, 2019","format":false,"excerpt":"This feature was implemented in Dradis v4.19.0. Check out the full details in our forum post. How many Dradis projects did you create this year? How many Issues did you find? What were the most commonly found Issues? What was the most common severity of the Issues that you found?\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dradis.com\/blog\/wp-content\/uploads\/2019\/12\/Screen-Shot-2019-12-20-at-4.35.18-PM.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2632,"url":"https:\/\/dradis.com\/blog\/2026\/02\/turn-your-pentests-into-insights-the-new-business-intelligence-dashboard\/","url_meta":{"origin":2371,"position":1},"title":"Turn Your Pentests Into Insights: The New Business Intelligence Dashboard","date":"February 6, 2026","format":false,"excerpt":"Remember when we shared a \"Year in Review\" script that could pull basic stats from your Dradis instance? Well, we heard your feedback loud and clear. You wanted more than a command-line script. You wanted insights that were easy to access, customizable to your needs, and powerful enough to help\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dradis.com\/blog\/wp-content\/uploads\/2026\/02\/image.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1296,"url":"https:\/\/dradis.com\/blog\/2011\/04\/running-dradis-framework-27-in\/","url_meta":{"origin":2371,"position":2},"title":"Running Dradis Framework (2.7) in BackTrack4 R2","date":"April 26, 2011","format":false,"excerpt":"Following the series of articles on how to get the\u00a0Dradis Framework\u00a0running in different operating system, this time is the turn of BackTrack 4 R2.Note this is almost a re-post of my\u00a0Running Dradis Framework in BackTrack 4 R2\u00a0but updated to 2.7 (instead of 2.6.1).First, get a download link for the latest\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1164,"url":"https:\/\/dradis.com\/blog\/2020\/01\/dradis-wpscan-integration\/","url_meta":{"origin":2371,"position":3},"title":"New Dradis Integration: WPScan","date":"January 30, 2020","format":false,"excerpt":"When the WPScan team approached us in late 2019 offering to create an integration for Dradis, we were excited to work together. What goes together better than a WordPress security scanning tool and an easy way to turn those findings into a customized report? Maybe chocolate and peanut butter, but\u2026","rel":"","context":"In &quot;Features&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dradis.com\/blog\/wp-content\/uploads\/2020\/01\/NEW-DRADIS-INTEGRATION3.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":1287,"url":"https:\/\/dradis.com\/blog\/2011\/02\/dradis-261-released\/","url_meta":{"origin":2371,"position":4},"title":"Dradis 2.6.1 released!","date":"February 11, 2011","format":false,"excerpt":"Update Rails to 3.0.4 and RedCloth to 4.2.5Update the SSL certificate for 2011 (see .\/server\/conf\/ssl\/README)Deal with Burp Scanner's opinionated handling of null bytesImprove verify.sh to find Bundler even when not in the PATHFix the start.sh script to use UNIX forward slash instead of Windows back slash","rel":"","context":"In &quot;Release&quot;","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":793,"url":"https:\/\/dradis.com\/blog\/2017\/04\/dradis-attachments-api-using-ruby\/","url_meta":{"origin":2371,"position":5},"title":"Attachments API using ruby","date":"April 20, 2017","format":false,"excerpt":"One of the latest additions in Dradis Pro release 2.6.0 was the attachments API. Until now that was only available using the web interface: As documented here\u00a0that new API endpoint allows to manipulate node attachments via REST requests. Here there are a couple of examples, using curl. Read attachments associated\u2026","rel":"","context":"In &quot;Dradis_Pro&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dradisframework.com\/blog\/wp-content\/uploads\/2017\/04\/attachments.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/posts\/2371"}],"collection":[{"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/comments?post=2371"}],"version-history":[{"count":3,"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/posts\/2371\/revisions"}],"predecessor-version":[{"id":2380,"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/posts\/2371\/revisions\/2380"}],"wp:attachment":[{"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/media?parent=2371"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/categories?post=2371"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dradis.com\/blog\/wp-json\/wp\/v2\/tags?post=2371"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}