Advertisement
Guest User

totalbug

a guest
Dec 11th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.60 KB | None | 0 0
  1. adrxs_params = {}
  2. # output = str(binascii.unhexlify(f.readline().replace("\n", "")).split("HTTP"))
  3. razd = tz[:8]
  4. stros = tz.replace("\n", "").split(razd)
  5. lln = len(stros)
  6. adresses = [""]*lln
  7. for w in range(len(stros)):
  8. if len(stros[w]) >= 40:
  9. nnn = stros[w][32:40]
  10. a = str(int(nnn[:2], 16))
  11. b = str(int(nnn[2:4], 16))
  12. c = str(int(nnn[4:6], 16))
  13. d = str(int(nnn[6:], 16))
  14. adress = a + "." + b + "." + c + "." + d
  15. if adress not in adresses:
  16. adresses[w] = adress
  17. # z.write(adress)
  18. output = str(binascii.unhexlify(stros[w][40:])).replace("\b", "")
  19. if "{" in output:
  20. ffex = output[output.find('{')+1: output.rfind("}")]
  21. if len(ffex) > 0:
  22. if ffex[0] == '"':
  23. www = [0, ffex.split(",")]
  24. if adress in adrxs_params.keys():
  25. adrxs_params[adress].append(www)
  26. else:
  27. adrxs_params[adress] = [www]
  28. found = False
  29. for jj in adrxs_params.items():
  30. z.write(jj[0] + "---->")
  31. print(jj[0])
  32. for yy in jj[1]:
  33. prilozsh = 0
  34. kmet = 0
  35. has_method = False
  36. print(yy)
  37.  
  38. for p in yy[1]:
  39. if "exception" in p or "error" in p or "Exception" in p or "Error" in p:
  40. prilozsh = -1
  41. break
  42. if '"method"' in p:
  43. has_method = True
  44. if p not in good_methods:
  45. prilozsh = -1
  46. break
  47. else:
  48. type = good_methods.index(p)
  49. for pp2 in yy[1]:
  50. if '"params"' in pp2:
  51. datax = pp2[pp2.find('"params":["')+9:]
  52. if datax != ":[]":
  53. print(datax)
  54. # check "data"
  55. z.write(p+"----")
  56. if prilozsh == 1:
  57. adrnew.append(jj[0])
  58. found = True
  59. break
  60. # elif prilozsh == -1:
  61.  
  62. if len(jj[1]) > 0:
  63. z.write("\n")
  64. # for vc in adresses:
  65. # if len(vc) > 0:
  66. # print(vc)
  67. # if not found:
  68.  
  69. tz = str(f.readline())
  70. z.write("\n")
  71. for vc in adrxs:
  72. print(vc)
  73. print(okiks)
  74.  
  75. import binascii
  76. import codecs
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement