In the sixth-generation (6G) communications, how to deploy and manage massively connected Internet-of-Things (IoT) nodes will be one of the key technical challenges, because 6G is expected to provide 10 times higher connection, compared to 5G. At the same time, due to the sharp growth in connected devices and newly adopted technologies, learning-based attacks and big data breaches are expected to occur more frequently. With the advances of quantum computing in the future, conventional cryptography-based security protocols may be obsolete in the future wireless networks, which makes physical layer security (PLS) an attractive alternative or complement for secure communications. In this context, cooperative beamforming (CB)-based PLS schemes are known to be effective solutions to guarantee high secrecy rate with IoT devices, which have limited power and hardware complexity. However, the existing CB-based PLS algorithms suffer from extremely low secrecy rate, in case that eavesdroppers are close to the intended receiver. To overcome such critical issue, in this paper, we propose a CB-based PLS with artificial noise (AN) injection, which can be realized in a fully distributed manner to minimize the overhead in the IoT networks with a large number of devices. We analyze the array factor using the virtual antenna array (VAA) created by the proposed PLS algorithm. Then, the secrecy rate is derived in a closed-form expression, which can be used to optimize the performance for given system parameters in both the absence and presence of channel state information (CSI) error. The proposed scheme provides considerably higher secrecy rate compared to the conventional CB-based PLS schemes, when an eavesdropper exists near to the intended receiver. Furthermore, through simulation and numerical results, we show that the secrecy rate of the proposed scheme can be maximized by adjusting the ratio between the data beamformer and AN injection beamformer components. As a result, the proposed method shows a performance improvement of up to two times compared to the conventional CB-based PLS schemes, in terms of the secrecy rate. Such performance gain increases as the angular location of Eve becomes closer to that of Bob, which corresponds to the most vulnerable situation of the conventional CB-based PLS algorithms.