饒榮慶 -- 您今天UCWEB了嗎?--http://www.ucweb.com

          3G 手機開發(fā)網(wǎng)

             :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            99 Posts :: 1 Stories :: 219 Comments :: 0 Trackbacks

           

          1.關(guān)于自動注冊原理與實踐。

          1.基于瀏覽器請求,-- 程序員寫出一個程序模擬一條自動注冊url,把注冊所必須的參數(shù)都附在請求后面
          2.基于HttpClient 請求。實現(xiàn)過程比較簡單,可以通過穿過ssl進行請求

          自動注冊首先要解決的問題:
          1.關(guān)于注冊驗證嗎的破解。
            1.市面上一個簡單圖片驗證嗎的開發(fā)已經(jīng)不是什么難事了,對于程序生產(chǎn)的圖片,破解起來是比較困難的,
              特別是google,我曾經(jīng)不段的驗證,發(fā)現(xiàn),如果您單獨取出那條驗證嗎的,話,google會說您的請求錯誤,
              也就是google的驗證嗎的前提是必須輸入請求注冊url才行,因此破解它是很困難的。
            2.關(guān)于中文驗證嗎,雖然生產(chǎn)原理是一樣,但是給注冊的人破解就跟是難了。

          由于以上原因,我沒有找到一個關(guān)于破解驗證嗎的程序,而我本人知識水平有限,因此自動注冊,我只能
          找出那些字段跟注冊url,并模擬一個注冊請求。

          前陣子,因為有需求,打算破解Gmail的圖片識別碼,進而達到自動注冊Gmail郵箱的構(gòu)想,

          想法大概如下,構(gòu)建一個Model,保存注冊Gmail郵箱必填字段,跟一些隱藏參數(shù),

          先向Gmail注冊地址進行請求服務,拿下Gmail圖片驗證碼,進而調(diào)用圖片識別程序,進行循環(huán)破解,知道破解成功,然后往Model設(shè)置識別嗎的參數(shù),

          最后調(diào)用HttpClient進行請求服務。最后分析返回htm結(jié)果進行分析,是否注冊成功。

          在這里,唯一的難度就是破解驗證嗎程序,小弟還沒找到好方法,不過至于模擬其他請求已經(jīng)設(shè)置好。現(xiàn)在發(fā)個代碼給大家看看

           

          /** *//********************************************************************
           * 項目名稱                :<b>j2me學習</b>            <br/>
           * 
           * Copyright 2005-2006 Wuhua. All rights reserved
           ********************************************************************/
          package org.job.four;

          /** *//**
           * <b>類名:Member.java</b> </br> 
           * 編寫日期: 2007-3-27 <br/>
           * 程序功能描述:提供對注冊字段的封裝,<br/>
           *  程序只需要封裝一個member,再向gmail發(fā)生請求<br/>
           * Demo: <br/>
           * Bug: <br/>
           * 
           * 程序變更日期 :<br/> 
           * 變更作者 :<br/> 
           * 變更說明 :<br/>
           * 
           * @author wuhua </br> <a href="mailto:rrq12345@163.com">rrq12345@163.com</a>
           */
          public class Member ...{
              
              private String PasswdAgain = "51jobboj"; //重復密碼
           
              private String FirstName="foxjob"; //名字
              private String LastName="tang";//姓
              private String Email="gooooooooooooooooooooooooooogle";//email名字
              private String Passwd="51jobboj";//密碼
              private String selection="who is me?";//安全問題
              
              private String IdentityAnswer="me to 51job"; //密碼安全問題答案
              private String SecondaryEmail="gooogledev@gmail.com";//第2電子郵箱
              private String loc="中國"; //地點
              private String newaccountcaptcha="";  //驗證嗎
              
              
              //以下是gmail隱藏的參數(shù)
              private String Continue = "http://mail.google.com/mail/e-11-104e59efab9ad9107b5532645c608844-f30129a93b86f8b2ec791bab26d3a93974381ba7"; //由于continue是java關(guān)鍵字,所以把c改為大寫C
              private String t="6e91f0ba-47e895da-33e242a784269c0e1776";
              private String service="mail";
              private String dsh = "7874657562226198951";
              public final String getContinue() ...{
                  return Continue;
              }
              public final String getDsh() ...{
                  return dsh;
              }
              public final String getService() ...{
                  return service;
              }
              public final String getT() ...{
                  return t;
              }
              public final void setContinue(String continue1) ...{
                  Continue = continue1;
              }
              public final void setDsh(String dsh) ...{
                  this.dsh = dsh;
              }
              public final void setService(String service) ...{
                  this.service = service;
              }
              public final void setT(String t) ...{
                  this.t = t;
              }
              public final String getEmail() ...{
                  return Email;
              }
              public final String getFirstName() ...{
                  return FirstName;
              }
              public final String getIdentityAnswer() ...{
                  return IdentityAnswer;
              }
              public final String getLastName() ...{
                  return LastName;
              }
              public final String getLoc() ...{
                  return loc;
              }
              public final String getNewaccountcaptcha() ...{
                  return newaccountcaptcha;
              }
              public final String getPasswd() ...{
                  return Passwd;
              }
              public final String getPasswdAgain() ...{
                  return PasswdAgain;
              }
              public final String getSecondaryEmail() ...{
                  return SecondaryEmail;
              }
              public final String getSelection() ...{
                  return selection;
              }
              public final void setEmail(String email) ...{
                  Email = email;
              }
              public final void setFirstName(String firstName) ...{
                  FirstName = firstName;
              }
              public final void setIdentityAnswer(String identityAnswer) ...{
                  IdentityAnswer = identityAnswer;
              }
              public final void setLastName(String lastName) ...{
                  LastName = lastName;
              }
              public final void setLoc(String loc) ...{
                  this.loc = loc;
              }
              public final void setNewaccountcaptcha(String newaccountcaptcha) ...{
                  this.newaccountcaptcha = newaccountcaptcha;
              }
              public final void setPasswd(String passwd) ...{
                  Passwd = passwd;
              }
              public final void setPasswdAgain(String passwdAgain) ...{
                  PasswdAgain = passwdAgain;
              }
              public final void setSecondaryEmail(String secondaryEmail) ...{
                  SecondaryEmail = secondaryEmail;
              }
              public final void setSelection(String selection) ...{
                  this.selection = selection;
              }
            
              
              public static final Member getDefaultMember()...{
                  
                  return new Member();
              }
          }

           

           

          package org.job.four;

          import java.io.IOException;

          import org.apache.commons.httpclient.DefaultHttpMethodRetryHandler;
          import org.apache.commons.httpclient.HttpClient;
          import org.apache.commons.httpclient.HttpException;
          import org.apache.commons.httpclient.HttpStatus;
          import org.apache.commons.httpclient.NameValuePair;
          import org.apache.commons.httpclient.methods.GetMethod;
          import org.apache.commons.httpclient.methods.PostMethod;
          import org.apache.commons.httpclient.params.HttpMethodParams;
          import org.job.util.Logger;

          /** *//**
           * <b>類名:AutoRegistGmail.java</b> </br> 
           * 編寫日期: 2007-3-27 <br/>
           * 程序功能描述:對Gami自動注冊的啟動類 <br/>
           * 注冊原理實現(xiàn)是,封裝一些gmail比填的字段,然后再通過HttpClient向Gmail請求,
           * 請求完畢后分析結(jié)果
           * Demo: <br/>
           * Bug: <br/>
           * 
           * 程序變更日期 :<br/> 
           * 變更作者 :<br/> 
           * 變更說明 :<br/>
           * 
           * @author wuhua </br> <a href="mailto:rrq12345@163.com">rrq12345@163.com</a>
           */
          public class AutoRegistGmail ...{

           

              private static String postRegistUrl = "https://www.google.com/accounts/NewAccount";

              private static Logger logger = Logger.getLogger(AutoRegistGmail.class);

              public static void main(String[] args) ...{
                  autoRegist();
              }

              public final static void autoRegist() ...{
                  logger.debug("開始自動注冊Gmail.....");
              
                  //        構(gòu)造HttpClient的實例
                  HttpClient httpClient = new HttpClient();
                  PostMethod postMethod = new PostMethod(postRegistUrl);
                  Member member = Member.getDefaultMember();
                  
                  //             填入各個表單域的值
                  NameValuePair[] data = ...{
                          new NameValuePair("Email", member.getEmail()),
                          new NameValuePair("Passwd", member.getPasswd()),
                          new NameValuePair("PasswdAgain", member.getPasswdAgain()),
                          new NameValuePair("FirstName", member.getFirstName()),
                          new NameValuePair("Loc", member.getLoc()),
                          new NameValuePair("newaccountcaptcha", member
                                  .getIdentityAnswer()),
                          new NameValuePair("IdentityAnswer", member
                                  .getNewaccountcaptcha()),
                          new NameValuePair("Selection", member.getSelection()),
                          new NameValuePair("SecondaryEmail", member.getSecondaryEmail()),
                          new NameValuePair("continue", member.getContinue()),
                          new NameValuePair("dsh", member.getDsh()),
                          new NameValuePair("service", member.getService()) };

                  //             將表單的值放入postMethod中
                  postMethod.setRequestBody(data);
                  try ...{
                      //執(zhí)行g(shù)etMethod
                      int statusCode = httpClient.executeMethod(postMethod);
                      if (statusCode != HttpStatus.SC_OK) ...{
                          System.err.println("Method failed: "
                                  + postMethod.getStatusLine());
                      }
                      //讀取內(nèi)容 
                      byte[] responseBody = postMethod.getResponseBody();
                      //處理內(nèi)容
                      System.out.println(new String(responseBody, "UTF-8"));
                  } catch (HttpException e) ...{
                      //發(fā)生致命的異常,可能是協(xié)議不對或者返回的內(nèi)容有問題
                      System.out.println("Please check your provided http address!");
                      e.printStackTrace();
                  } catch (IOException e) ...{
                      //發(fā)生網(wǎng)絡(luò)異常
                      e.printStackTrace();
                  } finally ...{
                      //釋放連接
                      postMethod.releaseConnection();
                  }

              }
          }



          爬蟲工作室 -- 專業(yè)的手機軟件開發(fā)工作室
          3G視線 -- 專注手機軟件開發(fā)
          posted on 2007-04-04 12:42 3G工作室 閱讀(2873) 評論(8)  編輯  收藏 所屬分類: j2ee

          Feedback

          # re: 自動注冊gmail郵箱構(gòu)想 2007-04-04 13:58 aaa
          寫了等于白寫吧,核心的問題沒解決。把那些 getter 與 setter、變量的定義去掉,沒幾行代碼了。  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想[未登錄] 2007-04-04 14:08 samuel
          就是!說的沒錯  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想 2007-04-04 14:21 yuri
          解決驗證碼,其他的都不是問題  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想 2007-04-04 14:53 爬蟲工作室
          哈哈。我覺得我是沒這本事了,各位大哥有辦法,
          教教我行嗎?  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想 2007-04-04 18:17 liulc
          構(gòu)想倒是不錯  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想 2007-04-05 08:53 aaa
          來破解blogjava的驗證碼吧,是保存在cookie里面的  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想 2008-07-18 10:08 ubunto
          雖然沒提到解決驗證碼,不過對 httpclient 的 post和get 方法的使用流程有了更好的理解  回復  更多評論
            

          # re: 自動注冊gmail郵箱構(gòu)想 2012-09-25 17:17 姜英祺
          請問樓主,自動注冊時有一個bgresponse字段您是怎么獲取到的?  回復  更多評論
            

          主站蜘蛛池模板: 麻栗坡县| 海南省| 耿马| 泰来县| 平安县| 南部县| 灵丘县| 司法| 双江| 五寨县| 永登县| 宜城市| 鄂伦春自治旗| 柘荣县| 临夏县| 云浮市| 阿瓦提县| 安陆市| 阿克陶县| 普定县| 兰坪| 铁岭县| 荣成市| 新津县| 武清区| 辽阳市| 南安市| 石门县| 桃园县| 乌兰浩特市| 襄樊市| 黎川县| 韶山市| 清丰县| 团风县| 延吉市| 吉林省| 景洪市| 江北区| 昌图县| 门源|