It may be a bit shady and unscrupulous of an activity but illegal ?
Yep
https://codes.findlaw.com/us/title-52-voting-and-elections/52-usc-sect-30121.html
Elections § 30121. Contributions and donations by foreign nationals
(a) Prohibition
It shall be unlawful for--
(1) a foreign national, directly or indirectly, to make--
(A) a contribution or donation of money or other thing of value, or to make an express or implied promise to make a contribution or donation, in connection with a Federal, State, or local election;
(B) a contribution or donation to a committee of a political party; or
(C) an expenditure, independent expenditure, or disbursement for an electioneering communication (within the meaning of section 30104(f)(3) of this title); or
(2) a person to solicit, accept, or receive a contribution or donation described in subparagraph (A) or (B) of paragraph (1) from a foreign national.
(b) “Foreign national” defined
As used in this section, the term “foreign national” means--
(1) a foreign principal, as such term is defined by section 611(b) of Title 22 , except that the term “foreign national” shall not include any individual who is a citizen of the United States; or
(2) an individual who is not a citizen of the United States or a national of the United States (as defined in section 1101(a)(22) of Title 8 ) and who is not lawfully admitted for permanent residence, as defined by section 1101(a)(20) of Title 8 .