Home page logo
/

nmap-dev logo Nmap Development mailing list archives

Nmap frontend problem in HP-UX
From: "Saravanan" <saravanan_kovai () HotPop com>
Date: Tue, 17 Feb 2004 11:51:30 +0530

Hello Fyodor,

Here am sending my observation on nmapfe (Nmap front end in HP-Ux).   I got the GTK error after getting the first 
initial output window( Nmap Front End v 3.50 main window ). It asks the user for entering the IP address and other 
options.  After entered IP address i got the following error. Please let me know the solution on how to fix this 
problem.

Problem with NMAP in HP-UX machine :

#./nmapfe

GTK display window --appears & entered IP address. (Then error comes as below)
Xlib: unexpected async reply (sequence 0x1903)!
Gdk-ERROR **: X connection to 172.16.1.28:1.0 broken (explicit kill or server shutdown).
#

Sample GDB output :

debugging file location              :     /home/sara/nmap-3.50/nmapfe/nmapfe

# wdb

(gdb) file nmapfe
Reading symbols from nmapfe...done.
(gdb) b main
Breakpoint 1 at 0xdbf4: file /home/sara/nmap-3.50/nmapfe/nmapfe_sig.c, line 165.
(gdb) r
Starting program: /disk1/release3/nmap/3.50/Source/nmap-3.50/nmapfe/nmapfe 

Breakpoint 1, main (argc=1, argv=0x7e9f11c4) at /disk1/release3/nmap/3.50/Source/nmap-3.50/nmapfe/nmapfe_sig.c:165
(gdb) n         -------->          gtk_set_locale();

(gdb) n         ------->           gtk_init(&argc, &argv);

(gdb) n        ---------->        signal(SIGPIPE, SIG_IGN);

(gdb) n         -------->          opt.uid = getuid();
 
(gdb) n         -------->          main_win = create_main_win();

(gdb) n         --------->        gtk_widget_show(main_win);

(gdb) n        --------->         gtk_text_insert(GTK_TEXT(opt.output), NULL, NULL, NULL,    (opt.uid == 0)     ? "You 
are root - All options granted."     : "You are *NOT* root - Some                                             options 
aren't available.", -1);

(gdb) n         --------->         gtk_main();

    
                                            Now NMap Front End 3.50 appears and waits for inputting IP address. When i 
issue the input, i got the following error in wdb console.

Xlib: unexpected async reply (sequence 0x904)!
Gdk-ERROR **: X connection to 172.16.1.28:1.0 broken (explicit kill or server shutdown).

gdb error

(gdb) n
[New process 20819]
Detaching after fork from process 20819
Program exited with code 01.



Sample function involving in the execution also listed below. Pls give me solution to solve this.

/* The idea of execute() is to create an Nmap process running in the background with its stdout
    connected to a pipe we can poll many times per second to collect any new output.  Admittedly
        there are much more elegant ways to do this, but this is how it works now.  The functions
        return the process ID of nmap.  This process is
        different enough between windows & UNIX that I have two functions for doing it: */
int execute_unix(char *command)
{
#ifdef WIN32
  fatal("The execute_unix function should not be called from Windows!");
  return -1;
#else

  /* Many thanks to Fyodor for helping with the piping */
  if (pipe(pipes) == -1) {
    perror("poopy pipe error");
    exit(1);
  }

  pid = fork();
    if (!pid) {
    char **argv;
    int argc;

    argc = arg_parse(command, &argv);

    if (argc <= 0)
      exit(1);
    dup2(pipes[1], 1);
    dup2(pipes[1], 2);
    fcntl(pipes[0], F_SETFL, O_NDELAY);
    if (execvp("nmap", argv) == -1) {
      fprintf(stderr, "Nmap execution failed.  errno=%d (%s)\n", errno, strerror(errno));
      exit(1);
    }
    /*exit(127);*/
  }
  if (pid == -1) {
    fprintf(stderr, "fork() failed.  errno=%d (%s)", errno, strerror(errno));
    pid = 0;
    close(pipes[0]);
    pipes[0] = -1;
  }
  close(pipes[1]);
  pipes[1] = -1;

  return(pid);

#endif
}


Pls let me know , how to solve this. 

Thanks 
Saravanan



    
----- Original Message ----- 
From: "Saravanan" <saravanan_kovai () HotPop com>
To: <nmap-dev () insecure org>
Cc: "Fyodor" <fyodor () insecure org>
Sent: Wednesday, February 04, 2004 9:59 AM
Subject: Please Help me to resolve this GTK error.


Hello all,

I got the GTK connection error while running NMAPFE in HP-UX 11.11 PA RISC & 11.22 IPF machine.

# gdb ./nmapfe localhost


(gdb) b main
Breakpoint 1 (deferred) at "main" ("main" was not found).
Breakpoint deferred until a shared library containing "main" is loaded.
(gdb) info b
Num Type           Disp Enb Address    What
1   breakpoint     keep n   (deferred) in main
(gdb) n
The program is not being run.
(gdb) r
Starting program: /opt/iexpress/nmap/bin/./xnmap
warning: Unable to find _DLD_HOOK symbol in object file.
warning: Suggest linking with /opt/langtools/lib/end.o.
(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...
(no debugging symbols found)...(no debugging symbols found)...(no debugging
symbols found)...(no debugging symbols found)...
(no debugging symbols found)...[New process 26028]
warning: reading `r3' register: No data
Detaching after fork from process 26028
Pid of the forked process ################ 0
Pid of the forked process ################ 26028
Xlib: unexpected async reply (sequence 0x449)!
Gdk-ERROR **: X connection to 172.16.1.28:1.0 broken (explicit kill or
server shutdown).

Program exited with code 01.
warning: Temporarily disabling shared library breakpoints:
warning: breakpoint #1
(gdb)







Hai,

Thanks for ur immediate reply. Here I can't trace where my exact problem.

When i issue the command,

#nmap < IP Addr >
It works fine. Can see some port scanned output.

#nmapfe < IP Addr >
GUI window Nmap Front End 3.48 is appeared and waits for Target
specification by user. Here Target is default by Localhost...
so i din't change anything in GUI window & tried to press the scan button
available in the same window. Then GUI window is closed & control returned
back to 3 prompt and the following error is returned.

# ./nmapfe 172.16.1.33
--------> GUI Nmap front end is appeared ----> scan with default
Target ---> Error & returned back to Root prompt.

Gdk-ERROR **: X connection to 172.16.1.28:1.0 broken (explicit kill or
server shutdown).
#

I think the problem is not a XTERM problem. If it is a problem, how a GUI
window appears and waits for Target specification by user. So please let me
know what is the exact problem and how to solve this.

Thanks
Saravanan


nmapfe won't run with the following error:
# ./nmapfe 172.16.1.33
Gdk-ERROR **: X connection to 172.16.1.28:1.0 broken (explicit kill
or server shutdown).
#


Maybe it is an X Windows setup issue. Can you run an xterm from that
same root prompt?

Cheers,
-F



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.576 / Virus Database: 365 - Release Date: 1/30/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.587 / Virus Database: 371 - Release Date: 2/12/2004

  By Date           By Thread  

Current thread:
  • Nmap frontend problem in HP-UX Saravanan (Feb 17)
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]