Module: PWN::Reports::Phone
- Defined in:
- lib/pwn/reports/phone.rb
Overview
This plugin generates the War Dialing results produced by pwn_phone.
Class Method Summary collapse
-
.authors ⇒ Object
- Author(s)
-
0day Inc.
-
.generate(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::Reports::Phone.generate( dir_path: dir_path, results_hash: results_hash ).
-
.help ⇒ Object
Display Usage for this Module.
Class Method Details
.authors ⇒ Object
- Author(s)
-
0day Inc. <[email protected]>
293 294 295 296 297 |
# File 'lib/pwn/reports/phone.rb', line 293 public_class_method def self. "AUTHOR(S): 0day Inc. <[email protected]> " end |
.generate(opts = {}) ⇒ Object
- Supported Method Parameters
-
PWN::Reports::Phone.generate(
dir_path: dir_path, results_hash: results_hash
)
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/pwn/reports/phone.rb', line 15 public_class_method def self.generate(opts = {}) dir_path = opts[:dir_path].to_s if File.directory?(opts[:dir_path].to_s) raise "PWN Error: Invalid Directory #{dir_path}" if dir_path.nil? results_hash = opts[:results_hash] report_name = results_hash[:report_name] File.write( "#{dir_path}/#{report_name}.json", JSON.pretty_generate(results_hash) ) html_report = %{<!DOCTYPE HTML> <html> <head> <!-- favicon.ico from https://0dayinc.com --> <link rel="icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAABIXAAASFwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIkAAACJAgAAiSYAAIlbAACJcAAAiX0AAIlmAACJLQAAiQQAAIkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIkAAACJAAAAiS0AAIluAACJdwAAiXgAAIl+AACJeAAAiXQAAIk5AACJAQAAiQAAAAAAAAAAAAAAAAAAAAAAAACJAAAAiRgAAIlvAACJbQAAiXcAAIl7AACJcwAAiXEAAIl1AACJZwAAiR4AAIkAAACJAAAAAAAAAAAAAACJAAAAiQAAAIlEAACJfAAAiXIAAIlyAACJewAAiX4AAIl5AACJdQAAiXcAAIlIAACJAAAAiQAAAAAAAAAAAAAAiQAAAIkJAACJWQAAiXUAAIl9AACJdAAAiYYAAImLAACJdAAAiXkAAImNAACJfQAAiQwAAIkAAAAAAAAAAAAAAIkAAACJFQAAiWsAAIl2AACJfAAAiYIAAImCAACJfwAAiXYAAIl5AACJiQAAiYYAAIkWAACJAAAAAAAAAAAAAACJAAAAiSAAAIl2AACJeQAAiXkAAIl1AACJfwAAiYEAAIl8AACJbwAAiXoAAImBAACJFgAAiQAAAAAAAAAAAAAAiQAAAIkpAACJeAAAiXMAAIl3AACJeQAAiXUAAImAAACJfwAAiWYAAIl4AACJfwAAiR4AAIkAAAAAAAAAAAAAAIkAAACJKAAAiXkAAIlyAACJdQAAiXQAAIluAACJfAAAiXwAAIl3AACJewAAiXwAAIkvAACJAAAAAAAAAAAAAACJAAAAiSMAAIl4AACJdgAAiXsAAIl1AACJcQAAiXcAAIl6AACJeQAAiXoAAIl0AACJKQAAiQAAAAAAAAAAAAAAiQAAAIkXAACJaAAAiXgAAIl3AACJfAAAiXkAAIl3AACJZwAAiXcAAIl0AACJagAAiSgAAIkAAAAAAAAAAAAAAIkAAACJDgAAiV4AAIl5AACJbwAAiW4AAIl9AACJewAAiXcAAIl6AACJfQAAiW8AAIkWAACJAAAAAAAAAAAAAACJAAAAiQ0AAIllAACJewAAiXYAAIl4AACJdQAAiXUAAIl4AACJbQAAiXkAAIlNAACJAwAAiQAAAAAAAAAAAAAAiQAAAIkCAACJPQAAiXMAAIl2AACJeAAAiWgAAIlsAACJfQAAiXsAAIlwAACJGQAAiQAAAIkAAAAAAAAAAAAAAAAAAACJAAAAiQcAAIk4AACJXAAAiXoAAIl7AACJfAAAiYAAAIlsAACJJwAAiQMAAIkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIkAAACJAQAAiSsAAIluAACJewAAiXwAAIluAACJKgAAiQAAAIkAAAAAAAAAAAAAAAAA8A8AAPAHAADgBwAA4AcAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMADAADAAwAAwAMAAMAHAADgBwAA8B8AAA==" type="image/x-icon" /> <style> body { font-family: Verdana, Geneva, sans-serif; font-size: 11px; background-color: #FFFFFF; color: #084B8A !important; } a:link { color: #0174DF; text-decoration: none; } a:visited { color: #B40404; text-decoration: none; } a:hover { color: #01A9DB; text-decoration: underline; } a:active { color: #610B5E; text-decoration: underline; } table { width: 100%; border-spacing:0px; } table.squish { table-layout: fixed; } td { vertical-align: top; word-wrap: break-word !important; } .highlighted { background-color: #F2F5A9 !important; } </style> <!-- jQuery, DataTables, & FancyApps --> <script type="text/javascript" src="//code.jquery.com/jquery-3.6.0.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.datatables.net/v/dt/dt-1.11.4/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/cr-1.5.5/fc-4.0.1/fh-3.2.1/kt-2.6.4/r-2.2.9/rg-1.1.4/rr-1.2.8/sc-2.0.5/sp-1.4.0/sl-1.3.4/datatables.min.css"/> <script type="text/javascript" src="//cdn.datatables.net/v/dt/dt-1.11.4/b-2.2.2/b-colvis-2.2.2/b-html5-2.2.2/b-print-2.2.2/cr-1.5.5/fc-4.0.1/fh-3.2.1/kt-2.6.4/r-2.2.9/rg-1.1.4/rr-1.2.8/sc-2.0.5/sp-1.4.0/sl-1.3.4/datatables.min.js"></script> <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox.css" type="text/css" /> <script type="text/javascript" src="//cdn.jsdelivr.net/npm/@fancyapps/[email protected]/dist/fancybox.umd.js"></script> </head> <body id="pwn_body"> <h1 style="display:inline"> <a href="https://github.com/0dayinc/pwn/tree/master">~ pwn phone</a> </h1><br /><br /> <h2 id="report_name"></h2><br /> <div><button type="button" id="button">Rows Selected</button></div><br /> <div> <b>Toggle Column(s):</b> <a class="toggle-vis" data-column="1" href="#">Call Started</a> | <a class="toggle-vis" data-column="2" href="#">Source #</a> | <a class="toggle-vis" data-column="3" href="#">Source # Rules</a> | <a class="toggle-vis" data-column="4" href="#">Target #</a> | <a class="toggle-vis" data-column="5" href="#">Seconds Recorded</a> | <a class="toggle-vis" data-column="6" href="#">Call Stopped</a> <a class="toggle-vis" data-column="7" href="#">Reason</a> <a class="toggle-vis" data-column="8" href="#">Screenlog</a> | <a class="toggle-vis" data-column="9" href="#">Recording</a> | <a class="toggle-vis" data-column="10" href="#">Speech to Text</a> | <a class="toggle-vis" data-column="11" href="#">Spectrogram</a> | <a class="toggle-vis" data-column="12" href="#">Waveform</a> </div> <br /><br /> <div> <table id="pwn_phone_results" class="display" cellspacing="0"> <thead> <tr> <th>#</th> <th>Call Started</th> <th>Source #</th> <th>Source # Rules</th> <th>Target #</th> <th>Seconds Recorded</th> <th>Call Stopped</th> <th>Reason Stopped</th> <th>Screenlog</th> <th>Recording</th> <th>Speech to Text</th> <th>Spectrogram</th> <th>Waveform</th> </tr> </thead> <!-- DataTables <tbody> --> </table> </div> <script> var htmlEntityEncode = $.fn.dataTable.render.text().display; var line_entry_uri = ""; $(document).ready(function() { var oldStart = 0; var table = $('#pwn_phone_results').DataTable( { "paging": true, "pagingType": "full_numbers", "fnDrawCallback": function ( oSettings ) { /* Need to redo the counters if filtered or sorted */ if ( oSettings.bSorted || oSettings.bFiltered ) { for ( var i=0, iLen=oSettings.aiDisplay.length ; i<iLen ; i++ ) { $('td:eq(0)', oSettings.aoData[ oSettings.aiDisplay[i] ].nTr ).html( i+1 ); } } // Jump to top when utilizing pagination if ( oSettings._iDisplayStart != oldStart ) { var targetOffset = $('#pwn_body').offset().top; $('html,body').animate({scrollTop: targetOffset}, 500); oldStart = oSettings._iDisplayStart; } // Select individual lines in a row $('#multi_line_select tbody').on('click', 'tr', function () { $(this).toggleClass('highlighted'); if ($('#multi_line_select tr.highlighted').length > 0) { $('#multi_line_select tr td button').attr('disabled', 'disabled'); // Remove multi-line bug button } else { $('#multi_line_select tr td button').removeAttr('disabled'); // Add multi-line bug button } }); }, "ajax": "#{report_name}.json", //"deferRender": true, "dom": "fplitfpliS", "autoWidth": false, "columns": [ { "data": null }, { "data": "call_started", "render": $.fn.dataTable.render.text() }, { "data": "src_num", "render": $.fn.dataTable.render.text() }, { "data": "src_num_rules", "render": $.fn.dataTable.render.text() }, { "data": "target_num", "render": $.fn.dataTable.render.text() }, { "data": "seconds_recorded", "render": $.fn.dataTable.render.text() }, { "data": "call_stopped", "render": $.fn.dataTable.render.text() }, { "data": "reason", "render": $.fn.dataTable.render.text() }, { "data": "screenlog", "render": function (data, type, row, meta) { var screenlog = htmlEntityEncode(data); return '<a href="' + screenlog +'" target="_blank">' + screenlog + '</a>'; } }, { "data": "recording", "render": function (data, type, row, meta) { var wav = htmlEntityEncode(data); if (wav == '--') { return wav; } else { return '<audio controls><source src="' + wav +'" type="audio/wav"></audio>'; } } }, { "data": "speech_to_text", "render": function (data, type, row, meta) { var speech_to_text = htmlEntityEncode(data); return '<a href="' + speech_to_text +'" target="_blank">' + speech_to_text + '</a>'; } }, { "data": "spectrogram", "render": function (data, type, row, meta) { var spt = htmlEntityEncode(data); if (spt == '--') { return spt; } else { return '<a data-fancybox data-src="' + spt + '" data-caption="' + spt + '"><img src="' + data +'" target="_blank" style="width:150px; height:150px;"/></a>'; } } }, { "data": "waveform", "render": function (data, type, row, meta) { var wfm = htmlEntityEncode(data); if (wfm == '--') { return wfm; } else { return '<a data-fancybox data-src="' + wfm + '" data-caption="' + wfm + '"><img src="' + data +'" target="_blank" style="width:150px; height:150px;"/></a>'; } } } ] }); // Toggle Columns $('a.toggle-vis').on('click', function (e) { e.preventDefault(); // Get the column API object var column = table.column( $(this).attr('data-column') ); // Toggle the visibility column.visible( ! column.visible() ); }); // TODO: Open bug for highlighted rows ;) $('#button').click( function () { alert($('#multi_line_select tr.highlighted').length +' row(s) highlighted'); }); }); function multi_line_select() { // Select all lines in a row //$('#pwn_phone_results tbody').on('click', 'tr', function () { // $(this).children('td').children('#multi_line_select').children('tbody').children('tr').toggleClass('highlighted'); //}); } </script> </body> </html> } File.open("#{dir_path}/#{report_name}.html", 'w') do |f| f.print(html_report) end rescue StandardError => e raise e end |
.help ⇒ Object
Display Usage for this Module
301 302 303 304 305 306 307 308 309 310 |
# File 'lib/pwn/reports/phone.rb', line 301 public_class_method def self.help puts "USAGE: #{self}.generate( dir_path: dir_path, results_hash: results_hash ) #{self}.authors " end |