nmapfe.c

来自「Ubuntu packages of security software。 相」· C语言 代码 · 共 1,601 行 · 第 1/5 页

C
1,601
字号
    gtk_widget_set_sensitive(GTK_WIDGET(opt.maxRttTime), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.maxRttTime, 3, 4, 2, 3);  gtk_widget_show(opt.maxRttTime);  label = gtk_label_new("ms");  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), label, 4, 5, 2, 3);  gtk_widget_show(label);  opt.hostTimeout = gtk_check_button_new_with_label("Host Timeout");  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(opt.hostTimeout), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.hostTimeout, 2, 3, 3, 4);  gtk_widget_show(opt.hostTimeout);  adjust = (GtkAdjustment *) gtk_adjustment_new(6000.0, 201.0, 9999999.0, 10.0, 100.0, 100.0);  opt.hostTimeoutTime = gtk_spin_button_new(adjust, 10.0, 0);  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(opt.hostTimeoutTime), TRUE);  /*gtk_object_set(GTK_OBJECT(opt.hostTimeoutTime), "width", 75, NULL);*/  g_signal_connect(GTK_OBJECT(opt.hostTimeout), "released",		     GTK_SIGNAL_FUNC(toggle_button_set_sensitive_cb), opt.hostTimeoutTime);  g_signal_connect(GTK_OBJECT(opt.hostTimeoutTime), "changed",		     GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  if ((!opt.isr00t) || (! GTK_TOGGLE_BUTTON(opt.hostTimeout)->active))    gtk_widget_set_sensitive(GTK_WIDGET(opt.hostTimeoutTime), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.hostTimeoutTime, 3, 4, 3, 4);  gtk_widget_show(opt.hostTimeoutTime);  label = gtk_label_new("ms");  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), label, 4, 5, 3, 4);  gtk_widget_show(label);  opt.scanDelay = gtk_check_button_new_with_label("Scan Delay");  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(opt.scanDelay), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.scanDelay, 2, 3, 4, 5);  gtk_widget_show(opt.scanDelay);  adjust = (GtkAdjustment *) gtk_adjustment_new(6000.0, 1.0, 9999999.0, 10.0, 100.0, 100.0);  opt.scanDelayTime = gtk_spin_button_new(adjust, 10.0, 0);  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(opt.scanDelayTime), TRUE);  /*gtk_object_set(GTK_OBJECT(opt.scanDelayTime), "width", 75, NULL);*/  g_signal_connect(GTK_OBJECT(opt.scanDelay), "released",		     GTK_SIGNAL_FUNC(toggle_button_set_sensitive_cb), opt.scanDelayTime);  g_signal_connect(GTK_OBJECT(opt.scanDelayTime), "changed",		     GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  if ((!opt.isr00t) || (! GTK_TOGGLE_BUTTON(opt.scanDelay)->active))    gtk_widget_set_sensitive(GTK_WIDGET(opt.scanDelayTime), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.scanDelayTime, 3, 4, 4, 5);  gtk_widget_show(opt.scanDelayTime);  label = gtk_label_new("ms");  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(label), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), label, 4, 5, 4, 5);  gtk_widget_show(label);  gtk_widget_show(table);  gtk_widget_show(frame);  gtk_widget_show(nblabel);  gtk_widget_show(nbpage);  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), GTK_WIDGET(nbpage), GTK_WIDGET(nblabel));/* Files page (4th in notebook) */  nblabel = gtk_label_new("Files");  nbpage = gtk_hbox_new(TRUE, 5);  gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5);  // gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5);  frame = gtk_frame_new("Input File");  gtk_box_pack_start(GTK_BOX(nbpage), frame, TRUE, TRUE, 0);  table = gtk_table_new(5, 5, TRUE);  gtk_container_set_border_width(GTK_CONTAINER(table), 5);  gtk_table_set_col_spacing(GTK_TABLE(table), 1, 15);  gtk_container_add(GTK_CONTAINER(frame), table);  opt.useInputFile = gtk_check_button_new_with_label("Input File");  g_signal_connect(GTK_OBJECT(opt.useInputFile), "released",		     GTK_SIGNAL_FUNC(validate_file_change), NULL);  gtk_table_attach_defaults(GTK_TABLE(table), opt.useInputFile, 0, 2, 0, 1);  gtk_widget_show(opt.useInputFile);  opt.inputFilename = gtk_entry_new();  gtk_entry_set_max_length(GTK_ENTRY(opt.inputFilename), 256);  /*  gtk_object_set(GTK_OBJECT(opt.inputFilename), "width", 110, NULL);*/  g_signal_connect(GTK_OBJECT(opt.inputFilename), "changed",		     GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  gtk_widget_set_sensitive(GTK_WIDGET(opt.inputFilename),                           GTK_TOGGLE_BUTTON(opt.useInputFile)->active);  gtk_table_attach_defaults(GTK_TABLE(table), opt.inputFilename, 0, 4, 2, 3);  gtk_widget_show(opt.inputFilename);  opt.inputBrowse = gtk_button_new_with_label("Browse");  g_signal_connect(GTK_OBJECT(opt.inputBrowse), "pressed",		     GTK_SIGNAL_FUNC(browseButton_pressed_cb), opt.inputFilename);  gtk_widget_set_sensitive(GTK_WIDGET(opt.inputBrowse),                           GTK_TOGGLE_BUTTON(opt.useInputFile)->active);  gtk_table_attach_defaults(GTK_TABLE(table), opt.inputBrowse, 4, 5, 2, 3);  gtk_widget_show(opt.inputBrowse);  gtk_widget_show(table);  gtk_widget_show(frame);  frame = gtk_frame_new("Output File");  gtk_box_pack_end(GTK_BOX(nbpage), frame, TRUE, TRUE, 0);  table = gtk_table_new(5, 5, TRUE);  gtk_container_set_border_width(GTK_CONTAINER(table), 5);  gtk_table_set_col_spacing(GTK_TABLE(table), 1, 15);  gtk_container_add(GTK_CONTAINER(frame), table);  opt.useOutputFile = gtk_check_button_new_with_label("Output File");  g_signal_connect(GTK_OBJECT(opt.useOutputFile), "released",		     GTK_SIGNAL_FUNC(validate_file_change), NULL);  gtk_table_attach_defaults(GTK_TABLE(table), opt.useOutputFile, 0, 2, 0, 1);  gtk_widget_show(opt.useOutputFile);  opt.outputFilename = gtk_entry_new();  gtk_entry_set_max_length(GTK_ENTRY(opt.outputFilename), 256);  /*gtk_object_set(GTK_OBJECT(opt.outputFilename), "width", 110, NULL);*/  g_signal_connect(GTK_OBJECT(opt.outputFilename), "changed",		     GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  gtk_widget_set_sensitive(GTK_WIDGET(opt.outputFilename),                           GTK_TOGGLE_BUTTON(opt.useOutputFile)->active);  gtk_table_attach_defaults(GTK_TABLE(table), opt.outputFilename, 0, 4, 2, 3);  gtk_widget_show(opt.outputFilename);  opt.outputBrowse = gtk_button_new_with_label("Browse");  g_signal_connect(GTK_OBJECT(opt.outputBrowse), "pressed",		     GTK_SIGNAL_FUNC(browseButton_pressed_cb), opt.outputFilename);  gtk_widget_set_sensitive(GTK_WIDGET(opt.outputBrowse),                           GTK_TOGGLE_BUTTON(opt.useOutputFile)->active);  gtk_table_attach_defaults(GTK_TABLE(table), opt.outputBrowse, 4, 5, 2, 3);  gtk_widget_show(opt.outputBrowse);  {    GtkTreeIter     iter;    GtkListStore    *store;    GtkCellRenderer *renderer;    gint            i;  opt.outputFormatLabel = gtk_label_new("Output Format:");  gtk_label_set_justify(GTK_LABEL(opt.outputFormatLabel), GTK_JUSTIFY_LEFT);  gtk_table_attach_defaults(GTK_TABLE(table), opt.outputFormatLabel, 0, 2, 3, 4);  gtk_widget_show(opt.outputFormatLabel);  store = gtk_list_store_new (1, G_TYPE_STRING);  for (i = 0; i < G_N_ELEMENTS(outputFormatEntries); i++ ) {    gtk_list_store_append(store, &iter);    gtk_list_store_set(store, &iter,             0, outputFormatEntries[i],             -1);  }                  opt.outputFormatType = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));  g_object_unref(store);#if GTK_CHECK_VERSION(2,6,0)  gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (opt.outputFormatType),          is_separator, NULL, NULL);#endif  renderer = gtk_cell_renderer_text_new ();  gtk_cell_layout_pack_start (          GTK_CELL_LAYOUT (opt.outputFormatType), renderer, TRUE);  gtk_cell_layout_set_attributes (          GTK_CELL_LAYOUT (opt.outputFormatType), renderer,          "text", 0,          NULL);  g_object_unref(renderer);    g_signal_connect(G_OBJECT(opt.outputFormatType), "changed",          G_CALLBACK (outputFormatType_cb), NULL);  gtk_widget_set_sensitive(GTK_WIDGET(opt.outputFormatType),                           GTK_TOGGLE_BUTTON(opt.useOutputFile)->active);  gtk_table_attach_defaults(GTK_TABLE(table), opt.outputFormatType, 2, 4, 3, 4);  gtk_widget_show(opt.outputFormatType);  }  opt.outputAppend = gtk_check_button_new_with_label("Append to File");  gtk_table_attach_defaults(GTK_TABLE(table), opt.outputAppend, 0, 3, 4, 5);  gtk_widget_show(opt.outputAppend);  gtk_widget_show(table);  gtk_widget_show(frame);  gtk_widget_show(nblabel);  gtk_widget_show(nbpage);  gtk_notebook_append_page(GTK_NOTEBOOK(notebook), GTK_WIDGET(nbpage), GTK_WIDGET(nblabel));/* Option page (5th in notebook) */  nblabel = gtk_label_new("Options");  nbpage = gtk_table_new(2, 3, FALSE);  gtk_container_set_border_width(GTK_CONTAINER(nbpage), 5);  gtk_table_set_col_spacings(GTK_TABLE(nbpage), 5);  /* Reverse DNS Resolution frame */  {    gint i;    frame = gtk_frame_new("Reverse DNS Resolution");    gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 1, 0, 1);    vbox = gtk_vbox_new(FALSE, 5);    gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);    gtk_container_add(GTK_CONTAINER(frame), vbox);    opt.resolveType = gtk_combo_box_new_text();    for (i = 0; resolveEntries[i]; i++) {      gtk_combo_box_append_text(GTK_COMBO_BOX(opt.resolveType), resolveEntries[i]);    }    g_signal_connect(G_OBJECT(opt.resolveType), "changed",            G_CALLBACK (resolveType_cb), NULL);    gtk_box_pack_start(GTK_BOX(vbox), opt.resolveType, TRUE, FALSE, 0);    gtk_widget_show_all(frame);  }  /* Verbosity & Debugging frame */  frame = gtk_frame_new("Verbosity & Debugging Levels");  gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 0, 1, 1, 2);  table = gtk_table_new(2, 2, FALSE);  gtk_container_set_border_width(GTK_CONTAINER(table), 5);  gtk_container_add(GTK_CONTAINER(frame), table);  opt.verbose = gtk_check_button_new_with_label("Verbosity");  gtk_table_attach_defaults(GTK_TABLE(table), opt.verbose, 0, 1, 0, 1);  gtk_widget_show(opt.verbose);  adjust = (GtkAdjustment *) gtk_adjustment_new(1.0, 1.0, 2.0, 1.0, 10.0, 10.0);  opt.verboseValue = gtk_spin_button_new(adjust, 1.0, 0);  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(opt.verboseValue), TRUE);  g_signal_connect(GTK_OBJECT(opt.verbose), "released",		   GTK_SIGNAL_FUNC(toggle_button_set_sensitive_cb), opt.verboseValue);  g_signal_connect(GTK_OBJECT(opt.verboseValue), "changed",		   GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  if (!GTK_TOGGLE_BUTTON(opt.verbose)->active)    gtk_widget_set_sensitive(GTK_WIDGET(opt.verboseValue), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.verboseValue, 1, 2, 0, 1);  gtk_widget_show(opt.verboseValue);  opt.debug = gtk_check_button_new_with_label("Debugging");  gtk_table_attach_defaults(GTK_TABLE(table), opt.debug, 0, 1, 1, 2);  gtk_widget_show(opt.debug);  adjust = (GtkAdjustment *) gtk_adjustment_new(1.0, 1.0, 9.0, 1.0, 10.0, 10.0);  opt.debugValue = gtk_spin_button_new(adjust, 1.0, 0);  gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(opt.debugValue), TRUE);  g_signal_connect(GTK_OBJECT(opt.debug), "released",		   GTK_SIGNAL_FUNC(toggle_button_set_sensitive_cb), opt.debugValue);  g_signal_connect(GTK_OBJECT(opt.debugValue), "changed",		   GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  if (!GTK_TOGGLE_BUTTON(opt.debug)->active)    gtk_widget_set_sensitive(GTK_WIDGET(opt.debugValue), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.debugValue, 1, 2, 1, 2);  gtk_widget_show(opt.debugValue);  gtk_widget_show(table);  gtk_widget_show(frame);  frame = gtk_frame_new("Source");  gtk_table_attach_defaults(GTK_TABLE(nbpage), frame, 1, 2, 0, 2);  table = gtk_table_new(4, 2, FALSE);  gtk_container_set_border_width(GTK_CONTAINER(table), 5);  // gtk_table_set_col_spacings(GTK_TABLE(table), 5);  gtk_container_add(GTK_CONTAINER(frame), table);  opt.useSourceDevice = gtk_check_button_new_with_label("Device");  g_signal_connect(GTK_OBJECT(opt.useSourceDevice), "toggled",			GTK_SIGNAL_FUNC(validate_option_change), NULL);  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(opt.useSourceDevice), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.useSourceDevice, 0, 1, 0, 1);  gtk_widget_show(opt.useSourceDevice);  opt.SourceDevice = gtk_entry_new();  gtk_entry_set_max_length(GTK_ENTRY(opt.SourceDevice), 64);  /*gtk_object_set(GTK_OBJECT(opt.SourceDevice), "width", 110, NULL);*/  g_signal_connect(GTK_OBJECT(opt.useSourceDevice), "toggled",		     GTK_SIGNAL_FUNC(toggle_button_set_sensitive_cb), opt.SourceDevice);  g_signal_connect(GTK_OBJECT(opt.SourceDevice), "changed",		     GTK_SIGNAL_FUNC(display_nmap_command_cb), NULL);  if (!GTK_TOGGLE_BUTTON(opt.useSourceDevice)->active)    gtk_widget_set_sensitive(GTK_WIDGET(opt.SourceDevice), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.SourceDevice, 1, 2, 0, 1);  gtk_widget_show(opt.SourceDevice);  opt.useSourcePort = gtk_check_button_new_with_label("Port");  g_signal_connect(GTK_OBJECT(opt.useSourcePort), "released",			GTK_SIGNAL_FUNC(validate_option_change), NULL);  if (!opt.isr00t)    gtk_widget_set_sensitive(GTK_WIDGET(opt.useSourcePort), FALSE);  gtk_table_attach_defaults(GTK_TABLE(table), opt.useSourcePort, 0, 1, 1, 2);  gtk_widget_show(opt.useSourcePort);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?