checkymander / Sharp-WMIExec

207 stars 40 forks source link

Doesn't seem to work against 127.0.0.1 #1

Open benpturner opened 5 years ago

benpturner commented 5 years ago

After some debugging I get this error when going against localhost:

Target index: 1188 System.IndexOutOfRangeException: Index was outside the bounds of the array.

Seems to be in this code: char[] chars = new char[] { random_port_char_array[1], random_port_char_array[3], random_port_char_array[5], random_port_char_array[7], random_port_char_array[9] };

benpturner commented 5 years ago

Fixed with this:

char[] chars = null; try { chars = new char[] { random_port_char_array[1], random_port_char_array[3], random_port_char_array[5], random_port_char_array[7], random_port_char_array[9] }; } catch { chars = new char[] { random_port_char_array[1], random_port_char_array[3], random_port_char_array[5], random_port_char_array[7] }; }

checkymander commented 4 years ago

Hey, sorry I guess I never got notified about this issue? I recently just made some changes to the code and tested against localhost and it seems to be working okay. Let me know if you end up giving this another shot and if you still have issues.