Skip to content

Commit

Permalink
explose the SIP request URI
Browse files Browse the repository at this point in the history
  • Loading branch information
sandrogauci committed Apr 16, 2018
1 parent e8cf7e5 commit 61b7658
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion sipvicious/libs/svhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def makeRequest(
method, fromaddr, toaddr, dsthost, port, callid, srchost='',
branchunique=None, cseq=1, auth=None, localtag=None, compact=False, contact='sip:123@1.1.1.1', accept='application/sdp', contentlength=None,
localport=5060, extension=None, contenttype=None, body='',
useragent='friendly-scanner'):
useragent='friendly-scanner', requesturi=None):
"""makeRequest builds up a SIP request
method - OPTIONS / INVITE etc
toaddr = to address
Expand Down Expand Up @@ -574,6 +574,8 @@ def makeRequest(
finalheaders['Authorization'] = response

r = '%s %s SIP/2.0\r\n' % (method, uri)
if requesturi is not None:
r = '%s %s SIP/2.0\r\n' % (method, requesturi)
for h in superheaders.iteritems():
r += '%s: %s\r\n' % h
for h in headers.iteritems():
Expand Down
11 changes: 8 additions & 3 deletions sipvicious/svcrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self, host='localhost', bindingip='', localport=5060, port=5060,
externalip=None,
username=None, crackmode=1, crackargs=None, realm=None, sessionpath=None,
selecttime=0.005, compact=False, reusenonce=False, extension=None,
maxlastrecvtime=10, domain=None):
maxlastrecvtime=10, domain=None, requesturi=None):
from libs.svhelper import dictionaryattack, numericbrute, packetcounter
import logging
self.log = logging.getLogger('ASipOfRedWine')
Expand Down Expand Up @@ -96,6 +96,7 @@ def __init__(self, host='localhost', bindingip='', localport=5060, port=5060,
self.extension = username
self.bindingip = bindingip
self.localport = localport
self.requesturi = requesturi
self.noncecount = 1
self.originallocalport = localport
if self.sessionpath is not None:
Expand Down Expand Up @@ -153,7 +154,8 @@ def Register(self, extension, remotehost, auth=None, cid=None):
auth=auth,
localtag=localtag,
compact=self.compact,
localport=self.localport
localport=self.localport,
requesturi=self.requesturi
)
return register

Expand Down Expand Up @@ -390,6 +392,8 @@ def main():
Use --enabledefaults to enable this functionality""")
parser.add_option('--domain', dest="domain",
help="force a specific domain name for the SIP message, eg. -d example.org")
parser.add_option('--requesturi', dest="requesturi",
help="force the first line URI to a specific value; e.g. sip:999@example.org)
(options, args) = parser.parse_args()
exportpath = None
logging.basicConfig(level=calcloglevel(options))
Expand Down Expand Up @@ -503,7 +507,8 @@ def main():
externalip=options.externalip,
maxlastrecvtime=options.maximumtime,
localport=options.localport,
domain=options.domain
domain=options.domain,
requesturi=options.requesturi,
)

start_time = datetime.now()
Expand Down

0 comments on commit 61b7658

Please sign in to comment.