It is not clear where the data is. If it is in a shell variable then
Construct a new string with the first two characters from the original, the substituted string and the trailing characters of the original. Either assign it back to the original or use it as a variable. Decide if you want to check if the original string is shorter than 8 characters.
mystring="${mystring:0:2}******${mystring:8}"
You could do
mystring=${mystring/????????/${mystring{0:2}******}
If it is in a file then
sed 's/\(..\)......../\1********/' file