? ??????????????????? ????Easy Install Instructions:???1. Copy the Code??2. Log in to your Blogger account
and go to "Manage Layout" from the Blogger Dashboard??3. Click on the "Edit HTML" tab.??4. Delete the code already in the "Edit Template" box and paste the new code in.??5. Click "S BLOGGER TEMPLATES AND TWITTER BACKGROUNDS ?

Saturday, January 20, 2024

Defcon 2015 Coding Skillz 1 Writeup

Just connecting to the service, a 64bit cpu registers dump is received, and so does several binary code as you can see:



The registers represent an initial cpu state, and we have to reply with the registers result of the binary code execution. This must be automated becouse of the 10 seconds server socket timeout.

The exploit is quite simple, we have to set the cpu registers to this values, execute the code and get resulting registers.

In python we created two structures for the initial state and the ending state.

cpuRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}
finalRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}

We inject at the beginning several movs for setting the initial state:

for r in cpuRegs.keys():
    code.append('mov %s, %s' % (r, cpuRegs[r]))

The 64bit compilation of the movs and the binary code, but changing the last ret instruction by a sigtrap "int 3"
We compile with nasm in this way:

os.popen('nasm -f elf64 code.asm')
os.popen('ld -o code code.o ')

And use GDB to execute the code until the sigtrap, and then get the registers

fd = os.popen("gdb code -ex 'r' -ex 'i r' -ex 'quit'",'r')
for l in fd.readlines():
    for x in finalRegs.keys():
           ...

We just parse the registers and send the to the server in the same format, and got the key.


The code:

from libcookie import *
from asm import *
import os
import sys

host = 'catwestern_631d7907670909fc4df2defc13f2057c.quals.shallweplayaga.me'
port = 9999

cpuRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}
finalRegs = {'rax':'','rbx':'','rcx':'','rdx':'','rsi':'','rdi':'','r8':'','r9':'','r10':'','r11':'','r12':'','r13':'','r14':'','r15':''}
fregs = 15

s = Sock(TCP)
s.timeout = 999
s.connect(host,port)

data = s.readUntil('bytes:')


#data = s.read(sz)
#data = s.readAll()

sz = 0

for r in data.split('\n'):
    for rk in cpuRegs.keys():
        if r.startswith(rk):
            cpuRegs[rk] = r.split('=')[1]

    if 'bytes' in r:
        sz = int(r.split(' ')[3])



binary = data[-sz:]
code = []

print '[',binary,']'
print 'given size:',sz,'bin size:',len(binary)        
print cpuRegs


for r in cpuRegs.keys():
    code.append('mov %s, %s' % (r, cpuRegs[r]))


#print code

fd = open('code.asm','w')
fd.write('\n'.join(code)+'\n')
fd.close()
Capstone().dump('x86','64',binary,'code.asm')

print 'Compilando ...'
os.popen('nasm -f elf64 code.asm')
os.popen('ld -o code code.o ')

print 'Ejecutando ...'
fd = os.popen("gdb code -ex 'r' -ex 'i r' -ex 'quit'",'r')
for l in fd.readlines():
    for x in finalRegs.keys():
        if x in l:
            l = l.replace('\t',' ')
            try:
                i = 12
                spl = l.split(' ')
                if spl[i] == '':
                    i+=1
                print 'reg: ',x
                finalRegs[x] = l.split(' ')[i].split('\t')[0]
            except:
                print 'err: '+l
            fregs -= 1
            if fregs == 0:
                #print 'sending regs ...'
                #print finalRegs
                
                buff = []
                for k in finalRegs.keys():
                    buff.append('%s=%s' % (k,finalRegs[k]))


                print '\n'.join(buff)+'\n'

                print s.readAll()
                s.write('\n'.join(buff)+'\n\n\n')
                print 'waiting flag ....'
                print s.readAll()

                print '----- yeah? -----'
                s.close()
                



fd.close()
s.close()





Related links


  1. Hacking Tools For Beginners
  2. Easy Hack Tools
  3. Pentest Tools Alternative
  4. Hacking Tools Mac
  5. Hacking Tools Mac
  6. Hacking Tools Pc
  7. How To Install Pentest Tools In Ubuntu
  8. Hack Tools Download
  9. World No 1 Hacker Software
  10. Install Pentest Tools Ubuntu
  11. Hacker Tools For Pc
  12. Hack Tools
  13. Hack Tools For Windows
  14. Beginner Hacker Tools
  15. Install Pentest Tools Ubuntu
  16. Nsa Hack Tools Download
  17. Hacker Tools 2020
  18. What Are Hacking Tools
  19. Hacking Tools And Software
  20. New Hacker Tools
  21. Hack Tools For Games
  22. Hacking Tools Download
  23. Pentest Tools Free
  24. Hacking Tools Software
  25. Pentest Tools Tcp Port Scanner
  26. Hacker Tools Online
  27. Nsa Hack Tools
  28. Best Hacking Tools 2019
  29. Nsa Hack Tools
  30. Hack Tool Apk
  31. Hack Website Online Tool
  32. Hacker Techniques Tools And Incident Handling
  33. Hacking Tools For Games
  34. Tools 4 Hack
  35. Pentest Tools Windows
  36. Hacking Tools Mac
  37. Pentest Recon Tools
  38. Hack Tools For Ubuntu
  39. Hack Rom Tools
  40. Best Hacking Tools 2019
  41. Pentest Tools For Mac
  42. Pentest Tools
  43. Pentest Tools Free
  44. Hack Website Online Tool
  45. Blackhat Hacker Tools
  46. Hacker Hardware Tools
  47. Underground Hacker Sites
  48. Hacking Tools For Games
  49. Hacking Tools Windows 10
  50. Hacking Tools Online
  51. Hacking Tools For Games
  52. Hacker Tools Apk Download
  53. Pentest Tools For Mac
  54. Hacking Tools Free Download
  55. Pentest Tools Website Vulnerability
  56. Hacking Tools Online
  57. Hacking Tools For Windows Free Download
  58. Best Hacking Tools 2020
  59. Pentest Tools Port Scanner
  60. Hacker Tools Free
  61. Hackers Toolbox
  62. Wifi Hacker Tools For Windows
  63. Hack Tools Download
  64. Hack Apps
  65. Hack Tools For Ubuntu
  66. Hack Tools
  67. Blackhat Hacker Tools
  68. Hacking Tools Software
  69. Hacking Tools
  70. Pentest Tools Alternative
  71. Hacking Tools 2019
  72. How To Make Hacking Tools
  73. Hacker Tools For Mac
  74. Hacking Tools Mac
  75. Hacker Tools Hardware
  76. Hack App
  77. Hacker Tools Linux
  78. Hacking Apps
  79. Hacker Tools Software
  80. Tools For Hacker
  81. Hack Tools
  82. Hacker Tools Software
  83. Hacking Tools For Windows Free Download
  84. Hak5 Tools
  85. Physical Pentest Tools
  86. Hak5 Tools
  87. Hack Tools For Games
  88. Underground Hacker Sites
  89. Hack Tool Apk No Root
  90. Hack Tools For Ubuntu
  91. How To Hack
  92. Nsa Hack Tools
  93. Hacker Tools Software
  94. Pentest Tools Windows
  95. Nsa Hacker Tools
  96. Pentest Tools Open Source
  97. World No 1 Hacker Software
  98. Pentest Tools Find Subdomains
  99. Pentest Tools Free
  100. Pentest Tools Alternative
  101. Hack Tool Apk No Root
  102. Pentest Automation Tools
  103. Hacker Tools Windows
  104. Hack Tools For Games
  105. Pentest Tools Online
  106. Pentest Tools Tcp Port Scanner
  107. Pentest Tools Tcp Port Scanner
  108. Hackrf Tools
  109. Hack Tools For Mac
  110. Hacker Tools Free
  111. New Hacker Tools
  112. Hacker Tools Github
  113. Hacking Tools Software
  114. How To Install Pentest Tools In Ubuntu
  115. Pentest Tools Alternative
  116. Beginner Hacker Tools
  117. Hack Tools 2019
  118. Hacker Tools Free
  119. Hacker Techniques Tools And Incident Handling
  120. Hacking Tools For Windows
  121. Pentest Tools Subdomain
  122. Install Pentest Tools Ubuntu
  123. Hacking Tools Usb
  124. Hack Tools For Ubuntu
  125. Hack Tools For Ubuntu
  126. Hacker Techniques Tools And Incident Handling
  127. Hacker Tools Windows
  128. Pentest Tools Free
  129. Pentest Tools Android
  130. Hacking Tools Windows 10
  131. Hacker Tools Github
  132. Hacker Tools Online
  133. Hack Tools Mac
  134. Hacking App
  135. Pentest Tools Download
  136. Hacking Tools For Windows
  137. Hacker Tools For Mac
  138. Pentest Tools Linux
  139. Pentest Tools For Ubuntu
  140. Pentest Tools Tcp Port Scanner
  141. Hacking Tools Pc
  142. Hacking Tools Online
  143. How To Make Hacking Tools
  144. Best Hacking Tools 2020
  145. Hacker Tools Github

0 comments: