Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to select interface #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions exchangeRelayx.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ def parseCommandLine():
parser.add_argument('-o', '--outfile', metavar="HASHES.txt", default = None, help='Store captured hashes in the provided file')
parser.add_argument('-l', metavar="IP", default = "127.0.0.1", help='Host to serve the hacked OWA web sessions on (default: 127.0.0.1)')
parser.add_argument('-p', metavar="port", default = 8000, help='Port to serve the hacked OWA web sessions on (default: 8000)')
parser.add_argument('-i', metavar="interface", default="0.0.0.0", help='Interface IP for relay servers to listen on (default: 0.0.0.0)')
args = parser.parse_args()
return args.t, args.outfile, args.l, args.p, args.c
return args.t, args.i, args.outfile, args.l, args.p, args.c

def checkNTLM(url):
logging.info("Testing " + url + " for NTLM authentication support...")
Expand All @@ -50,7 +51,7 @@ def checkNTLM(url):
except Exception, e:
logging.error("[checkNTLM] " + str(e))

def startServers(targetURL, hashOutputFile = None, serverIP = "127.0.0.1", serverPort = 8000):
def startServers(targetURL, interface, hashOutputFile = None, serverIP = "127.0.0.1", serverPort = 8000):
PoppedDB = Manager().dict() # A dict of PoppedUsers
PoppedDB_Lock = Lock() # A lock for opening the dict

Expand All @@ -66,7 +67,7 @@ def startServers(targetURL, hashOutputFile = None, serverIP = "127.0.0.1", serve
c.setOutputFile(hashOutputFile)
c.setMode('RELAY')
c.setAttacks(C_Attack)
c.setInterfaceIp("0.0.0.0")
c.setInterfaceIp(interface)
c.PoppedDB = PoppedDB # pass the poppedDB to the relay servers
c.PoppedDB_Lock = PoppedDB_Lock # pass the poppedDB to the relay servers
s = server(c)
Expand All @@ -89,7 +90,7 @@ def startServers(targetURL, hashOutputFile = None, serverIP = "127.0.0.1", serve

if __name__ == "__main__":
banner()
targetURL, outputFile, serverIP, serverPort, justCheck = parseCommandLine()
targetURL, interface, outputFile, serverIP, serverPort, justCheck = parseCommandLine()

if targetURL[-1] == "/":
targetURL = targetURL + "EWS/Exchange.asmx"
Expand All @@ -101,12 +102,5 @@ def startServers(targetURL, hashOutputFile = None, serverIP = "127.0.0.1", serve
if justCheck:
exit(0)

startServers(targetURL, outputFile, serverIP, serverPort)
startServers(targetURL, interface, outputFile, serverIP, serverPort)
pass