aniskazi:
ESP8266.write("AT");
Serial.write is used for sending binary data, you want to send text, so use
ESP8266.print("AT\n");
You need to send a line ending as well (\n)
If that doesn't work, try adding a carriage return as well (\r).
ESP8266.print("AT\r\n");