<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          mitmproxy抓包 | Python篡改請求參數(shù)實戰(zhàn)(五)

          共 9542字,需瀏覽 20分鐘

           ·

          2021-12-13 06:27



          抓包工具mitmproxy環(huán)境配置使用(一)

          抓包工具mitmproxy | mitmweb基本用法(二)

          mitmproxy抓包 | Python實時生成接口自動化用例(三)

          mitmproxy抓包 | Python實時生成接口自動化用例

          mitmproxy抓包 | Python疑難測試場景mock實戰(zhàn)(四)

          篡改GET請求參數(shù),實例一:

          拉鉤app,我的頁面,顯示推薦banner為8點一課

          抓包信息如下,參數(shù)type=1

          GET https://gate.lagou.com/v1/neirong/edu/ads/ad?type=1 HTTP/2.0
          { "content": { "adAppHref": "https://kaiwu.lagou.com/course/courseInfo.htm?courseId=1405&decorateId=13c247ae6d4845708fb582f6ad3ab8d6&utm_source=lagouedu&utm_medium=wode&utm_campaign=8%E7%82%B9%E4%B8%80%E8%AF%BE&_channel_track_key=fdgm67Bq&lgec_type=website&lgec_sign=9A0FAD8D532161C641529DEDC5C30AFC", "adAppImage": "https://s0.lgstatic.com/i/image6/M00/66/58/CioPOWGwda-AVSDaAAB4wgdnzvg703.png", "adId": 170, "adName": "8點一課", "adPcHref": "", "adPcImage": "", "adType": null }, "message": "操作成功", "state": 1, "uiMessage": null}

          我們想篡改GET請求參數(shù)type=2,代碼如下,看看什么效果?

          class Demo:
          def request(self, flow): # 匹配指定的url if 'https://gate.lagou.com/v1/neirong/edu/ads/ad' in flow.request.url: keyword = flow.request.query.get ( "type" ) print(keyword) if keyword == "1": flow.request.query.set_all ( "type", ["2"] )

          addons = [ Demo()]

          啟動mitmproxy服務(wù),再次在app刷新請求此頁面,頁面顯示推薦banner為大數(shù)據(jù)訓(xùn)練營,抓包請求參數(shù)也是篡改后的數(shù)據(jù),說明篡改生效了

          GET https://gate.lagou.com/v1/neirong/edu/ads/ad?type=2 HTTP/2.0
          { "content": { "adAppHref": "https://edu.lagou.com/growth/sem/data_enhancement.html?utm_campaign=%E5%A4%A7%E6%95%B0%E6%8D%AE%E9%AB%98%E8%96%AA&utm_medium=xuexibanner&_channel_track_key=zaqT1dVC&utm_source=lagouedu&lgec_type=website&lgec_sign=A321FD5BDD413A5BC4B9AA31E61DCED2", "adAppImage": "https://s0.lgstatic.com/i/image/M00/8F/E6/Ciqc1GAJYdOAFnqRAABV2-XV0hA152.png", "adId": 11, "adName": "大數(shù)據(jù)訓(xùn)練營", "adPcHref": "", "adPcImage": "", "adType": null }, "message": "操作成功", "state": 1, "uiMessage": null}

          篡改POST請求參數(shù),實例二:

          花生app,本地生活頁面,搜索面,頁面顯示面相關(guān)的商品

          抓包信息如下:

          POST https:/ /hsrj-api.huashengjia100.com/general-rest/life/search
          content-type: application/x-www-form-urlencodedaccept-language: zh-Hans-CN;q=1appinfo: PeanutHot_50109accept:??*/ *content-length: 143appversion: 50109deviceidfa: DA568519-790F-4FE3-A744-36F3B7CF4877accept-encoding: gzipregid: 18171adc03a77f73a9dosinfo: iOS_15.1token: c2ab281bc23e458fa585eb108e5fad06_15320861_2actime: 1639016889000deviceinfo: DeviceName_iPhone13,3user-agent: Mozilla%2F5.0%20%28iPhone%3B%20CPU%20iPhone%20OS%2014_4%20like%20Mac%20OS%20X%29%20AppleWebKit%2F605.1.15%20%28KHTML%2C%20like%20Gecko%29%20Mobile%2F15E148platforms: iOSnettype: 1deviceuuid: 84964BB5-8897-4717-9AA8-487059D2D8F1

          channelId: 28cityId: 306keyWords: 面lat: 31.228150lng: 121.512936pageNum: 1pageSize: 20token: c2ab281bc23e458fa585eb108e5fad06_15320861_2

          { "code": null, "data": [ { "address": "浦東新區(qū)中國(上海)自由貿(mào)易試驗區(qū)浦東南路1271-1289號(單)1層107、108室", "cateName": "小吃快餐", "cityName": "上海", "dealsList": [ { "dealGroupId": null, "description": "", "discountRatio": 6.3, "discountRatioText": "6.3折", "earnSum": 0.28, "earnSumText": "返¥0.28元", "halfYearSale": -1, "orgPrice": 24.0, "pic": "https://p0.meituan.net/320.0/merchant/9cd2c719178ae2191b93bcd09f231d312409890.png%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "price": 15.0, "receiveUrl": null, "savePrice": 9.0, "title": "牛肉涼皮1份,可免費使用包間", "type": 1 } ], "detailUrl": "https://hsrjh5.huashengjia100.com/page/localStore/#/index?shopId=161953838&channelId=28", "distance": 39, "distanceToShow": "39m", "maxSavePrice": 9.0, "regionName": "八佰伴", "shopId": "161953838", "shopName": "蔡記熱干面(美克店)", "shopPic": "https://p0.meituan.net/320.0/merchant/9cd2c719178ae2191b93bcd09f231d312409890.png%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "shopPower": 44, "sort": 0 }, { "address": "浦東新區(qū)張楊路500號華潤時代廣場6樓608A", "cateName": "小吃快餐", "cityName": "上海", "dealsList": [ { "dealGroupId": null, "description": "", "discountRatio": 4.7, "discountRatioText": "4.7折", "earnSum": 0.47, "earnSumText": "返¥0.47元", "halfYearSale": -1, "orgPrice": 53.0, "pic": "https://p0.meituan.net/320.0/deal/8014afffd3f8ece057b7dafcf0a133101791008.png%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "price": 25.0, "receiveUrl": null, "savePrice": 28.0, "title": "蔥油蛤蜊拌面單人套餐", "type": 1 } ], "detailUrl": "https://hsrjh5.huashengjia100.com/page/localStore/#/index?shopId=1592150348&channelId=28", "distance": 108, "distanceToShow": "108m", "maxSavePrice": 28.0, "regionName": "八佰伴", "shopId": "1592150348", "shopName": "心樂麵館XINLE NOODLES(華潤店)", "shopPic": "https://p0.meituan.net/320.0/deal/8014afffd3f8ece057b7dafcf0a133101791008.png%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "shopPower": 38, "sort": 4 }

          篡改POST請求參數(shù)為搜索米,代碼如下,看看什么效果?

          class Demo:
          def request(self, flow): # 匹配指定的url????????if?'https://hsrj-api.huashengjia100.com'?in?flow.request.url: flow.request.urlencoded_form = [ ("keyWords", "米"),("channelId","28"),("cityId","306") ]

          addons = [ Demo()]

          啟動mitmproxy服務(wù),再次在app刷新請求此頁面,頁面顯示為米相關(guān)的商品,抓包請求參數(shù)也是篡改后的數(shù)據(jù),說明篡改生效了


          POST https://hsrj-api.huashengjia100.com/general-rest/life/search HTTP/2.0
          content-type: application/x-www-form-urlencodedaccept-language: zh-Hans-CN;q=1appinfo: PeanutHot_50109accept: */*content-length: 42appversion: 50109deviceidfa: DA568519-790F-4FE3-A744-36F3B7CF4877accept-encoding: gzipregid: 18171adc03a77f73a9dosinfo: iOS_15.1token: c2ab281bc23e458fa585eb108e5fad06_15320861_2actime: 1639017504000deviceinfo: DeviceName_iPhone13,3user-agent: Mozilla%2F5.0%20%28iPhone%3B%20CPU%20iPhone%20OS%2014_4%20like%20Mac%20OS%20X%29%20AppleWebKit%2F605.1.15%20%28KHTML%2C%20like%20Gecko%29%20Mobile%2F15E148platforms: iOSnettype: 1deviceuuid: 84964BB5-8897-4717-9AA8-487059D2D8F1
          keyWords: 米channelId: 28cityId: 306
          { "code": null, "data": [ { "address": "寶山區(qū)上大路680號—6", "cateName": "面包甜點", "cityName": "上海", "dealsList": [ { "dealGroupId": null, "description": "", "discountRatio": 6.9, "discountRatioText": "6.9折", "earnSum": null, "earnSumText": "", "halfYearSale": -1, "orgPrice": 268.0, "pic": "https://p1.meituan.net/320.0/deal/6b189ad0db0ba7fbe8414797c75b8d71103091.jpg%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "price": 184.0, "receiveUrl": null, "savePrice": 84.0, "title": "12英寸卡奇創(chuàng)意雙層卡通1個,約12英寸,圓形", "type": 1 } ], "detailUrl": "https://hsrjh5.huashengjia100.com/page/localStore/#/index?shopId=571123170&channelId=28", "distance": null, "distanceToShow": null, "maxSavePrice": 84.0, "regionName": "上海大學(xué)", "shopId": "571123170", "shopName": "卡奇米酥(上海總店)", "shopPic": "https://p1.meituan.net/320.0/deal/6b189ad0db0ba7fbe8414797c75b8d71103091.jpg%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "shopPower": 41, "sort": 0 }, { "address": "浦東新區(qū)川周公路4399號螞蟻美食城", "cateName": "粵菜", "cityName": "上海", "dealsList": [ { "dealGroupId": null, "description": "", "discountRatio": 6.8, "discountRatioText": "6.8折", "earnSum": null, "earnSumText": "", "halfYearSale": -1, "orgPrice": 54.0, "pic": "https://p0.meituan.net/320.0/deal/02f5b3d62f81bc881fb04b59ee362fa162918.jpg%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "price": 36.8, "receiveUrl": null, "savePrice": 17.2, "title": "雙人套餐,包間免費", "type": 1 } ], "detailUrl": "https://hsrjh5.huashengjia100.com/page/localStore/#/index?shopId=1653182204&channelId=28", "distance": null, "distanceToShow": null, "maxSavePrice": 17.2, "regionName": "迪士尼", "shopId": "1653182204", "shopName": "香港九咔米瀾(周浦店)", "shopPic": "https://p0.meituan.net/320.0/deal/02f5b3d62f81bc881fb04b59ee362fa162918.jpg%40320w_240h_1e_1c_1l%7Cwatermark%3D0", "shopPower": 0, "sort": 1 }


          瀏覽 82
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  屄屄屄屄屄屄屄屄屄屄屄屄视频在线免费看 | 国产肏屄网站 | 色五月丁香五月 | 黄色小视频网 | 久久艹逼|