1 / 14

Binary Variable Learner and Apache exploits

Binary Variable Learner and Apache exploits. Sung Kim MIT. Apache Exploits. http://localhost/re/ldap://local/dn?attributes?scope?filter?extenslsions. http://localhost/re/ldap://local/dn?attributes?scope?filter?extenslsions ?ext. Apache Exploits.

Download Presentation

Binary Variable Learner and Apache exploits

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Binary Variable Learner and Apache exploits Sung Kim MIT

  2. Apache Exploits http://localhost/re/ldap://local/dn?attributes?scope?filter?extenslsions http://localhost/re/ldap://local/dn?attributes?scope?filter?extenslsions?ext

  3. Apache Exploits http://.../ldap://local/dn?attributes?scope?filter?extenslsions?ext Apache 2.0.58 or earlier static char * escape_absolute_uri(char *, unsigned int) { … if (!strncasecmp(uri, "ldap", 4)) { int c = 0; char *token[5]; token[0] = cp = apr_pstrdup(p, cp); while (*cp && c < 5) { if (*cp == '?') { token[++c] = cp + 1; *cp = '\0'; } ++cp; }

  4. Apache Exploits if (!strncasecmp(uri, "ldap", 4)) { int c = 0; char *token[5]; token[0] = cp = apr_pstrdup(p, cp); while (*cp && c < 5) { if (*cp == '?') { token[++c] = cp + 1; *cp = '\0'; } ++cp; }

  5. Apache Exploits if (!strncasecmp(uri, "ldap", 4)) { int c = 0; char *token[5]; token[0] = cp = apr_pstrdup(p, cp); while (*cp && c < 5) { if (*cp == '?') { token[++c] = cp + 1; *cp = '\0'; } ++cp; } token[5] = cp + 1;

  6. Binary Variable if (!strncasecmp(uri, "ldap", 4)) { int c = 0; char *token[5]; token[0] = cp = apr_pstrdup(p, cp); while (*cp && c < 5) { if (*cp == '?') { token[++c] = cp + 1; *cp = '\0'; } ++cp; } loop: jge     end_loop mov     ecx,dword ptr [ebp-18h] mov    dword ptr [ebp+ecx*4-14h], eax jmp     loopend_loop:  push    offset buf_over! (00409a38)

  7. Binary Variable loop: jgeend_loop movecx,dwordptr [ebp-18h]movdwordptr [ebp+ecx*4-14h], eaxjmp     loopend_loop:  push    offset buf_over! (00409a38) token[++c] = cp + 1;

  8. Binary Variable loop: jgeend_loop movecx,dwordptr [ebp-18h]movdwordptr [ebp+ecx*4-14h], eaxjmp     loopend_loop:  push    offset buf_over! (00409a38) token[++c] = cp + 1; movdwordptr [ebp+ecx*4-14h], eax

  9. Binary Variable movdwordptr [ebp+ecx*4-14h], eax Base Offset Source Index

  10. Binary Variable push 14h ; variable name push ebp; variable name push ecx; variable value call write_binary_variable movdwordptr [ebp+ecx*4-14h], eax

  11. Community Learning User User User …… Apache Apache Apache Invariants Invariants Invariants CMS ..escape_absolute_uri(char *, unsigned int):::ENTER_4010A5binary_var <= 4 binary_var>= 1

  12. Patch (Manual) !(ecx <= 4) then jmp skip movdwordptr [ebp+ecx*4-14h], eax skip:

  13. Conclusions • Implemented preliminary binary variable learning (BVL) • Generated valid invariants • Applied BVL to Apache and its exploits • Showed the(manual) patch can prevent the exploit

  14. Binary Variable Learner and Apache exploits Sung Kim MIT

More Related