Jump to content

JimmyBeam

Members
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

100 profile views

JimmyBeam's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. I am sorry for not being vague enough. I think I delivered enough information. Anyway I solve the problem because I was to stupid to declare a return value in my javascript. 😆 Thank you anyway and please keep up the good work on this awesome UDF! 🙂
  2. Thanks for your fast response. I read about the async requests after your post to understand it. I do not have a callback function in my javascript so I do not know if async is working. Sadly I do not have that much javascript know-how. When I perform the action manually I can see that sometimes it takes up to a second to get the response. Without editing my code the console output with $IAsync looks like this $scriptTest = _WD_ExecuteScript($sSession, FileRead(@ScriptDir & '\javascript\scriptTest.js'), '', True) __WD_Post: URL=HTTP://127.0.0.1:9515/session/f14c4e6a5686c9eeb294dd65948065e9/execute/async; $sData={"script":"fetch(\"https://url-from-website.com/index.php?page=xyz&ajax=1\", { \"headers\": { \"content-type\": \"application/x-www-form-urlencoded; charset=UTF-8\", \"x-requested-with\": \"XMLHttpRequest\" }, \"body\": \"token=\" + Token, \"method\": \"POST\" });", "args":[]} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=85.0.4183.102)... __WD_Post ==> Webdriver Exception: {"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=85.0.4183.102)","stacktrace":"Backtrace:\n\tOrdinal0 [0x009AD383+3134339]\n\tOrdinal0 [0x0089A171+2007409]\n\tOrdinal0 [0x0073AD90+568720]\n\tOrdinal0 [0x006E9266+234086]\n\tOrdinal0 [0x006DEC5D+191581]\n\tOrdinal0 [0x006E8773+231283]\n\tOrdinal0 [0x006DEB0B+191243]\n\tOrdinal0 [0x006C2E77+77431]\n\tOrdinal0 [0x006C3E3E+81470]\n\tOrdinal0 [0x006C3DC9+81353]\n\tOrdinal0 [0x008B0CD9+2100441]\n\tGetHandleVerifier [0x00B1B75A+1396954]\n\tGetHandleVerifier [0x00B1B3D9+1396057]\n\tGetHandleVerifier [0x00B27126+1444518]\n\tGetHandleVerifier [0x00B1BCE8+1398376]\n\tOrdinal0 [0x008A7F51+2064209]\n\tOrdinal0 [0x008B22EB+2106091]\n\tOrdinal0 [0x008B2411+2106385]\n\tOrdinal0 [0x008C49C4+2181572]\n\tBaseThreadInitThunk [0x756C6359+25]\n\tRtlGetAppContainerNamedObjectPath [0x77167C24+228]\n\tRtlGetAppContainerNamedObjectPath [0x77167BF4+180]\n"}} _WD_ExecuteScript: {"value":{"error":"script timeout","message":"script timeout\n (Session info: chrome=85.0.4183.102)... _WD_ExecuteScript ==> Webdriver Exception: HTTP status = 500 and the console output of a sync request looks like this __WD_Post: URL=HTTP://127.0.0.1:9515/session/9428d5b22b0e77db2d2ae66274fdfae7/execute/sync; $sData={"script":"fetch(\"https://url-to-website.com/index.php?page=xyz&ajax=1\", { \"headers\": { \"content-type\": \"application/x-www-form-urlencoded; charset=UTF-8\", \"x-requested-with\": \"XMLHttpRequest\" }, \"body\": \"token=\" + Token, \"method\": \"POST\" });", "args":[]} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ExecuteScript: {"value":null}... This is my simple javascript I want to execute fetch("https://url-to-website.com/index.php?page=xyz&ajax=1", { "headers": { "content-type": "application/x-www-form-urlencoded; charset=UTF-8", "x-requested-with": "XMLHttpRequest" }, "body": "token=" + Token, "method": "POST" }); I use a variable to get the token which is embedded in the html source. For further requests I always need the response with the new token. The script is getting executed correctly no matter if sync or async. But both methods dont give me the response I need. I am doing researches and testing for atleast 3 hours now but cant get a result.
  3. Hey, this is my first time using the webdriver udf - so far its brilliant. I am currently stuck at a problem where I cannot find an answer in this forum. I want to automate some things on a website which heavily relies on ajax. For this I need to execute some scripts which I tested via the chrome developer console. $scriptTest = _WD_ExecuteScript($sSession, FileRead(@ScriptDir & '\javascript\scriptTest.js')) MsgBox(0, "Info", $scriptTest) I want to get the response from my script as I do a post request. The only response I get is {"value":null} which is not the response I was waiting for because I need the token from the response to move on. I attached an example of what I mean with response. It is basically a XHR Request where I need to receive the response. I hope this is possible because I could not find a solution. Thanks in advance!
  4. Damn, you're good. Works brilliant. Thanks Worked for me: $yourXpath = "//a[.='Text']" $aObjects = BGe_IEGetDOMObjByXPathWithAttributes($oIE, $yourXpath) _IEAction($aObjects[0], "Focus") _IEAction($aObjects[0], "Click")
  5. Hello community, I've got following code (I refresh the Hwnd everytime - not the problem) $oIE = _IEAttach("0x00050472", "HWND") $aArray = _IEGetObjByClass($oIE, "classname", "div") $o = $aArray[3] ;Click $o Func _IEGetObjByClass($oIE, $sClass, $sTag = "*") Local $aRet[1] = [0] Local $allHTMLTags = _IETagNameGetCollection($oIE, $sTag) For $o In $allHTMLTags If IsString($o.className) And $o.className = $sClass Then $aRet[0] += 1 ReDim $aRet[$aRet[0] + 1] $aRet[$aRet[0]] = $o EndIf Next Return $aRet EndFunc ;==>_IEGetObjByClass and this is the html code <span id="someNumbers"> <div title="title_something" class="classname" style="padding: 0px 5px;"> <a onclick=" javascript:someJob(id, this); ">Text</a> </div> </span> $o.innerText is giving me "Text" and anyway I have no problems to get the values. My problem is that I cannot click this span/div. I tried: 1. Open javascript:OrdersType(id, this) with _IENavigate 2. fireEvent("whatever you can do with fireEvent") 3. _IEAction I cannot use the id of the span because its variable like everything else. The only static thing is the text between the <a></a> tags. The span is generated dynamically so I cannot find it in the regular source code when using IE. With _IEBodyReadHTML I see the source code like it has to be. How can I click that span? Thanks in advance. JimmyBeam
  6. Hey guys, WinHTTP.au3 is a really good UDF but I have two questions. Here is a simple code: #include <IE.au3> #include "WinHttp.au3" $oIE = _IECreate ("about:blank") $hOpen = _WinHttpOpen() $hConnect = _WinHttpConnect($hOpen, "youtube.com") $hRequest = _WinHttpOpenRequest($hConnect) _WinHttpSendRequest($hRequest) _WinHttpReceiveResponse($hRequest) Global $sChunk, $sData If _WinHttpQueryDataAvailable($hRequest) Then While 1 $sChunk = _WinHttpReadData($hRequest) If @error Then ExitLoop $sData &= $sChunk WEnd _IEDocWriteHTML($oIE,$sData) Else MsgBox(0, "", "ERROR") EndIf _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) I create an IE, catch the HTML code of youtube.com and write it to the IE. The first problem I have is that I have to change the address bar to the value of the url I connect to with WinHTTP. Because, and here is my second problem, the page has to load after I used _IEDocWriteHTML but because of an url != the url in the address bar, the site couldn't load the pictures and so on. Just that easy. In the HTML the location for a picture is "/picture/foo.jpeg" Now the url in the address bar is about:blank so he search for "about:blank/picture/foo.jpeg" but it has to be "youtube.com/picture/foo.jpeg". So I have to change the url value in the address bar and then the HTML I wrote in the IE has to go on loading. Possible or not?
  7. Hello, I searched for a while and found nothing about how to edit or add cookies with autoit. There is an addon for firefox which allows me to add and edit cookies but thats not very good for automation. Is there a way to edit and add cookies for firefox without closing the program? I took a look at "edit cookies" for firefox and it instantly adds and edits the cookies. There are several fields to fill in information. Name Content Domain Path Send for: "Any type of conncection" or "Encrypted connections only" Expires: "Expire at end of session" or "Expiration date" Is it possible to do the same with autoit? Edit: It would be the best if this will done hidden and without restarting firefox. When editing cookies.sqlite I have to restart firefox
  8. Okay I dont know that this is possible. Is there a way to secure the surfbar that nobody can cheat the creditsystem? I wrote some checks with php but its possible to get credits without viewing the sites.
  9. I would let the .dll check the checksum of the .exe so its not possible to manipulate the script otherwise the token would not work.Too bad I just can write such a program in AutoIt but not in C# or C++.
  10. I've created a surfbar which I want to release. Everything works fine but I thought about the creditsystem. I dont want to hide a url. I just want to create a key that is not easy to manipulate. When I call the php's with INetGetSource I have to send things like username and siteid. So it will be possible that someone takes the URL's to the php's and call them with the parameters. So I have to create a dll which cannot be decompiled as easy as an autoit .exe Because everything you write in autoit can be manipulate.
  11. With _INetGetSource you send the the username and password to the php. So its HTTP_GET Everything you send can be also send with a browser. When someone decompile the AutoIt Program he can get the URL and the parameters. So its possible that the user dont need the program because he have the url. When there is a .dll you send parameters to the dll can salt and hash the parameters to a key and send it via HTTP_POST to the php. Dont forget to obfuscate the dll code. So its hard for someone to get the salt to generate the key and fake the HTTP_POST
  12. Hello, I thought about a token system which allows you to secure your program. For example you have a program that has some _INetGetSource() functions. Now someone can decompile the script and use the functions outside of the program. What if you write a .dll in C or C++ that do the same like _INetGetSource. You deliver the dll some parameters with AutoIt, do a MD5 Hash with a Salt and use this as a key. The dll sends this key to a php which checks if the key is right or wrong. It would be more secure and you can be sure to 99% that they can only use your program. What do you think about it? I cannot test it because I dont know how to write this in C or C++ Maybe there is a way to do the same in AutoIt.
  13. Hey, Im currently developing a surfbar in AutoIt and have two espacially questions. I also posted this on the german autoit forum. I call a PHP via _INetGetSource and deliver some variables like Username and SiteID to verify the user to get a credit. First question is, how can I deliver the values that no one can sniff the URL and the variables I assign. Is it possible to deliver via $_Post that they cannot sniff it? Second question is, how can I add a value which doesnt allow fakers to get the URL by reversing the surfbar and fake the credits. Because when someone reverse the script and gets the url, he can generate credits. It will just function every 15 seconds because Ive added a timestamp but he can generate credits without visiting the sites. I think this is the main problem, because AutoIt code can be reversed. It is illegal but someone will do it and maybe publish it. Is it actually possible to secure the surfbar that fakers cannot generate credits outside of the surfbar? Regards, JimmyBeam
×
×
  • Create New...