aardioٷ

¼ | עԱ
aardioٷ Ż

Ϊʲôstring.gmatchģʽֻƥһ

: ejzhang | ʱ: 2017-3-10 19:43| 鿴: 687| : 5|ģʽ

ejzhang 2017-3-10 19:45 ༭

£ȡname/valueԣ֪дIJԣֻƥһæһ£лл
  1. var loginPage = /*
  2. <form method="post" action="Login.aspx" id="ctl00">
  3. <div class="aspNetHidden">
  4. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTM2MzA1Mjk3MWRkUA4opvbdiOZtPM6qILMpH+CwyN4/2SK+JaSEBaRAFjs=" />
  5. </div>

  6. <div class="aspNetHidden">

  7.         <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C2EE9ABB" />
  8.         <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAWAQbPuD7juwPqkxOu1KTdzY3plgk0YBAefRz3MyBlTcHY2+Mc6SrnAqio3oCKbxYaPATI3gZlhMdRkPV/JuGFbzfg78Z8BXhXifTCAVkevdy3O7YpozOG9ntwamGFdiY7ZLqcTzo6aypgMsaQz9Im2" />
  9. </div>
  10. <table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
  11. */

  12. var regExp = /*\s*div\s+class\s*=\s*"aspNetHidden"\s*\>[^<>]*\<\s*input[^<>]+name\s*=\s*"([^"]+)"[^<>]+value\s*=\s*"([^"]*)"[^<>]*\>[^<>]*\</\s*div\s*\>*/;

  13. for name, value in string.gmatch( loginPage, regExp ) {
  14.         console.varDump( name, value );
  15. }
ƴ

5e365 2017-3-10 20:34:36
import console

var loginPage = /*
<form method="post" action="Login.aspx" id="ctl00">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTM2MzA1Mjk3MWRkUA4opvbdiOZtPM6qILMpH+CwyN4/2SK+JaSEBaRAFjs=" />
</div>

<div class="aspNetHidden">

        <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C2EE9ABB" />
        <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAWAQbPuD7juwPqkxOu1KTdzY3plgk0YBAefRz3MyBlTcHY2+Mc6SrnAqio3oCKbxYaPATI3gZlhMdRkPV/JuGFbzfg78Z8BXhXifTCAVkevdy3O7YpozOG9ntwamGFdiY7ZLqcTzo6aypgMsaQz9Im2" />
</div>
<table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
*/


for name, value in string.gmatch(loginPage, `name\s*=\s*"(.+?)"[^>]+value\s*=\s*"(.+?)"`) {
    console.log(name, value,
'\n')
}

console.pause()

ejzhang 2017-3-11 12:22:30
5e365 2017-3-10 20:34
import console

var loginPage = /*

лл@5e365ֻƥ䡰aspNetHiddenname/valueԣʵ֣
ejzhang 2017-3-11 14:02:15
ejzhang 2017-3-11 14:03 ༭

ͨǶ׽ˣ֪Ƿиõķ

  1. import console

  2. var loginPage = /*
  3. <form method="post" action="Login.aspx" id="ctl00">
  4. <div class="aspNetHidden">
  5. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTM2MzA1Mjk3MWRkUA4opvbdiOZtPM6qILMpH+CwyN4/2SK+JaSEBaRAFjs=" />
  6. </div>

  7. <div class="aspNetHidden">

  8.         <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C2EE9ABB" />
  9.         <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAWAQbPuD7juwPqkxOu1KTdzY3plgk0YBAefRz3MyBlTcHY2+Mc6SrnAqio3oCKbxYaPATI3gZlhMdRkPV/JuGFbzfg78Z8BXhXifTCAVkevdy3O7YpozOG9ntwamGFdiY7ZLqcTzo6aypgMsaQz9Im2" />
  10. </div>
  11. <table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
  12. */

  13. for input in string.gmatch( loginPage, `\<\s*div\s*class\s*=\s*"aspNetHidden"\s*\>(.*?)\<\s*\/\s*div\s*\>` ) {
  14.         for name, value in string.gmatch( input, `\<\s*input.+?name\s*=\s*"(.+?)".*?value\s*=\s*"(.+?)".*?\>` ) {
  15.                 console.log( name, value, '\n' );
  16.         }
  17. }

  18. console.pause();
ƴ
5e365 2017-3-11 19:18:06
ejzhang 2017-3-11 14:02
ͨǶ׽ˣ֪Ƿиõķ
  1. import console
  2. import web.mshtml

  3. var loginPage = /*
  4. <form method="post" action="Login.aspx" id="ctl00">
  5. <div class="aspNetHidden">
  6. <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTM2MzA1Mjk3MWRkUA4opvbdiOZtPM6qILMpH+CwyN4/2SK+JaSEBaRAFjs=" />
  7. </div>

  8. <div class="aspNetHidden">

  9.         <input type="hidden" name="__VIEWSTATEGENERATOR" id="__VIEWSTATEGENERATOR" value="C2EE9ABB" />
  10.         <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEdAAWAQbPuD7juwPqkxOu1KTdzY3plgk0YBAefRz3MyBlTcHY2+Mc6SrnAqio3oCKbxYaPATI3gZlhMdRkPV/JuGFbzfg78Z8BXhXifTCAVkevdy3O7YpozOG9ntwamGFdiY7ZLqcTzo6aypgMsaQz9Im2" />
  11. </div>
  12. <table width="100%"  height="100%" border="0" cellspacing="0" cellpadding="0">
  13. */

  14. console.log("----- 1 -----")
  15. for aspNetHidden in string.gmatch(loginPage, `%<"aspNetHidden"\s*\>><@@</div>@>`) {
  16.         for name, value in string.gmatch(aspNetHidden, `name\s*=\s*"(.+?)"[^>]+value\s*=\s*"(.+?)"`) {
  17.             console.log(name, value, '\n')
  18.         }
  19. }

  20. console.log("----- 2 -----")
  21. wb = web.mshtml()
  22. wb.write(loginPage)
  23. var aspNetHidden = wb.queryEles(tagName="div"; className = "aspNetHidden")
  24. for(i=1;#aspNetHidden;1){
  25.         for j,input in wb.eachAll("input", aspNetHidden[i]) {
  26.                 console.log(input.name, input.value)
  27.         }
  28. }

  29. console.pause()
ƴ


ַԣܵĿǺ÷

1 +10
mzky + 10 ڶ һ

鿴ȫ

ejzhang 2017-3-11 22:07:14

dzл

ֻ|δϽûתرվ|վ|aardio.com|aardioٷ ( ICP09012014 )

GMT+8, 2017-9-25 19:28 , Processed in 0.046875 second(s), 19 queries , WinCache On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

ٻظ ض б