mirror of
https://github.com/nmap/nmap.git
synced 2026-11-28 18:40:10 +00:00
Flag to allow sqlping payloads in non service and version detection scans
We (Rapid7) would like to move to using upstream nmap. We require payloads to be sent with Sqlpings in non service and version detection scans. Currently we need to apply our own patch to nmap-service-probes in order to acheieve this behaviour. This change adds this behaviour to upstream nmap but can only be enabled using the `--sqlping-payload` flag
This commit is contained in:
parent
6b7652513e
commit
2c948ffdfd
5 changed files with 17 additions and 0 deletions
|
|
@ -338,6 +338,7 @@ void NmapOps::Initialize() {
|
|||
proxy_chain = NULL;
|
||||
resuming = false;
|
||||
discovery_ignore_rst = false;
|
||||
force_sqlping = false;
|
||||
}
|
||||
|
||||
bool NmapOps::SCTPScan() {
|
||||
|
|
|
|||
|
|
@ -311,6 +311,7 @@ class NmapOps {
|
|||
|
||||
nsock_proxychain proxy_chain;
|
||||
bool discovery_ignore_rst; /* host discovery should not consider TCP RST packet responses as a live asset */
|
||||
bool force_sqlping;
|
||||
|
||||
#ifndef NOLUA
|
||||
bool script;
|
||||
|
|
|
|||
|
|
@ -1160,6 +1160,11 @@ An alias for
|
|||
This causes Nmap to print out extensive debugging info about what version scanning is doing\&. It is a subset of what you get with
|
||||
\fB\-\-packet\-trace\fR\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-force\-sqlping\fR
|
||||
.RS 4
|
||||
This option overrides the default \fBno-payload\fR behavior of the \fBSqlping\fR UDP probe. It ensures the probe is sent during UDP scans (\fB-sU\fR) and version scans (\fB-sV\fR). This can be used to help change a UDP port's state from \fIopen|filtered\fR to \fIopen\fR by eliciting a response, and it ensures the specific MS-SQL server check is performed during a version scan.
|
||||
.RE
|
||||
.SH "OS DETECTION"
|
||||
.PP
|
||||
One of Nmap\*(Aqs best\-known features is remote OS detection using TCP/IP stack fingerprinting\&. Nmap sends a series of TCP and UDP packets to the remote host and examines practically every bit in the responses\&. After performing dozens of tests such as TCP ISN sampling, TCP options support and ordering, IP ID sampling, and the initial window size check, Nmap compares the results to its
|
||||
|
|
|
|||
3
nmap.cc
3
nmap.cc
|
|
@ -568,6 +568,7 @@ void parse_options(int argc, char **argv) {
|
|||
{"proxies", required_argument, 0, 0},
|
||||
{"proxy", required_argument, 0, 0},
|
||||
{"discovery-ignore-rst", no_argument, 0, 0},
|
||||
{"force-sqlping", no_argument, 0, 0},
|
||||
{"osscan-limit", no_argument, 0, 0}, /* skip OSScan if no open ports */
|
||||
{"osscan-guess", no_argument, 0, 0}, /* More guessing flexibility */
|
||||
{"fuzzy", no_argument, 0, 0}, /* Alias for osscan_guess */
|
||||
|
|
@ -811,6 +812,8 @@ void parse_options(int argc, char **argv) {
|
|||
fatal("Invalid proxy chain specification");
|
||||
} else if (strcmp(long_options[option_index].name, "discovery-ignore-rst") == 0) {
|
||||
o.discovery_ignore_rst = true;
|
||||
} else if (strcmp(long_options[option_index].name, "force-sqlping") == 0) {
|
||||
o.force_sqlping = true;
|
||||
} else if (strcmp(long_options[option_index].name, "osscan-limit") == 0) {
|
||||
o.osscan_limit = true;
|
||||
} else if (strcmp(long_options[option_index].name, "osscan-guess") == 0
|
||||
|
|
|
|||
|
|
@ -1165,6 +1165,13 @@ void ServiceProbe::setProbeDetails(char *pd, int lineno) {
|
|||
}
|
||||
while (*pd && !isspace((int) (unsigned char) *pd)) pd++;
|
||||
}
|
||||
|
||||
if (probename && strcmp(probename, "Sqlping") == 0) {
|
||||
if (o.force_sqlping) {
|
||||
log_write(LOG_STDOUT, "User-forced Sqlping: overriding no-payload directive.\n");
|
||||
notForPayload = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ServiceProbe::setProbeString(const u8 *ps, int stringlen) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue