mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Remove unimplemented feature payload-file
This commit is contained in:
@@ -234,7 +234,6 @@ int ArgParser::parseArguments(int argc, char *argv[]) {
|
|||||||
|
|
||||||
/* Payload */
|
/* Payload */
|
||||||
{"data", required_argument, 0, 0},
|
{"data", required_argument, 0, 0},
|
||||||
{"data-file", required_argument, 0, 0},
|
|
||||||
{"data-length", required_argument, 0, 0},
|
{"data-length", required_argument, 0, 0},
|
||||||
{"data-string", required_argument, 0, 0},
|
{"data-string", required_argument, 0, 0},
|
||||||
|
|
||||||
@@ -816,19 +815,6 @@ int ArgParser::parseArguments(int argc, char *argv[]) {
|
|||||||
o.setPayloadBuffer(buff, len);
|
o.setPayloadBuffer(buff, len);
|
||||||
o.setPayloadType(PL_HEX);
|
o.setPayloadType(PL_HEX);
|
||||||
}
|
}
|
||||||
/* Read payload from a file */
|
|
||||||
} else if (optcmp(long_options[option_index].name, "data-file") == 0 ){
|
|
||||||
if ( o.issetPayloadFilename() ) {
|
|
||||||
nping_fatal(QT_3,"Only one payload input filename allowed");
|
|
||||||
}else {
|
|
||||||
int tmp = file_is_readable(optarg);
|
|
||||||
if ( tmp == 1 )
|
|
||||||
o.setPayloadFilename(optarg);
|
|
||||||
else if ( tmp==2)
|
|
||||||
nping_fatal(QT_3,"Specified payload file is a directory, not a file.");
|
|
||||||
else
|
|
||||||
nping_fatal(QT_3,"Specified payload file does not exist or couldn't be opened for reading.");
|
|
||||||
}
|
|
||||||
/* Random payload */
|
/* Random payload */
|
||||||
} else if (optcmp(long_options[option_index].name, "data-length") == 0 ){
|
} else if (optcmp(long_options[option_index].name, "data-length") == 0 ){
|
||||||
if( o.issetPayloadType() != false )
|
if( o.issetPayloadType() != false )
|
||||||
|
|||||||
@@ -170,12 +170,6 @@ NpingOps::NpingOps() {
|
|||||||
payload_len=0;
|
payload_len=0;
|
||||||
payload_len_set=false;
|
payload_len_set=false;
|
||||||
|
|
||||||
payload_file=NULL;
|
|
||||||
payload_file_set=false;
|
|
||||||
|
|
||||||
payload_file_fd=0;
|
|
||||||
payload_file_fd_set=false;
|
|
||||||
|
|
||||||
/* Roles */
|
/* Roles */
|
||||||
role=0;
|
role=0;
|
||||||
role_set=false;
|
role_set=false;
|
||||||
@@ -1040,30 +1034,6 @@ bool NpingOps::issetPayloadLen(){
|
|||||||
} /* End of issetPayloadLen() */
|
} /* End of issetPayloadLen() */
|
||||||
|
|
||||||
|
|
||||||
int NpingOps::setPayloadFilename(char *name){
|
|
||||||
if( name==NULL ){
|
|
||||||
nping_fatal(QT_3,"setPayloadFile(): Invalid value supplied\n");
|
|
||||||
return OP_FAILURE;
|
|
||||||
}else{
|
|
||||||
this->payload_file= strdup(name);
|
|
||||||
}
|
|
||||||
this->payload_file_set=true;
|
|
||||||
return OP_SUCCESS;
|
|
||||||
} /* End of setPayloadFile() */
|
|
||||||
|
|
||||||
|
|
||||||
char *NpingOps::getPayloadFilename(){
|
|
||||||
return this->payload_file;
|
|
||||||
} /* End of getPayloadFilename() */
|
|
||||||
|
|
||||||
|
|
||||||
/* Returns true if option has been set */
|
|
||||||
bool NpingOps::issetPayloadFilename(){
|
|
||||||
return this->payload_file_set;
|
|
||||||
} /* End of issetPayloadFilename() */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Roles (normal, client, server... ) *
|
* Roles (normal, client, server... ) *
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
@@ -2396,7 +2366,7 @@ if (this->havePcap()==false){
|
|||||||
|
|
||||||
/** TCP CONNECT RELATED PARAMETERS *********************************************/
|
/** TCP CONNECT RELATED PARAMETERS *********************************************/
|
||||||
if(this->getMode()==TCP_CONNECT) {
|
if(this->getMode()==TCP_CONNECT) {
|
||||||
if(this->issetPayloadBuffer() || this->issetPayloadFilename())
|
if(this->issetPayloadBuffer())
|
||||||
nping_print(VB_0, "Warning: Payload supplied in TCP Connect mode. Payload will be ignored.");
|
nping_print(VB_0, "Warning: Payload supplied in TCP Connect mode. Payload will be ignored.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -243,9 +243,6 @@ class NpingOps {
|
|||||||
bool issetIsRoot();
|
bool issetIsRoot();
|
||||||
|
|
||||||
/* Payloads */
|
/* Payloads */
|
||||||
int setPayloadFilename(char *name);
|
|
||||||
char *getPayloadFilename();
|
|
||||||
bool issetPayloadFilename();
|
|
||||||
int setPayloadType(int t);
|
int setPayloadType(int t);
|
||||||
int getPayloadType();
|
int getPayloadType();
|
||||||
bool issetPayloadType();
|
bool issetPayloadType();
|
||||||
@@ -564,12 +561,6 @@ class NpingOps {
|
|||||||
int payload_len; /**< Length of payload */
|
int payload_len; /**< Length of payload */
|
||||||
bool payload_len_set;
|
bool payload_len_set;
|
||||||
|
|
||||||
char *payload_file; /**< Name of input filename for payload */
|
|
||||||
bool payload_file_set;
|
|
||||||
|
|
||||||
int payload_file_fd; /**< File descriptor for input payload file*/
|
|
||||||
bool payload_file_fd_set;
|
|
||||||
|
|
||||||
/* Roles */
|
/* Roles */
|
||||||
int role; /**< Nping's role: normal|cliente|server. */
|
int role; /**< Nping's role: normal|cliente|server. */
|
||||||
bool role_set;
|
bool role_set;
|
||||||
|
|||||||
Reference in New Issue
Block a user