Directory Features:
Docs: Related Documents
libdnet-stripped: Open Source network Interface Library
Liblinear: Open source large linear classification Library
Liblua: Open source Lua scripting language Library
Libnetutil: Basic network functions
Libpcap: Open Source grab Bag Library
Libpcre: Open-source Regular expression Library
Macosx:xcode Project file
Mswin32:vs Project file
The base of the Nbase:nmap package uses a library of functions
Ncat:netcat Network tool, implemented by Nmap
Ndiff: A practical command to compare NMAP scan results
Nmap-update: Responsible for nmap update operation
NPING:NMAP Project team implementation of the new hping, probing and building package
Nselib:nmap's LUA script
Parallel socketevent processing library implemented by Nsock:nmap
Scripts:nmap provides common scan-checking LUA scripts
TODO: Development tasks
Graphical interface program for Zenmap:python
Principal program Logic
Entrance procedure in main.cc, main function
- Check environment Variables Nmap_args
- Check that there are no –resume parameters
- To determine whether to scan before resume or a new request
The nmap.cc Nmap_main () function is then called according to the incoming parameters. Here is the streamlined source code:
intMainintargcChar*argv[]) {Charcommand[2048];intMYARGC;Char**MYARGV = NULL;Char*cptr;intRetintI Set_program_name (argv[0]);if(Cptr = getenv ("Nmap_args"))) {if(Snprintf (Command,sizeof(command),"Nmap%s", cptr) >= (int)sizeof(command)) {Error ("Warning:nmap_args variable is too long, truncated"); }/ * Copy rest of command-line arguments * / for(i =1; I < ARGC &&strlen(command) +strlen(Argv[i]) +1<sizeof(command); i++) {strcat(Command," ");strcat(command, Argv[i]); } MYARGC = arg_parse (command, &MYARGV);if(MYARGC <1) {Fatal ("Nmap_args variable could not be parsed"); } ret = Nmap_main (MYARGC, MYARGV); Arg_parse_free (MYARGV);returnRet }if(ARGC = =3&&strcmp("--resume", argv[1]) ==0) {if(Gather_logfile_resumption_state (argv[2], &MYARGC, &myargv) = =-1) {Fatal ("cannot resume from (supposed) log file%s", argv[2]); }returnNmap_main (MYARGC, MYARGV); }returnNmap_main (argc, argv);}
Then the program educates Nmap_main ().
In Nmap_main, the surface looks like the scanned loop starts at 2065 lines:
for (Targetno = 0; Targetno < targets.size (); targetno++) {
Currenths = Targets[targetno];
Before and after the code are more, next time to take a detailed analysis.
Here's a flowchart that someone else does:
Reference URL:
http://blog.csdn.net/wang_walfred/article/details/44910189
Nmap Source Learning two overall architecture