I need to make a recaptcha V2 harvester in Electron JS. I tried the following code but all I get it "ERROR for site owner: Invalid domain for site key". I think I need to intercept requests. Someone suggested me to use "interceptBufferProtocol" method in JS but I don't know how to use that. Can someone help me ?
<html>
<head>
<title>Captcha Harvester</title>
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
</head>
<body>
<form action="/submit" method="POST">
<div class="g-recaptcha" id="captchaFrame" data-sitekey="actual-site-key" data-callback="sub"></div>
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</body>
</html>
This error is due to "Domain mismatching".
Please set the domain of target site.
Generally, following method is used for harvesting captchas.
Open Webdriver.
Set the domain of target site.
Inject harvesting code
Related
I'm working on a project where I'm trying to allow me to upload weather data from an .xls file to an SQL database. It's my first time using Angularjs so I used a tutorial and everything seemed to work fine.
My code is:
<head>
<title>.: Import Data with AngularJS :.</title>
<meta charset="utf-8" />
<script type="text/javascript"
src="C:\Users\Bryan\source\repos\Weather\weather\Scripts\jquery-
1.10.2.min.js"></script>
<script type="text/javascript"
src="C:\Users\Bryan\source\repos\Weather\weather\Scripts\angular.min.js">
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.8/angular-
route.min.js"
<script type="text/javascript"
src="C:\Users\Bryan\source\repos\Weather\weather\Scripts\bootstrap.min.js">
</script>
<link rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.cs
s">
<script type="text/javascript"
src="C:\Users\Bryan\source\repos\Weather\weather\Scripts\ImportData.js">
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.11.5/xlsx.full.min.js">
</script>
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.11.5/jszip.js"></script>
Everything goes well but I get the following errors:
ImportData.html:7 GET http://localhost:9000/Content/bootstrap.min.css
net::ERR_ABORTED
ImportData.html:1 Not allowed to load local resource: ImportData.js
angular.js:88 Uncaught Error: [$injector:modulerr]
at angular.js:88
at angular.js:4957
at p (angular.js:410)
at g (angular.js:4917)
at gb (angular.js:4839)
at c (angular.js:1949)
at Uc (angular.js:1970)
at xe (angular.js:1855)
at angular.js:33826
at HTMLDocument.b (angular.js:3468)
I've read that bootstrap and angular can conflict, but take it out and it still seems to error out. Any ideas where the error is? Thanks in advance.
Your files are not able to fetch by the browser from the mentioned locations. So better way to give relative paths i.e. "../../ImportData.js".
Also It shows injector module error that means, Angular file is missing and its module is not able to find the libraries.
You can try replacing all the file paths with as well. Also this http://localhost:9000/Content/bootstrap.min.css
net::ERR_ABORTED
is due to the internet failure or due to your firewall restrictions. So, you can replace this with "https" instead of 'http'.
Try these options. There's problem with file links only.
The problem is that you are trying to load resources from your local computer. Try giving path as relative that will solve your issue. Also use base url in html if you want to control base url for all requests from your app.
I want to use Google Youtube Analytics API. I know that we have to use Oauth2, so I get my client ID and then follow this instruction https://developers.google.com/youtube/analytics/v1/sample-application cause I use youtube analytics for my web app.
I get confused when my request get error response
Error: origin_mismatch
I have checked my Authorized JavaScript origins, make sure that they are same. I also host my code.
EDIT
just in case you wonder my code, here my index.php file
<html>
<head>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="//www.google.com/jsapi"></script>
<script type="text/javascript" src="https://apis.google.com/js/client.js?onload=onJSClientLoad"></script>
</head>
</body>
<div id="login-container" class="pre-auth">This application requires access to your YouTube account.
Please authorize to continue.
</div>
<div class="post-auth">
<div id="message"></div>
<div id="chart"></div>
<div>Choose a Video:</div>
<ul id="video-list"></ul>
</div>
<body>
`
Did I do something wrong???
thanks in advance!
Make sure that the OAuth ClientId you're using matches with the URI Origin you've specified in your Google Dev Console. For example you have this Client ID 1234567890 for the URI origin http://www.mysimplesite.com in GDC, that ClientID will only work on that domain.
If you want that Client ID to work on http://www.myawesomesite.com as well, you'd have to add it on the list of URIs. If you use it in a domain not specified in "Authorised Javascript origins", you will have origin mismatch error.
Note: Make sure you've enabled Youtube API as well.
For additional reference you may check this SO thread as well.
I have found my solution myself. I just change immediate: true to immediate: false on checkAuth function. I dont know why, but it works.
I'm trying to make use of Google's Core Reporting API. I got it working with the demo they give you. But now I want to take the code and put it within my own code.
I use AngularJS and PHP mainly. I try it to keep it as basic as possible, the only thing I changed is that I use partial views instead of whole HTML pages.
This is the partial view as I have it right now:
<button id="auth-button" hidden>Authorize</button>
<h1>Hello Analytics</h1>
<script type="text/javascript" src="../js/plugins/analytics.js"></script>
<script type="text/javascript" src="https://apis.google.com/js/client.js? onload=authorize"></script>
This is the demo Google gives to give an idea of how the API works:
<html>
<head>
<meta charset="utf-8">
<title>Hello Analytics - A quickstart guide for JavaScript</title>
</head>
<body>
<button id="auth-button" hidden>Authorize</button>
<h1>Hello Analytics</h1>
<div id="query-output"></div>
<!-- <textarea cols="80" rows="20" id="query-output"></textarea> -->
<script src="js/analytics.js"></script>
<script src="https://apis.google.com/js/client.js?onload=authorize"></script>
</body>
</html>
It takes a while for the page to load, and when it does, it only shows the text "Hello Analytics". When I inspect the page it gives an "Uncaught SyntaxError: Unexpected token <" error. With no further information of where exactly the error occured.
Does anybody know what causes this?
That error typically means that you are trying to load a JavaScript program but the server is delivering an HTML document instead.
Check the Network tab in your developer tools. Look at the responses you are getting. Find one that gives you an HTML document when you want a JavaScript program.
It's probably caused by you putting the wrong URL somewhere.
Recently I develop a web application which has worked very well, than I move this web application into 000webhost.com and my domain is ks-hospitaldemo.tk. Now my problem is after upload my web application into free server my all JavaScript and jQuery are not worked. I use the following code ::
<footer id="indexFooter">
</footer>
</div>
<script type="text/javascript" src="_javascript/jquery-1.9.1.js"></script>
<script type="text/javascript" src="_javascript/menuBar.js"></script>
All my JavaScript file is placed into _javasSript folder in server.
Then I check my code and find some code which is not done by me, probably hosting server. This code is given below::
<!--//--><script type="text/javascript" src="http://stats.hosting24.com/count.php">
</script> <!--//--><script language="javascript">
<!--bmi_SafeAddOnload(bmi_load,"bmi_orig_img",0);//-->
</script>
Please help me to find my problem.
The new web server is using case-sensitive file lookups. The exact name of the directory is _javaScript but it's referenced in the HTML as _javascript. Use the exact name to fix the problem:
<script type="text/javascript" src="_javaScript/jquery-1.9.1.js"></script>
<script type="text/javascript" src="_javaScript/menuBar.js"></script>
You may want to check the permissions on the _javascript folder. Also, 000 Webhost is known to have problems with Google Analytics. If you have a Google Analytics code on your site, try disabling it.
Some proxy / CDN services / providers inject or transform code in your .html pages to "speed up" data transfer. I had the same problem when accessing my website from a smartphone.
The solution that worked for me was to append Cache-control in the head of the page:
<meta http-equiv="Cache-control" content="no-transform"/>
I've created a button whose function is to hide itself when clicked. But, it isn't working.Here's the code :
<html>
<body>
<button id="b">HIDE</button>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#b").click(function(){
$("#b").hide();
});
});
</script>
</body>
</head>
What's wrong with it?
That should work, but I'd strongly suggest you research the HTML for a valid document, i.e. </head> must appear before <body>.
Along with what alex said, it's possible that Chrome is blocking your request to the CDN-hosted jQuery. You can either give that domain valid permissions in manifest.json or simply download the copy of jQuery and store it locally.
If you are using SSL for your site, then you should serve your javascript/js file via https, else chrome will block it and causing your site's feature that is using that script not working.
I noticed that you are using http to call jquery from google cdn. May be it is causing that problem.