bats3c / shad0w

A post exploitation framework designed to operate covertly on heavily monitored environments
https://blog.dylan.codes/shad0w/
MIT License
2.03k stars 323 forks source link

Fixed write outside Heap Buffer leading to crash #95

Closed eqn-group closed 3 years ago

eqn-group commented 3 years ago

line 305: base64_encode returns a pointer to the buffer of size (b64_len_out). initially you were writing the data outside the buffer to null byte, this was causing the program to crash in "line: 338" where you do "free(encoded_data);" , attempting to overwrite data outside the heap buffer.

line 298: encoded_data = (CHAR)malloc(b64_len_out 2); , the heap buffer allocated here is never used because, on the line: 305 , the pointer "encoded_data" points toward the buffer returned by base64_encode.