EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff

Training Missions

Read Me First New
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom

Knowledge Bank

Discussion Forums
Enigma Chat New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Enigma Zine
Downloads
Tools New

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Hakipedia: An open collaborative for all your information security needs.

The Urinal

Click Here To Vote For EG!

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site.

enigma group

enigma group

enigma group

enigma group

Enigma Group's Code Bank


Gui For Nikto [Linux]

By: csrss  -  Date Submitted: 2009-06-01 09:03:23

  1. #!/usr/bin/perl
  2. # Nikto GUI ver.2 by cross <cross@x1machine.com>
  3. use Gtk2 qw/-init -threads-init/;
  4. ######################################################## MODULES HERE !!!!! ##############################
  5. package Capture::_proxy;
  6. use File::Temp 'tempfile';
  7. use Symbol qw/gensym qualify qualify_to_ref/;
  8. sub _is_wperl { $^O eq 'MSWin32' && basename($^X) eq 'wperl.exe' }
  9. sub newExProxy { my $class = shift;
  10. my ($orig_fh, $capture_var, $merge_fh, $capture_file) = @_;
  11. $orig_fh = qualify($orig_fh); my $fhref = qualify_to_ref($orig_fh);
  12. my $saved_fh;{ no strict 'refs'; if ( defined fileno($orig_fh) && ! _is_wperl() ) {
  13. $saved_fh = gensym; open $saved_fh, ">&$orig_fh"; }}
  14. my ($newio_fh, $newio_file);if ( ! $merge_fh ) {$newio_fh = gensym;
  15. if ($capture_file) { $newio_file = $capture_file;} else { (undef, $newio_file) = tempfile;}
  16. open $newio_fh, "+>$newio_file";} else { $newio_fh = qualify($merge_fh);}
  17. { no strict 'refs'; open $fhref, ">&".fileno($newio_fh); }
  18. bless [$$, $orig_fh, $saved_fh, $capture_var, $newio_fh, $newio_file, $capture_file], $class;}
  19. sub DESTROY { my $self = shift;
  20. my ($pid, $orig_fh, $saved_fh, $capture_var, $newio_fh,
  21. $newio_file, $capture_file) = @$self; return unless $pid eq $$;
  22. my $fh_ref = Symbol::qualify_to_ref($orig_fh); select((select ($fh_ref), $|=1)[0]);
  23. if (defined $saved_fh) { open $fh_ref, ">&". fileno($saved_fh);} else { close $fh_ref;}
  24. if (ref $capture_var && $newio_file) {local $^W; seek $newio_fh, 0, 0;
  25. $$capture_var = do {local $/; <$newio_fh>};}close $newio_fh if $newio_file;
  26. return unless defined $newio_file && -e $newio_file;
  27. return if $capture_file; unlink $newio_file;}
  28. #########################################################
  29. $CarpLevel = 0;
  30. sub _capture (&@) { my ($code, $output, $error, $output_file, $error_file) = @_;
  31. { local $Carp::CarpLevel = 1; my $error = _validate($output, $error, $output_file, $error_file);
  32. croak $error if $error;}
  33. if ( defined $output || defined $error ) { for ($output, $error) {
  34. $_ = do { my $s; $s = ''} unless ref $_;$$_ = '' if $_ != undef && !defined($$_);} }
  35. my $should_merge = (defined $error && defined $output && $output == $error) ||
  36. ( !defined $output && !defined $error ) || 0; my ($capture_out, $capture_err);
  37. if ( !defined $output || $output != undef ) {
  38. $capture_out = Capture::_proxy->newExProxy('STDOUT', $output, undef, $output_file );}
  39. if ( !defined $error || $error != undef ) {
  40. my $capture_err = Capture::_proxy->newExProxy('STDERR', $error, ($should_merge ? 'STDOUT' : undef), $error_file );}
  41. &$code();}
  42.  
  43. sub capture (&@) { return &_capture; }
  44. sub capture_exec { my @args = @_; my ($output, $error);
  45. _capture sub { system _shell_quote(@args) }, $output, $error;
  46. return wantarray ? ($output, $error) : $output;} *qxx = &capture_exec;
  47. *_shell_quote = ($^O =~ /MSWin32/) ? &_shell_quote_win32 : sub {@_};
  48. sub _shell_quote_win32 {my @args; for (@_) {if (/[ "]/) {(my $escaped = $_) =~ s/(["])/\$1/g;
  49. push @args, '"' . $escaped . '"'; next; }push @args, $_ } return @args;}
  50. sub _validate { my ($output, $error, $output_file, $error_file) = @_; my $msg = q{};
  51. if ( defined $output && defined $error
  52. && defined $output_file && defined $error_file
  53. && $output == $error && $output != undef
  54. && $output_file ne $error_file
  55. ) { $msg = "Merged STDOUT and STDERR, but specified different output and error files";}
  56. elsif ( !defined $output && !defined $error
  57. && defined $output_file && defined $error_file
  58. && $output_file ne $error_file
  59. ) { $msg = "Merged STDOUT and STDERR, but specified different output and error files";}
  60. return $msg;}
  61. ########################################################
  62. use threads;
  63. use threads::shared;
  64. $|=1;
  65. my $frame = Gtk2::Frame->new("Nikto Output");
  66. my $sw = Gtk2::ScrolledWindow->new (undef, undef);
  67. my $tview = Gtk2::TextView->new();
  68. my $MainBuffer = $tview->get_buffer();
  69. my $supaBox = Gtk2::VBox->new(0,0);
  70. #my $show_gui_output = Gtk2::CheckButton->new("Gui Output");
  71. ########################################################
  72. my($ok_dbcheck, $ok_findonly, $ok_nolookup, $ok_ssl, $ok_single, $ok_useproxy,
  73. $ok_config, $ok_cgidirs, $ok_id, $ok_port, $ok_timeout, $ok_pause, $ok_output,
  74. $ok_display, $ok_evasion, $ok_format, $ok_mutate, $ok_tunning, $ok_root, $ok_vhost);
  75. my $GUI_OUTPUT;
  76. ########################################################
  77. %Ret = ( 'Return' => 0xff0d);
  78. my $window = Gtk2::Window->new('toplevel');$window->signal_connect('delete_event' => sub { exit;});
  79. Gtk2::Rc->parse ('/usr/share/themes/Qt/gtk-2.0/gtkrc');
  80. $window->set_resizable(0);
  81. $window->set_border_width(5);
  82. $window->set_title("Nikto Gui");
  83. my ($vbox) = &MainBox();
  84. $window->add($vbox);
  85. $window->show();
  86. open (F, "nikto.pl") || $MainBuffer->insert ($MainBuffer->get_end_iter, "Cant find Nikto!n"); close(F);
  87. Gtk2->main();
  88.  
  89.  
  90. sub MessageBox { my $message = shift; my $title = shift;
  91. my $dialog = Gtk2::Dialog->new ($title, $window, 'destroy-with-parent', 'gtk-ok' => 'none');
  92. my $label = Gtk2::Label->new ($message); $dialog->vbox->add ($label);
  93. $dialog->signal_connect (response => sub { $_[0]->destroy }); $dialog->show_all;}
  94.  
  95. sub About {
  96. MessageBox(
  97. " [ Nikto Gui version 2.0 ]
  98. (c)oded by cross // csrss
  99. <cross@x1machine.com> ", " Nikto Gui Info ");
  100. }
  101.  
  102. sub MainBox { my $vbox = Gtk2::VBox->new(0,0);
  103. ############### COMMON OPTIONS ############################
  104. my $tooltips = Gtk2::Tooltips->new;
  105. #my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("nikto2.png");
  106. #my $image = Gtk2::Image->new_from_pixbuf($pixbuf);
  107. my $comop = Gtk2::HBox->new(0,0);
  108. my $comon_options = Gtk2::Frame->new("Common Options");
  109. my $dbcheck = Gtk2::CheckButton->new("Dbcheck");
  110. $dbcheck->signal_connect(toggled => sub{ $ok_dbcheck = $dbcheck->get_active();});
  111. $tooltips->set_tip($dbcheck, "Check database and other key files for syntax errors", "");
  112. my $findonly = Gtk2::CheckButton->new("Findonly");
  113. $tooltips->set_tip($findonly, "Find http(s) ports only, don't perform a full scan", "");
  114. $findonly->signal_connect(toggled => sub{$ok_findonly = $findonly->get_active();});
  115. my $nolookup = Gtk2::CheckButton->new("Nolookup");
  116. $tooltips->set_tip($nolookup, "Skip name lookup", "");
  117. $nolookup->signal_connect(toggled => sub{$ok_nolookup = $nolookup->get_active();});
  118. my $ssl = Gtk2::CheckButton->new("Ssl");
  119. $tooltips->set_tip($ssl, "Force ssl mode on port", "");
  120. $ssl->signal_connect(toggled => sub{$ok_ssl = $ssl->get_active();});
  121. my $single = Gtk2::CheckButton->new("Single");
  122. $tooltips->set_tip($single, "Single request mode", "");
  123. $single->signal_connect(toggled => sub{$ok_single = $single->get_active();});
  124. my $proxy = Gtk2::CheckButton->new("Proxy");
  125. $tooltips->set_tip($proxy, "Use the proxy defined in config.txt", "");
  126. $proxy->signal_connect(toggled => sub{$ok_useproxy = $proxy->get_active();});
  127. my $show_gui_output = Gtk2::CheckButton->new("Console Output");
  128. $tooltips->set_tip($show_gui_output, "Check this if you want nikto output to be
  129. produced in console window.", "");
  130. $show_gui_output->signal_connect(toggled => sub{
  131. $GUI_OUTPUT = $show_gui_output->get_active();
  132. if($GUI_OUTPUT eq ""){$supaBox->add($frame); print "GUI MODEn";}
  133. if($GUI_OUTPUT eq "1"){$supaBox->remove($frame); print "CONSOLE MODEn";}
  134. });
  135.  
  136. $comop->pack_start($dbcheck,1,1,1);
  137. $comop->pack_start($findonly,1,1,1);
  138. $comop->pack_start($nolookup,1,1,1);
  139. $comop->pack_start($ssl,1,1,1);
  140. $comop->pack_start($single,1,1,1);
  141. $comop->pack_start($proxy,1,1,1);
  142. $comop->pack_start($show_gui_output,1,1,1);
  143. $comon_options->add($comop);
  144.  
  145. ############### COMMON OPTIONS END ############################
  146.  
  147. ############### ADVANCED OPTIONS END ############################
  148. my $all_adv_options = Gtk2::VBox->new(0,0);
  149. my $adv_opt = Gtk2::HBox->new(0,0);
  150. my $advanced_options = Gtk2::Frame->new("Advanced Options");
  151. my $config = Gtk2::CheckButton->new("ConFig => ");
  152. $tooltips->set_tip($config, "Use defined configuration file", "");
  153. $config->signal_connect(toggled => sub{$ok_config = $config->get_active();});
  154. my $config_arg = Gtk2::Entry->new();
  155. $config_arg->set_width_chars (15);
  156. my $sep_lab = Gtk2::Label->new("|||");
  157.  
  158. my $cgidirs = Gtk2::CheckButton->new("CgiDirs =>");
  159. $tooltips->set_tip($cgidirs, "scan these CGI dirs: 'none', 'all', or values like "/cgi/ /cgi-a/"", "");
  160. $cgidirs->signal_connect(toggled => sub{$ok_cgidirs = $cgidirs->get_active();});
  161. my $cgidirs_arg = Gtk2::Entry->new();
  162. $cgidirs_arg->set_width_chars (15);
  163. my $sep_lab2 = Gtk2::Label->new(" |||");
  164.  
  165. my $id = Gtk2::CheckButton->new("H.Auth =>");
  166. $tooltips->set_tip($id, "Host authentication to use, format is userid:password", "");
  167. $id->signal_connect(toggled => sub{$ok_id = $id->get_active();});
  168. my $id_arg = Gtk2::Entry->new();
  169. $id_arg->set_width_chars (15);
  170. my $sep_lab3 = Gtk2::Label->new("|||");
  171.  
  172. my $port = Gtk2::CheckButton->new("UsePort =>");
  173. $tooltips->set_tip($port, "Port to use (default 80)", "");
  174. $port->signal_connect(toggled => sub{$ok_port = $port->get_active();});
  175. my $port_arg = Gtk2::Entry->new();
  176. $port_arg->set_width_chars (15);
  177.  
  178. my $adv_opt_2 = Gtk2::HBox->new(0,0);
  179. my $TimeOut = Gtk2::CheckButton->new("TimeOut =>");
  180. $tooltips->set_tip($TimeOut, "Timeout (default 2 seconds)", "");
  181. $TimeOut->signal_connect(toggled => sub{$ok_timeout = $TimeOut->get_active();});
  182. my $TimeOut_arg = Gtk2::Entry->new();
  183. $TimeOut_arg->set_width_chars (15);
  184. my $TimeOut_lab = Gtk2::Label->new("|||");
  185.  
  186. my $Pause = Gtk2::CheckButton->new("Pause => ");
  187. $tooltips->set_tip($Pause, "Pause between tests (seconds)", "");
  188. $Pause->signal_connect(toggled => sub{$ok_pause = $Pause->get_active();});
  189. my $Pause_arg = Gtk2::Entry->new();
  190. $Pause_arg->set_width_chars (15);
  191. my $Pause_lab = Gtk2::Label->new("|||");
  192.  
  193. my $Output = Gtk2::CheckButton->new("Output =>");
  194. $tooltips->set_tip($Output, "Write output to defined file", "");
  195. $Output->signal_connect(toggled => sub{$ok_output = $Output->get_active();});
  196. my $Output_arg = Gtk2::Entry->new();
  197. $Output_arg->set_width_chars (15);
  198. my $Output_lab = Gtk2::Label->new("|||");
  199.  
  200. my $Display = Gtk2::CheckButton->new("Display =>");
  201. $tooltips->set_tip($Display, "Turn on/off display outputs: [1] - Show redirects, [2] - Show cookies received
  202. [3] - Show all 200/OK responses, [4] - Show URLs which require authentication,
  203. [D] - Debug Output, [V] - Verbose Output", "");
  204. $Display->signal_connect(toggled => sub{$ok_display = $Display->get_active();});
  205. my $Display_arg = Gtk2::Entry->new();
  206. $Display_arg->set_width_chars (15);
  207.  
  208. my $adv_opt_3 = Gtk2::HBox->new(0,0);
  209. my $Evasion = Gtk2::CheckButton->new("Evasion => ");
  210. $tooltips->set_tip($Evasion, "Ids evasion technique: [1] - Random URI encoding (non-UTF8),[2] - Directory
  211. self-reference (/./), [3] - Premature URL ending, [4] - Prepend long random string,
  212. [5] - Fake parameter, [6] - TAB as request spacer, [7] - Change the case of the
  213. URL, [8] - Use Windows directory separator ()", "");
  214. $Evasion->signal_connect(toggled => sub{$ok_evasion = $Evasion->get_active();});
  215. my $Evasion_arg = Gtk2::Entry->new();
  216. $Evasion_arg->set_width_chars (15);
  217. my $Evasion_lab = Gtk2::Label->new("|||");
  218.  
  219. my $Format = Gtk2::CheckButton->new("Format =>");
  220. $tooltips->set_tip($Format, "Save file (-o) format: [htm] - HTML Format, [csv] -
  221. Comma-separated-value, [txt] - Plain text (default if not specified)", "");
  222. $Format->signal_connect(toggled => sub{$ok_format = $Format->get_active();});
  223. my $Format_arg = Gtk2::Entry->new();
  224. $Format_arg->set_width_chars (15);
  225. my $Format_lab = Gtk2::Label->new("|||");
  226.  
  227. my $Mutate = Gtk2::CheckButton->new("Mutate =>");
  228. $tooltips->set_tip($Mutate, "Guess additional file names: [1] - Test all files with all root directories,
  229. [2] - Guess for password file names, [3] - Enumerate user names via Apache (/~user type requests),
  230. [4] - Enumerate user names via cgiwrap (/cgi-bin/cgiwrap/~user type requests)", "");
  231. $Mutate->signal_connect(toggled => sub{$ok_mutate = $Mutate->get_active();});
  232. my $Mutate_arg = Gtk2::Entry->new();
  233. $Mutate_arg->set_width_chars (15);
  234. my $Mutate_lab = Gtk2::Label->new("|||");
  235.  
  236. my $Tunning = Gtk2::CheckButton->new("Tunning =>");
  237. $tooltips->set_tip($Tunning, "Scan tuning: 0 -File Upload, 1 -Interesting File / Seen in logs,2 -Misconfiguration / Default File,3 -Information
  238. Disclosure, 4 -Injection (XSS/Script/HTML), 5 -Remote File Retrieval -Inside Web Root, 6 -DoS, 7 -Remote
  239. File Retrieval -Server Wide,8 -Command Execution / Remote Shell, 9 -SQL Injection, a -Authentication Bypass,
  240. b -Software Identification, c -Remote Source Inclusion, x -Reverse Options (include all except specified)", "");
  241. $Tunning->signal_connect(toggled => sub{$ok_tunning = $Tunning->get_active();});
  242. my $Tunning_arg = Gtk2::Entry->new();
  243. $Tunning_arg->set_width_chars (15);
  244.  
  245. my $adv_opt_4 = Gtk2::HBox->new(0,0);
  246. my $Root = Gtk2::CheckButton->new("Root => ");
  247. $tooltips->set_tip($Root, "Prepend root value to all requests, format is /directory", "");
  248. $Root->signal_connect(toggled => sub{$ok_root = $Root->get_active();});
  249. my $Root_arg = Gtk2::Entry->new();
  250. $Root_arg->set_width_chars (45);
  251. my $Root_lab = Gtk2::Label->new("|||");
  252.  
  253. my $VHost = Gtk2::CheckButton->new("VHost =>");
  254. $tooltips->set_tip($VHost, "Write output to defined file", "");
  255. $VHost->signal_connect(toggled => sub{$ok_vhost = $VHost->get_active();});
  256. my $VHost_arg = Gtk2::Entry->new();
  257. $VHost_arg->set_width_chars (45);
  258.  
  259. $adv_opt->pack_start($config,1,1,1);
  260. $adv_opt->pack_start($config_arg,1,1,1);
  261. $adv_opt->pack_start($sep_lab,1,1,1);
  262.  
  263. $adv_opt->pack_start($cgidirs,1,1,1);
  264. $adv_opt->pack_start($cgidirs_arg,1,1,1);
  265. $adv_opt->pack_start($sep_lab2,1,1,1);
  266.  
  267. $adv_opt->pack_start($id,1,1,1);
  268. $adv_opt->pack_start($id_arg,1,1,1);
  269. $adv_opt->pack_start($sep_lab3,1,1,1);
  270.  
  271. $adv_opt->pack_start($port,1,1,1);
  272. $adv_opt->pack_start($port_arg,1,1,1);
  273.  
  274. $adv_opt_2->pack_start($TimeOut,1,1,1);
  275. $adv_opt_2->pack_start($TimeOut_arg,1,1,1);
  276. $adv_opt_2->pack_start($TimeOut_lab,1,1,1);
  277.  
  278. $adv_opt_2->pack_start($Pause,1,1,1);
  279. $adv_opt_2->pack_start($Pause_arg,1,1,1);
  280. $adv_opt_2->pack_start($Pause_lab,1,1,1);
  281.  
  282. $adv_opt_2->pack_start($Output,1,1,1);
  283. $adv_opt_2->pack_start($Output_arg,1,1,1);
  284. $adv_opt_2->pack_start($Output_lab,1,1,1);
  285.  
  286. $adv_opt_2->pack_start($Display,1,1,1);
  287. $adv_opt_2->pack_start($Display_arg,1,1,1);
  288.  
  289. $adv_opt_3->pack_start($Evasion,1,1,1);
  290. $adv_opt_3->pack_start($Evasion_arg,1,1,1);
  291. $adv_opt_3->pack_start($Evasion_lab,1,1,1);
  292.  
  293. $adv_opt_3->pack_start($Format,1,1,1);
  294. $adv_opt_3->pack_start($Format_arg,1,1,1);
  295. $adv_opt_3->pack_start($Format_lab,1,1,1);
  296.  
  297. $adv_opt_3->pack_start($Mutate,1,1,1);
  298. $adv_opt_3->pack_start($Mutate_arg,1,1,1);
  299. $adv_opt_3->pack_start($Mutate_lab,1,1,1);
  300.  
  301. $adv_opt_3->pack_start($Tunning,1,1,1);
  302. $adv_opt_3->pack_start($Tunning_arg,1,1,1);
  303.  
  304. $adv_opt_4->pack_start($Root,1,1,1);
  305. $adv_opt_4->pack_start($Root_arg,1,1,1);
  306. $adv_opt_4->pack_start($Root_lab,1,1,1);
  307.  
  308. $adv_opt_4->pack_start($VHost,1,1,1);
  309. $adv_opt_4->pack_start($VHost_arg,1,1,1);
  310.  
  311.  
  312.  
  313. $all_adv_options->pack_start($adv_opt,1,1,1);
  314. $all_adv_options->pack_start($adv_opt_2,1,1,1);
  315. $all_adv_options->pack_start($adv_opt_3,1,1,1);
  316. $all_adv_options->pack_start($adv_opt_4,1,1,1);
  317. $advanced_options->add($all_adv_options);
  318. ############### ADVANCED OPTIONS END ############################
  319.  
  320. my $options = Gtk2::HBox->new(0,0);
  321. my $frame2 = Gtk2::Frame->new();
  322. my $rem_host = Gtk2::Label->new;
  323. $frame2->add($rem_host);
  324. $options->pack_start($frame2,1,1,1);
  325. $rem_host->set_text("Nikto Gui Web Scanner");
  326.  
  327. my $frame3 = Gtk2::Frame->new();
  328. my $rem_port = Gtk2::Label->new;
  329. #$rem_port->set_width_chars(10);
  330. $rem_port->set_text("Version 2.0");
  331. $frame3->add($rem_port);
  332. $options->pack_start($frame3,1,1,1);
  333.  
  334. my $btn_quit = Gtk2::Button->new_from_stock('gtk-quit');
  335. $btn_quit->signal_connect("clicked" =>sub {exit;});
  336. my $btn_about = Gtk2::Button->new_from_stock('gtk-about');
  337. $btn_about->signal_connect("clicked" =>sub {About();});
  338. my $nikto_info = Gtk2::Button->new_from_stock('Nikto Info');
  339. $nikto_info->signal_connect("clicked" =>sub {
  340. my $shell = (my $stdout, my $stderr);
  341. $shell = qxx("perl nikto.pl -Version");
  342. &update_buffer($MainBuffer,$shell);
  343. });
  344.  
  345. my $nikto_up = Gtk2::Button->new_from_stock('Update Nikto');
  346. $nikto_up->signal_connect("clicked" =>sub {
  347. my $shell = (my $stdout, my $stderr);
  348. $shell = qxx("perl nikto.pl -update");
  349. &update_buffer($MainBuffer,$shell);
  350. });
  351.  
  352. my $gui_up = Gtk2::Button->new_from_stock('Update GUI');
  353. $gui_up->signal_connect("clicked" =>sub {
  354. MessageBox(" At the current moment, this
  355. project is not supported anymore
  356. because Nikto development is stalled.
  357. If Nikto development will be reactivated,
  358. Gui version will be updated. ",
  359. " Information ");
  360. });
  361.  
  362.  
  363. $options->pack_start($btn_about,1,1,1);
  364. $options->pack_start($gui_up,1,1,1);
  365. $options->pack_start($nikto_info,1,1,1);
  366. $options->pack_start($nikto_up,1,1,1);
  367. $options->pack_start($btn_quit,1,1,1);
  368. $vbox->pack_start($options,0,0,0);
  369. #$vbox->pack_start($image,0,0,0);
  370. $vbox->pack_start($comon_options,0,0,0);
  371. $vbox->pack_start($advanced_options,0,0,0);
  372. #######################################################
  373. #my $frame = Gtk2::Frame->new("Nikto Output");
  374. $frame->set_border_width(5);
  375. #my $sw = Gtk2::ScrolledWindow->new (undef, undef);
  376. $sw->set_shadow_type ('etched-out');
  377. $sw->set_policy ('automatic', 'automatic');
  378. $sw->set_size_request (600, 300);
  379. $sw->set_border_width(5);
  380. #$tview = Gtk2::TextView->new();
  381. $tview->set_editable(0);
  382. $tview->set_cursor_visible (0);
  383. #my $buffer = $tview->get_buffer();
  384. $MainBuffer->create_mark ('end', $MainBuffer->get_end_iter, 0);
  385. $MainBuffer->signal_connect (insert_text => sub {
  386. $tview->scroll_to_mark ($MainBuffer->get_mark ('end'), 0.0, 1, 0, 0.5);});
  387. $MainBuffer->create_tag ("mrX",foreground => "red",);
  388. $MainBuffer->create_tag ("mrZ",foreground => "blue",);
  389. $sw->add($tview);$frame->add($sw);
  390. $supaBox->add($frame);
  391. $vbox->pack_start($supaBox,1,1,4);
  392. my $hbox = Gtk2::HBox->new(0,5);
  393. my $ent_send = Gtk2::Entry->new;
  394. my $ent_sent_frame = Gtk2::Frame->new();
  395. $tooltips->set_tip($ent_sent_frame, "Host to scan", "");
  396. $ent_sent_frame->add($ent_send);
  397. $hbox->pack_start($ent_sent_frame,1,1,0);
  398. my $btn_send = Gtk2::Button->new_from_stock('gtk-execute');
  399. my $btn_clear = Gtk2::Button->new_from_stock('Clear Output');
  400. $tooltips->set_tip($btn_send, "Execute scan! You can actually just hit ENTER", "");
  401. $tooltips->set_tip($btn_clear, "Vipe out all output!", "");
  402. $ent_send->signal_connect('key_press_event'=> sub {my ($widget,$event) = @_;
  403. if($event->keyval == $Ret{Return}) {$btn_send->clicked;return 1;}});
  404. #######################################################
  405. $btn_send->signal_connect("clicked" =>sub {
  406. my ($x1,$x2,$x3,$x4,$x5,$x6,$x7,$x8,$x9,$x10,$x11,$x12,$x13,$x14,$x15,$x16,$x17,$x18,$x19,$x20);
  407. my ($z1,$z2,$z3,$z4,$z5,$z6,$z7,$z8,$z9,$z10,$z11,$z12,$z13,$z14); # over ...
  408. # common options
  409. if ($ok_dbcheck eq "1"){ $x1 = "-dbcheck"; } else { $x1 = ""; } if ($ok_findonly eq "1"){ $x2 = "-findonly"; } else { $x2 = ""; }
  410. if ($ok_nolookup eq "1"){ $x3 = "-nolookup"; } else { $x3 = ""; } if ($ok_ssl eq "1"){ $x4 = "-ssl"; } else { $x4 = ""; }
  411. if ($ok_single eq "1"){ $x5 = "-Single"; } else { $x5 = ""; } if ($ok_useproxy eq "1"){ $x6 = "-useproxy"; } else { $x6 = ""; }
  412. # advanced options
  413. if ($ok_config eq "1"){ $x7 = "-config"; } else { $x7 = ""; } if ($ok_cgidirs eq "1"){ $x8 = "-Cgidirs"; } else { $x8 = ""; }
  414. if ($ok_id eq "1"){ $x9 = "-id"; } else { $x9 = ""; } if ($ok_port eq "1"){ $x10 = "-port"; } else { $x10 = ""; }
  415. if ($ok_timeout eq "1"){ $x11 = "-timeout"; } else { $x11 = ""; } if ($ok_pause eq "1"){ $x12 = "-Pause"; } else { $x12 = ""; }
  416. if ($ok_display eq "1"){ $x13 = "-Display"; } else { $x13 = ""; } if ($ok_evasion eq "1"){ $x14 = "-evasion"; } else { $x14 = ""; }
  417. if ($ok_format eq "1"){ $x15 = "-Format"; } else { $x15 = ""; } if ($ok_mutate eq "1"){ $x16 = "-mutate"; } else { $x16 = ""; }
  418. if ($ok_tunning eq "1"){ $x17 = "-Tuning"; } else { $x17 = ""; } if ($ok_root eq "1"){ $x18 = "-root"; } else { $x18 = ""; }
  419. if ($ok_output eq "1"){ $x19 = "-output"; } else { $x19 = ""; } if ($ok_vhost eq "1"){ $x20 = "-vhost"; } else { $x20 = ""; }
  420. my $url = $ent_send->get_text;
  421. $z1 = $config_arg->get_text; # value of "config" argv
  422. $z2 = $cgidirs_arg->get_text; # value of "Cgidirs" argv
  423. $z3 = $id_arg->get_text; # value of "id" argv
  424. $z4 = $port_arg->get_text; # value of "port" argv
  425. $z5 = $TimeOut_arg->get_text; # value of "timeout" argv
  426. $z6 = $Pause_arg->get_text; # value of "Pause" argv
  427. $z7 = $Output_arg->get_text; # value of "output" argv
  428. $z8 = $Display_arg->get_text; # value of "Display" argv
  429. $z9 = $Evasion_arg->get_text; # value of "evasion" argv
  430. $z10 = $Format_arg->get_text; # value of "Format" argv
  431. $z11 = $Mutate_arg->get_text; # value of "mutate" argv
  432. $z12 = $Tunning_arg->get_text; # value of "Tuning" argv
  433. $z13 = $Root_arg->get_text; # value of "root" argv
  434. $z14 = $VHost_arg->get_text; # value of "vhost" argv
  435. if($GUI_OUTPUT eq ""){
  436. my $shell = (my $stdout, my $stderr);
  437. $shell = qxx( "perl nikto.pl -host $url $x1 $x2 $x3 $x4 $x5 $x6 $x7 $z1 $x8 $z2 $x9 $z3 $x10 $z4 $x11 $z5 $x12 $z6 $x13 $z8 $x14 $z9 $x15 $z10 $x16 $z11 $x17 $z12 $x18 $z13 $x19 $z7 $x20 $z14");
  438. &update_buffer($MainBuffer,$shell);
  439. return 1;
  440. } elsif($GUI_OUTPUT eq "1"){
  441. exec( "perl nikto.pl -host $url $x1 $x2 $x3 $x4 $x5 $x6 $x7 $z1 $x8 $z2 $x9 $z3 $x10 $z4 $x11 $z5 $x12 $z6 $x13 $z8 $x14 $z9 $x15 $z10 $x16 $z11 $x17 $z12 $x18 $z13 $x19 $z7 $x20 $z14");
  442. }
  443. });
  444.  
  445. $btn_clear->signal_connect("clicked" =>sub {
  446. my $clearbuffer = $tview->get_buffer;
  447. $clearbuffer->delete($clearbuffer->get_start_iter, $clearbuffer->get_end_iter);
  448. $tview->set_buffer($clearbuffer);
  449. });
  450. $hbox->pack_start($btn_send,1,1,0);
  451. $hbox->pack_end($btn_clear,1,1,0);
  452. $vbox->pack_start($hbox,1,1,4);
  453. $vbox->set_focus_child($hbox);
  454. $vbox->show_all();
  455. return $vbox;
  456. }
  457.  
  458. sub update_buffer {
  459. my ($buffer,$msg)= @_;$msg = $msg."n";
  460. my $iter = $buffer->get_end_iter;
  461. $buffer->insert_with_tags_by_name($iter, "$msg");
  462. }
  463.  
Return to perl category list

Who's Online

484 Guests, 101 Users
ckryptix, Ios, viper0i0, Diznablo, rabbidmind, asapong, Nasrudin, CollapsingWalls, mehtaparag, bitstrike, jnony, C, Nicid1, Nusquam-Redono-Sapientia, bazcrown, saifulfaizan, The End, Ultraminor, psychomarine, st3alth, themastersinner, pgmrlink, login, lionaneesh, ishkur88, mahraja, Mac, chekifr, gandalf88, Vap0r, t0ast, tantrum6226, BnE, Distorted, Psiber_Syn, Ausome1, invas10n, oldgoat, freedaysbecumei, BinaryShinigami, Rex_Mundi, Red_beard, Strobeflux, s0m3nak3dguy, Descent, teehee, machupicchu, Genetix, Anandarl, NotMyOwn, thegamerdude, Godzila, popo12341234, RedEvolution, velocity_b, myne17, teto111, aVoid, Central-Gsm, 1101, JackalReborn, InjectioN, h4lted, c0re, DisPater, markt4death, splatta, Jackowacko, saint556, Pyron2312, Azerion, howsens, white.hat.gone.bad, vazzilly, pwunkz, Inverted, QuarterCask, Infernoe11, deskata, cr4ck3rj4ck, Blizer, jasonmax, j0sh, gwenwavor, N4g4c3N, spizeyboy, Network X, Uino59, Jae Cee, ianFDK, saykov, medhaavee, zofy, demonkiller410, Stumble, SaMTHG, kishore, Raze, helasraizam, Venom1019, Jakabo