最近搜索

抓包工具的使用 Wireshark的使用。 wireshark

浏览:104
管理员 2024-05-02 13:29



过虑ip

image.png



  过虑tcp端口

acc5185bf8379e5acd0ad54f65580e3.png


过虑http  加 过虑 ip


e49dba52631e4bc6e3f692bdb7bfadf.png


重新获取 相当于清空 所有列表。


image.png


代码模仿发送post请求,Wireshark抓到的样子是下面


public static String kuari_post_get_qr(String url, String code  )
        throws ClientProtocolException, IOException {
    CloseableHttpClient httpclient = HttpClients.createDefault();
    HttpPost httppost = new HttpPost(url);
    httppost.setHeader("Accept", "*/*");
    httppost.setHeader("Accept-Encoding", "gzip, deflate");
    httppost.setHeader("Accept-Language", "zh-CN,zh;q=0.9");
    httppost.setHeader("Connection", "keep-alive");
    httppost.setHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    httppost.setHeader("User-Agent",
            "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.6045.160 Mobile Safari/537.36");
    // 创建参数队列
    List<NameValuePair> formparams = new ArrayList<NameValuePair>();

    String result = null;
    formparams.add(new BasicNameValuePair("code", code));

    UrlEncodedFormEntity uefEntity;

    uefEntity = new UrlEncodedFormEntity(formparams, "UTF-8");
    httppost.setEntity(uefEntity);
    // System.out.println("executing request " + httppost.getURI());
    CloseableHttpResponse response = httpclient.execute(httppost);

    HttpEntity entity = response.getEntity();
    if (entity != null) {
        result = EntityUtils.toString(entity, "UTF-8");
    }
    response.close();
    httpclient.close();
    return result;
}


String code8 = kuari_post_get_qr("


抓包抓到的内容是:

image.png





模仿别的网站这个请求,WireShark抓到这个样子,


为什么要这个软件,因为哪个网站防止f12  会跳转别的页面,试过别的方法不行。 所以只能这个软件了。

image.png


模仿的代码是

public static String kuari_post_get_qr2(String webSite, String api, String code) {
    try {
        // 发送预检请求(OPTIONS 请求)
        URL optionsUrl = new URL(webSite + api);
        HttpURLConnection optionsConn = (HttpURLConnection) optionsUrl.openConnection();
        optionsConn.setRequestMethod("OPTIONS");

        int optionsResponseCode = optionsConn.getResponseCode();
        System.out.println("OPTIONS Response Code: " + optionsResponseCode);
        // 发送实际的 POST 请求
        URL postUrl = new URL(webSite + api);
        HttpURLConnection postConn = (HttpURLConnection) postUrl.openConnection();
        postConn.setRequestMethod("POST");
        postConn.setRequestProperty("Content-Type", "application/json; charset=UTF-8");

        JSONObject object = new JSONObject();
        object.put("code", code);
        String jsonInputString = object.toString();
        //String jsonInputString = "{\"account\": \"BC-Kh7whgUzNFv5p77QwQh9U\"}";

        postConn.setDoOutput(true);
        DataOutputStream postOut = new DataOutputStream(postConn.getOutputStream());
        postOut.write(jsonInputString.getBytes("UTF-8"));
        postOut.flush();
        postOut.close();

        int postResponseCode = postConn.getResponseCode();
        System.out.println("POST Response Code: " + postResponseCode);

        BufferedReader postIn = new BufferedReader(new InputStreamReader(postConn.getInputStream()));
        String postInputLine;
        StringBuffer postResponse = new StringBuffer();
        while ((postInputLine = postIn.readLine()) != null) {
            postResponse.append(postInputLine);
        }
        postIn.close();
        System.out.println("POST Response: " + postResponse.toString());
        return postResponse.toString();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}


第二行是返回的json格式数据


image.png

{"error":"","responseData":{"images":"http://kuaristatic.space/upload/def_code.jpg"           ,"url":"http://r6960.cn?intothis=8p/wHmwRvpJE1DwJW+zzGqLWSiJ5hr1WLGZEv5pQ92w="},"status":200}







联系站长

站长微信:xiaomao0055

站长QQ:14496453