Web social media has become one of the major channels for people to express their opinions, share their feelings and communicate with others. Public opinions often ebb and flow with time due to the occurrence of social events and mutual influence of people on certain topics. The dynamic change of public opinions reflects the evolvement and trend of public attitudes and can facilitate many security-related applications. In this paper, we explore the modeling and detection of opinion dynamics on a specific topic based on textual social media data. We first define three measures to provide a thorough description of opinion dynamics, and identify the key factors that influence opinion changes, namely sentiment, social influence and dynamic factors. We then develop the computational method to capture opinion dynamics in security-related data. A preliminary empirical study is conducted based on the data from Weibo, one of the most popular microblog sites in China. The experimental results show the effectiveness of our method in modeling and predicting opinion dynamics.