1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-17 13:09:02 +00:00

Use the new API that nsock provides for proxychain parsing/handling.

This commit is contained in:
henri
2013-04-22 19:29:50 +00:00
parent 91af533ca2
commit 34e825f26e
4 changed files with 6 additions and 4 deletions

View File

@@ -136,7 +136,7 @@ NmapOps::~NmapOps() {
portlist = NULL; portlist = NULL;
} }
if (proxy_chain) { if (proxy_chain) {
free(proxy_chain); nsock_proxychain_delete(proxy_chain);
proxy_chain = NULL; proxy_chain = NULL;
} }
if (exclude_spec) { if (exclude_spec) {

View File

@@ -95,6 +95,7 @@
#include "nmap.h" #include "nmap.h"
#include "global_structures.h" #include "global_structures.h"
#include "output.h" #include "output.h"
#include <nsock.h>
#include <string> #include <string>
class NmapOps { class NmapOps {
@@ -340,7 +341,7 @@ class NmapOps {
FILE *inputfd; FILE *inputfd;
char *portlist; /* Ports list specified by user */ char *portlist; /* Ports list specified by user */
char *proxy_chain; nsock_proxychain proxy_chain;
#ifndef NOLUA #ifndef NOLUA
int script; int script;

View File

@@ -935,7 +935,8 @@ void parse_options(int argc, char **argv) {
} else if (optcmp(long_options[option_index].name, "nsock-engine") == 0) { } else if (optcmp(long_options[option_index].name, "nsock-engine") == 0) {
nsock_set_default_engine(optarg); nsock_set_default_engine(optarg);
} else if (optcmp(long_options[option_index].name, "proxies") == 0) { } else if (optcmp(long_options[option_index].name, "proxies") == 0) {
o.proxy_chain = strdup(optarg); if (nsock_proxychain_new(optarg, &o.proxy_chain, NULL) < 0)
fatal("Invalid proxy chain specification");
} else if (optcmp(long_options[option_index].name, "osscan-limit") == 0) { } else if (optcmp(long_options[option_index].name, "osscan-limit") == 0) {
o.osscan_limit = 1; o.osscan_limit = 1;
} else if (optcmp(long_options[option_index].name, "osscan-guess") == 0 } else if (optcmp(long_options[option_index].name, "osscan-guess") == 0

View File

@@ -2674,7 +2674,7 @@ int service_scan(std::vector<Target *> &Targets) {
nsp_setdevice(nsp, o.device); nsp_setdevice(nsp, o.device);
if (o.proxy_chain) { if (o.proxy_chain) {
nsock_set_proxychain(nsp, o.proxy_chain); nsp_set_proxychain(nsp, o.proxy_chain);
} }
#if HAVE_OPENSSL #if HAVE_OPENSSL