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:
@@ -136,7 +136,7 @@ NmapOps::~NmapOps() {
|
||||
portlist = NULL;
|
||||
}
|
||||
if (proxy_chain) {
|
||||
free(proxy_chain);
|
||||
nsock_proxychain_delete(proxy_chain);
|
||||
proxy_chain = NULL;
|
||||
}
|
||||
if (exclude_spec) {
|
||||
|
||||
@@ -95,6 +95,7 @@
|
||||
#include "nmap.h"
|
||||
#include "global_structures.h"
|
||||
#include "output.h"
|
||||
#include <nsock.h>
|
||||
#include <string>
|
||||
|
||||
class NmapOps {
|
||||
@@ -340,7 +341,7 @@ class NmapOps {
|
||||
FILE *inputfd;
|
||||
char *portlist; /* Ports list specified by user */
|
||||
|
||||
char *proxy_chain;
|
||||
nsock_proxychain proxy_chain;
|
||||
|
||||
#ifndef NOLUA
|
||||
int script;
|
||||
|
||||
3
nmap.cc
3
nmap.cc
@@ -935,7 +935,8 @@ void parse_options(int argc, char **argv) {
|
||||
} else if (optcmp(long_options[option_index].name, "nsock-engine") == 0) {
|
||||
nsock_set_default_engine(optarg);
|
||||
} 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) {
|
||||
o.osscan_limit = 1;
|
||||
} else if (optcmp(long_options[option_index].name, "osscan-guess") == 0
|
||||
|
||||
@@ -2674,7 +2674,7 @@ int service_scan(std::vector<Target *> &Targets) {
|
||||
nsp_setdevice(nsp, o.device);
|
||||
|
||||
if (o.proxy_chain) {
|
||||
nsock_set_proxychain(nsp, o.proxy_chain);
|
||||
nsp_set_proxychain(nsp, o.proxy_chain);
|
||||
}
|
||||
|
||||
#if HAVE_OPENSSL
|
||||
|
||||
Reference in New Issue
Block a user