Drug users are a high-risk group for HIV infection and are prominent HIV carriers. Given the emergence of new drugs, we explored current drug-using behaviors, HIV infections, and the correlation between drug-using behaviors and HIV infection risk among drug users from 2014 to 2021. We aimed to identify the prevalence of HIV infection risk among drug users and explore drug use behaviors based on the updated data, which could provide evidence for the precision of HIV prevention strategies among drug users. Data were collected from sentinel surveillance of drug users in rehabilitation centers and communities in Hangzhou (2014-2021), including sociodemographic characteristics, HIV awareness, drug use, risky sexual behaviors, and HIV infection status. Multivariate logistic regression was used to identify the factors influencing HIV infection and risky sexual behaviors among drug users. In total, 5623 drug users (male: n=4734, 84.19%; age: mean 38.38, SD 9.94 years) were included. New drugs dominated among the participants (n=3674, 65.34%). The main mode of drug use was noninjection (n=4756, 84.58%). Overall, for 27.45% (n=1544) of injected drugs in the last month before the investigation, the average daily injection frequency was 3.10 (SD 8.24). Meanwhile, 3.43% of participants shared needles. The incidence of sexual behaviors after drug use was 33.13% (n=1863), with 35.75% (n=666) of them using a condom in the last time. Overall, 116 participants tested positive for HIV antibodies (infection rate=2.06%). New drug users exhibited more postuse sexual behaviors than traditional drug users (odds ratio [OR] 7.771, 95% CI 6.126-9.856; P<.001). HIV-aware drug users were more likely to engage in risky sexual behaviors (OR 1.624, 95% CI 1.152-2.291; P=.006). New-type drug users were more likely to engage in unprotected sexual behavior (OR 1.457, 95% CI 1.055-2.011; P=.02). Paradoxically, drug users with greater HIV awareness were more prone to engaging in unprotected sexual behavior (OR 5.820, 95% CI 4.650-7.284; P<.001). Women engaged less in unprotected sex than men (OR 0.356, 95% CI 0.190-0.665; P=.001). HIV rates were higher among injecting drug users (OR 2.692, 95% CI 0.995-7.287; P=.04) and lower among drug users who used condoms during recent sex than those who did not (OR 0.202, 95% CI 0.076-0.537; P=.001). Higher education levels were associated with higher HIV infection rates. However, there was no significant correlation between HIV cognition level and HIV infection. New drug types and noninjection were the main patterns in last 7 years. Using new types of drugs, rather than traditional drugs, was associated with an increased risk of HIV infection. Injection drug use was a risk factor for HIV infection. HIV awareness among drug users was high, but the incidence of risky sexual behaviors remained high. Therefore, it is important to promote the behavioral transformation of high-risk populations from cognition to attitude, and then to taking protective measures.