VC设置cookies实现文件刷下载量
2013-10-11 17:22
369 查看
同学XXX提问:
大家好,我们做的Android应用已经成功在中兴汇天地成功上架了,打开“中兴汇天地应用商店”http://apps.ztems.com/,搜索栏搜索“睿云”就能找到了,但是需要你注册一个应用商店的账号,完成后就可以下载了,还可以给我们评论。最简单的刷下载量请直接点击http://dl5.ztems.com/tmpfile/cst2009/2009001/appSoft/2013/10/9/ruiyun.apk(经测试可以下载,不能增加下载量)
以上两种方法均可,第一种更好,第二种也可。但是在大家空闲的时候还是推荐第一种。XXX在此谢谢各位的帮助了。
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
类似这样的app下载网站,是不会验证IP,更不会验证MAC,来实现仅仅让一个客户端下载一次.(验证IP,我们可以用代理IP来实现我们的刷下载量的目的)
模拟登录一下,看看服务器是怎样处理用户请求的.
用抓包软件监测下:
http://apps.ztems.com/newLogin.html
/storeUserbasicFacade/login.ssm
这种东西由于水平有限暂时不知道如何去处理,所以就从cookies入手了.
得到了cookies我们就可以非常轻松的绕过后台登录了.
接下来用VC实现上述操作,利用win api
InternetSetCookie
C++
lpszUrl [in]
Pointer to a null-terminated string that specifies the URL for which the cookie should be set.
lpszCookieName [in]
Pointer to a null-terminated string that specifies the name to be associated with the cookie data. If this parameter is NULL, no name is associated with the cookie.
lpszCookieData [in]
Pointer to the actual data to be associated with the URL.
Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.
Cookies created by InternetSetCookie without an expiration date are stored in memory and are available only in the same process that created them. Cookies that include an expiration date are stored in the windows\cookies directory.
Creating a new cookie might cause a dialog box to appear on the screen asking the user if they want to allow or disallow cookies from this site based on the privacy settings for the user.
Caution InternetSetCookie will unconditionally create a cookie even if “Block all cookies” is set in Internet Explorer. This behavior can be viewed as a breach of privacy even though such cookies are not subsequently sent back to servers while
the “Block all cookies” setting is active. Applications should use InternetSetCookieEx to
correctly honor the user's privacy settings.
For more cookie internals, see http://blogs.msdn.com/ieinternals/archive/2009/08/20/WinINET-IE-Cookie-Internals-FAQ.aspx.
Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.
Note WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft
Windows HTTP Services (WinHTTP).
大家好,我们做的Android应用已经成功在中兴汇天地成功上架了,打开“中兴汇天地应用商店”http://apps.ztems.com/,搜索栏搜索“睿云”就能找到了,但是需要你注册一个应用商店的账号,完成后就可以下载了,还可以给我们评论。最简单的刷下载量请直接点击http://dl5.ztems.com/tmpfile/cst2009/2009001/appSoft/2013/10/9/ruiyun.apk(经测试可以下载,不能增加下载量)
以上两种方法均可,第一种更好,第二种也可。但是在大家空闲的时候还是推荐第一种。XXX在此谢谢各位的帮助了。
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
类似这样的app下载网站,是不会验证IP,更不会验证MAC,来实现仅仅让一个客户端下载一次.(验证IP,我们可以用代理IP来实现我们的刷下载量的目的)
模拟登录一下,看看服务器是怎样处理用户请求的.
用抓包软件监测下:
POST /storeUserbasicFacade/login.ssm HTTP/1.1 Host: apps.ztems.com Connection: keep-alive Content-Length: 72 Origin: http://apps.ztems.com User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.69 Safari/537.36 Content-Type: text/plain;charset=UTF-8 Accept: */* Referer: http://apps.ztems.com/newLogin.html Accept-Encoding: gzip,deflate,sdch Accept-Language: zh-CN,zh;q=0.8 Cookie: JSESSIONID=811B619FA8744978B07238A82F1E6A8B.app42-1; zte_store_view=4028329f417e6dcd01419d5dafa21aa3-1131011170551%2C [{"email":"******","userPasswd":"****","checkCode":"3367"}]
http://apps.ztems.com/newLogin.html
/storeUserbasicFacade/login.ssm
这种东西由于水平有限暂时不知道如何去处理,所以就从cookies入手了.
得到了cookies我们就可以非常轻松的绕过后台登录了.
接下来用VC实现上述操作,利用win api
InternetSetCookie
Syntax
C++BOOL InternetSetCookie( _In_ LPCTSTR lpszUrl, _In_ LPCTSTR lpszCookieName, _In_ LPCTSTR lpszCookieData );
Parameters
lpszUrl [in]Pointer to a null-terminated string that specifies the URL for which the cookie should be set.
lpszCookieName [in]
Pointer to a null-terminated string that specifies the name to be associated with the cookie data. If this parameter is NULL, no name is associated with the cookie.
lpszCookieData [in]
Pointer to the actual data to be associated with the URL.
Return value
Returns TRUE if successful, or FALSE otherwise. To get a specific error message, call GetLastError.
Remarks
Cookies created by InternetSetCookie without an expiration date are stored in memory and are available only in the same process that created them. Cookies that include an expiration date are stored in the windows\cookies directory.Creating a new cookie might cause a dialog box to appear on the screen asking the user if they want to allow or disallow cookies from this site based on the privacy settings for the user.
Caution InternetSetCookie will unconditionally create a cookie even if “Block all cookies” is set in Internet Explorer. This behavior can be viewed as a breach of privacy even though such cookies are not subsequently sent back to servers while
the “Block all cookies” setting is active. Applications should use InternetSetCookieEx to
correctly honor the user's privacy settings.
For more cookie internals, see http://blogs.msdn.com/ieinternals/archive/2009/08/20/WinINET-IE-Cookie-Internals-FAQ.aspx.
Like all other aspects of the WinINet API, this function cannot be safely called from within DllMain or the constructors and destructors of global objects.
Note WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft
Windows HTTP Services (WinHTTP).
#include <iostream> #include <cstdio> #include <afxinet.h> using namespace std; CString getHtml(CString url) { CString content; CString data; DWORD dwStatusCode; CInternetSession session(TEXT("HttpClient")); CHttpFile* pfile = (CHttpFile *)session.OpenURL(url); pfile->QueryInfoStatusCode(dwStatusCode); if(dwStatusCode == HTTP_STATUS_OK) { while (pfile->ReadString(data)) { content += data; } } pfile->Close(); delete pfile; session.Close(); return content; } int main() { CString url = "http://apps.ztems.com/fdpc?appcode=4028329f417e6dcd01419d5dafa21aa3"; InternetSetCookie(url, NULL, TEXT("JSESSIONID=811B619FA8744978B07238A82F1E6A8B.app42-1; zte_store_view=;expires=Sat,01-Jan-2014 00:00:00GMT")); getHtml(url); }
相关文章推荐
- VC设置cookies实现文件刷下载量
- VC设置cookies实现文件刷下载量
- VC设置cookies实现文件刷下载量
- VC设置cookies实现文件刷下载量
- VC++ 实现文件上传下载服务器端
- vc实现http文件下载
- windows基于阿帕奇服务器,实现vc++文件下载功能
- VC/MFC实现版本的在线升级提示和下载(服务器配置文件的方法)
- 通过设置文件HTTP header来实现下载文件自动重命名
- C#实现开发windows服务实现自动从FTP服务器下载文件(自行设置分/时执行)
- VC++/MFC怎么实现局域网里下载FTP服务器上的文件?
- 设置响应头的Content-Disposition属性,实现文件下载示例
- 通过设置http的头信息实现服务器不保存文件直接下载
- ARM:嵌入式系统介绍、开发板环境设置、tftp实现文件下载、SecureCRT工具烧写
- VC实现文件的上传下载 客户端
- asp.net实现文件夹及文件压缩,并实现下载(三)——文件超过150M
- js 实现无干扰阴影效果 简单好用(附文件下载)
- 和我一起使用Python的bottle来实现文件的上传和下载(使用post方法)
- Java实现HTTP文件队列下载
- ASP.NET 实现PDF文件下载