当前位置:网站首页>Practice sharing of packet capturing tool Charles

Practice sharing of packet capturing tool Charles

2022-06-24 10:25:00 Land without autumn

I recently learned a packet capturing tool , It feels very easy to use , So I plan to share with you , The specific practice process is as follows :

preparation :mac-os System 、charles、 Mobile phone Tiktok app

1、 open Charles, PC SET proxy port : open charles->Proxy->Proxy Settings, Set proxy port , As shown in the figure :

2、 Mobile settings agent :

1) First, make sure that the mobile phone and the computer are on the same LAN

  2) Set up WiFi agent ,HTTP Change the agent to manual -> The server address is the address of the packet capturing computer IP Address (Windows You can use ipconfig Inquire about )-> The port is the step 1 in charles Set the port , As shown in the figure :

3、 Download and install mobile phone Charles certificate :help->SSL Proxying->Install Charles Root Certificate on a Mobile Device or Remote Browser-> Mobile browser input chls.pro/ssl, Download installation certificate

notes : After installing the post certificate ,IOS The phone can be set in -> Universal -> In the description file , View installed certificates

4、 Certificate of trust ( notes :IOS10 The above systems require this step ,Android and IOS10 The following systems skip this step directly )

Set up -> Universal -> About mobile phone -> Certificate trust settings : Certificate of trust

5、 SSL Agent settings : After setting as shown in the figure , Only the interface remote address ends with “:443” The interface will be captured

 6、 Mobile phone tiktok app, Enter keywords in the search box ( for example : Shed chocolate ):

7、 Click to enter the target details page :

8、 Find the corresponding data on the packet capturing tool , And get to share ID:

9、 Get to share ID You can pass python Further access to the target data :

def get_love_num(shape_id):
    '''
     Get the likes of the top ten videos except for topping 
    :param shape_id:
    :return:
    '''
    sign_ = "XXXXXXXX"
    url = f"https://www.iesdouyin.com/web/api/v2/aweme/post/?sec_uid={shape_id}&count=100&max_cursor=0&aid=1128&_signature={sign_}"
    resp = requests.get(url)
    resp_result = resp.json()
    # print(resp_result)
    love_num_list = []
    awe_list = resp_result['aweme_list']
    for awe_dict in awe_list[:10]:
        try:
            love_num = awe_dict['statistics']['digg_count']
        except:
            love_num = 0
        love_num_list.append(love_num)
    return love_num_list

Running results :

That's what I share , If there are any deficiencies, please point out , More communication , thank you !

Complete code

原网站

版权声明
本文为[Land without autumn]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240923111373.html