Beijing on Thursday slammed "unwarranted attacks" against it after Donald Trump's nominee for secretary of state Marco Rubio condemned "dangerous" China to fellow senators at a confirmation hearing.