We study theoretically the low-energy hole states in Si, Ge, and Ge/Si core/shell nanowires (NWs). The NW core in our model has a rectangular cross section, the results for a square cross section are presented in detail. In the case of Ge and Ge/Si core/shell NWs, we obtain very good agreement with previous theoretical results for cylindrically symmetric NWs. In particular, the NWs allow for an unusually strong and electrically controllable spin-orbit interaction (SOI) of Rashba type. We find that the dominant contribution to the SOI is the "direct Rashba spin-orbit interaction" (DRSOI), which is an important mechanism for systems with heavy-hole-lighthole mixing. Our results for Si NWs depend significantly on the orientation of the crystallographic axes. The numerically observed dependence on the growth direction is consistent with analytical results from a simple model, and we identify a setup where the DRSOI enables spin-orbit energies of the order of millielectronvolts in Si NWs. Furthermore, we analyze the dependence of the SOI on the electric field and the cross section of the Ge or Si core. A helical gap in the spectrum can be opened with a magnetic field. We obtain the largest g factors with magnetic fields applied perpendicularly to the NWs. arXiv:1712.03476v1 [cond-mat.mes-hall]