Advertisement
TMTV

voip

Dec 2nd, 2020 (edited)
1,404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.63 KB | None | 0 0
  1. import requests,os,binascii
  2. url = 'http://10.12.0.10:7547'
  3. xml1 = '''<soap:Envelope
  4. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  5. xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  6. xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
  7. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  8. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  9. <soap:Header>
  10. <cwmp:ID soap:mustUnderstand="1"></cwmp:ID>
  11. </soap:Header>
  12. <soap:Body>
  13. <cwmp:Inform>
  14. <DeviceId>
  15. <Manufacturer>DrayTek</Manufacturer>
  16. <OUI>001DAA</OUI>
  17. <ProductClass>Vigor2132FVn</ProductClass>
  18. <SerialNumber></SerialNumber>
  19. </DeviceId>
  20. <Event soap-enc:arrayType="cwmp:EventStruct[3]">
  21. <EventStruct>
  22. <EventCode>0 BOOTSTRAP</EventCode>
  23. <CommandKey></CommandKey>
  24. </EventStruct>
  25. <EventStruct>
  26. <EventCode>1 BOOT</EventCode>
  27. <CommandKey></CommandKey>
  28. </EventStruct>
  29. <EventStruct>
  30. <EventCode>4 VALUE CHANGE</EventCode>
  31. <CommandKey></CommandKey>
  32. </EventStruct>
  33. </Event>
  34. <MaxEnvelopes>1</MaxEnvelopes>
  35. <CurrentTime>2000-01-01T00:00:00</CurrentTime>
  36. <RetryCount>1</RetryCount>
  37. <ParameterList soap-enc:arrayType="cwmp:ParameterValueStruct[9]">
  38. <ParameterValueStruct>
  39. <Name>InternetGatewayDevice.DeviceInfo.SpecVersion</Name>
  40. <Value xsi:type="xsd:string">1.0</Value>
  41. </ParameterValueStruct>
  42. <ParameterValueStruct>
  43. <Name>InternetGatewayDevice.DeviceInfo.HardwareVersion</Name>
  44. <Value xsi:type="xsd:string">5</Value>
  45. </ParameterValueStruct>
  46. <ParameterValueStruct>
  47. <Name>InternetGatewayDevice.DeviceInfo.SoftwareVersion</Name>
  48. <Value xsi:type="xsd:string">3.7.9.1</Value>
  49. </ParameterValueStruct>
  50. <ParameterValueStruct>
  51. <Name>InternetGatewayDevice.DeviceInfo.ProvisioningCode</Name>
  52. <Value xsi:type="xsd:string"></Value>
  53. </ParameterValueStruct>
  54. <ParameterValueStruct>
  55. <Name>InternetGatewayDevice.ManagementServer.ConnectionRequestURL</Name>
  56. <Value xsi:type="xsd:string"></Value>
  57. </ParameterValueStruct>
  58. <ParameterValueStruct>
  59. <Name>InternetGatewayDevice.ManagementServer.ParameterKey</Name>
  60. <Value xsi:type="xsd:string"></Value>
  61. </ParameterValueStruct>
  62. <ParameterValueStruct>
  63. <Name>InternetGatewayDevice.DeviceInfo.AuthKey</Name>
  64. <Value xsi:type="xsd:string"></Value>
  65. </ParameterValueStruct>
  66. <ParameterValueStruct>
  67. <Name></Name>
  68. <Value xsi:type="xsd:string"></Value>
  69. </ParameterValueStruct>
  70. <ParameterValueStruct>
  71. <Name>InternetGatewayDevice.ManagementServer.UDPConnectionRequestAddress</Name>
  72. <Value xsi:type="xsd:string"></Value>
  73. </ParameterValueStruct>
  74. </ParameterList>
  75. </cwmp:Inform>
  76. </soap:Body>
  77. </soap:Envelope>
  78.                                                  '''
  79. xml2 = '''<soap:Envelope
  80. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  81. xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  82. xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
  83. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  84. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  85. <soap:Header>
  86. <cwmp:ID soap:mustUnderstand="1"></cwmp:ID>
  87. </soap:Header>
  88. <soap:Body>
  89. <cwmp:SetParameterValuesResponse><Status xsi:type="xsd:int">0</Status></cwmp:SetParameterValuesResponse></soap:Body></soap:Envelope>'''
  90. xml3 = '''<soap:Envelope
  91. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  92. xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
  93. xmlns:cwmp="urn:dslforum-org:cwmp-1-0"
  94. xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  95. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  96. <soap:Header>
  97. <cwmp:ID soap:mustUnderstand="1"></cwmp:ID>
  98. </soap:Header>
  99. <soap:Body>
  100. <cwmp:SetParameterValuesResponse><Status xsi:type="xsd:int">0</Status></cwmp:SetParameterValuesResponse></soap:Body></soap:Envelope>'''
  101. x = requests.post(url, data=xml1)
  102. y = (x.headers["Set-Cookie"][:-7])
  103. header = {'Cookie': y, 'User-Agent': "Vigor TR-069 CPE", 'Content-Type': "text/xml; charset=utf-8", 'SOAPAction': ""}
  104. z = requests.post(url, headers=header)
  105. a = requests.post(url, data=xml2, headers=header)
  106. b = requests.post(url, data=xml3, headers=header)
  107. c = requests.post(url, data=xml2, headers=header)
  108. d = requests.post(url, data=xml2, headers=header)
  109. e = requests.post(url, data=xml2, headers=header)
  110. f = requests.post(url, data=xml2, headers=header)
  111. g = (d.text)
  112. h = (f.text)
  113. i = g[g.find("Password")+44 : g.find("Password")+107]
  114. j = i.partition("<")[0]
  115. k = h[h.find("Password")+44 : h.find("Password")+107]
  116. l = k.partition("<")[0]
  117. if "voip.t-mobilethuis.nl" in g:
  118.     print ("Lijn 1: Gebruikersnaam: " + g[g.find("DisplayName")+47 : g.find("DisplayName")+59] + " Wachtwoord: " + j)
  119. else:
  120.     print("Geen gegevens gevonden voor lijn 1.")
  121. if "voip.t-mobilethuis.nl" in h:
  122.     print ("Lijn 2: Gebruikersnaam: " + h[h.find("DisplayName")+47 : h.find("DisplayName")+59] + " Wachtwoord: " + l)
  123. else:
  124.     print("Geen gegevens gevonden voor lijn 2.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement