Google recaptcha verification? - javascript

Hello when i Submit a Form Sometimes i got a Google captcha verification failed.
is there a way to not have this error or Skip Recaptcha or make it alway's True ?
Html :
<input type="hidden" name="g-recaptcha-response" id="g-recaptcha-response" value="03AOLTBLR2tBWnlAhqZlqeMmv3PY_T-cezG63SPaDcC_VcWMBkSt60VvSkHjogTxtAoRhRiPoEglg6whL8vIzUkXEYVKd3Blcyw1TQjMMQmYTbL9u0bwmcJ2utefrU3aMU8hx8Z9MMYOAWPwELIM7RRLybXVVr0T10UeYoBAg-xQffwyTqFo9t_JvcfSHeFkqfoAAodv35I4dBdTP-qtte9BQXR_WLT5F0y53dY0IHU1l3N8wjWYQUkr2ybQcH0gs0C_j4xi4lHbkGU8gJXc-XHBxkIeR56_IsCZ-nUzlTdzCLE968JoCUBI-IXA1DSavS_mBPBONUmfrxFn5guR5gQA2Zfbw0RQLCWe1mRM5j8J7WcL77VHwH6tBWUUPjCXDLAwRFsIhB66OWGG1x2nWE8p5xtt21Gsw93wcsDL3e5qNWQurOd9oHS6_UTeE3_FcFID7Ijld6kXIVCNA97o0oKVOwiGNOiwPdv6wvQZZnAiYb-QX2B2TzuWbvYHf22gBj2t_HK2ozhsXy4ujmoY0XOSlmCsbemu5Y0A">
this is the Form Id html :
<form name="agxthird" id="agxthird" action="" method="post" autocomplete="off">
is there a way to Aviod this on Jquery or Js

If you are the developer, you can add in a flag to - for example - load the recaptcha unless there is a testing parameter in the URL or something like that. Although this is not advised if this code is in production.
Also, try a different browser and ensure you aren't using any automation/controlling software like Puppeteer.
Otherwise there's not much you can do.

Related

Unable to close new window after using mailto in javascript

I'm trying to send invoke email when button is clicked and its working fine but extra window is getting opened during the process and i'm unable to close it even though I have tried close method. I have tried in IE 10 and IE 11 and its not working.
Below is the code
<html>
<head>
<script type='text/javascript'>
function sendMail(){
var wi = window.open('mailto:someone#example.com?subject=' + encodeURIComponent(document.getElementById("metric").value));
wi.close();
}
</script>
</head>
<body>
<h4>Send e-mail to committee with below subject:</h4>
<form action="javascript:sendMail()" method="post" enctype="text/plain">
<select id="metric">
<option value="test1">test1</option>
<option value="test2">test2</option>
</select>
<br><br>
<input type="submit" value="Send">
<p></p>
</form>
</body>
</html>
I'm going to go ahead and say this isn't how you'd go about it.
A mailto: link opens the user's default email client. If you remove the attempt to close the window in your script, you'll see this happen. But to do anything useful, you'd have to fill out the mail along with sender etc.
So the user will need to trigger the actual send in their email client.
What you would typically do is send the request to the server, and have the server use the SMTP service (pretty much all of them have it now) to put together and send the email out. It's simple to do, how exactly it works depends on what server you are going to be hosting your solution on.
To my knowledge there is no pure javascript/server-less way to do this. If you think about it, this makes sense; what would prevent somebody from putting a script in a webpage that sends out a thousand emails based on something you collected from the webpage?

How to change a form's target to in-app browser in Ionic?

I am using the Ionic framework to build an android app.
I have a form as such:
<form action='https://secure.payu.in/_payment' method="POST" target="...">
......
</form>
Is there a way to change the form's target to an instance of a cordova in-app broswer?
I have tried "_blank" but that disconnects my app from the web-view.
The only solution I could find thus far was making use of iframes.
I give the name of an iframe in the target attribute in the form.
<form action='https://secure.payu.in/_payment' method="POST" target="iframe">
......
</form>
<iframe name="iframe"></iframe>
However this causes concerns of security.

How to get Google results into our webpage without SAME ORIGIN POLICY

We have own form in our webpage. We want to show google(www.google.com/scholar) results into our webpage. We tried
jQuery, Ajax
HTML framing (iFrame, frameset)
and all of these have SAMEORIGIN issues.
We also tried using a new tab and found it has same problem here . All these solutions seem to work only with http://www.google.com/custom and no other google websites.
Is there any alternative to do so?
Google prevents you from doing this. You could set up some server side code to scrape the results but this would almost definitely be blocked by Google. If this suits your needs you can create a form that submits your search to that page and opens it in a new tab like so:
<form action="http://scholar.google.co.uk/scholar" method="get" target="_blank">
<input type="text" name="q">
<input type="submit" value="Search">
</form>
Live example here: http://jsfiddle.net/v8qG8/
Update:
I mentioned that Google would block the scraping of its services, however I just found the third party library which does that. Not sure on Google's opinion on it though. http://www.icir.org/christian/scholar.html
I answer it myself. There are no solutions so far.
You may also want to look at Google's custom API. You can get 100 free searches a day and then you pay $5 / 1000 search after that. If you cache the results or do low volume this may work for you.
Search API: https://developers.google.com/custom-search/json-api/v1/overview
All Google API's: https://developers.google.com/apis-explorer/#p/

Will I get consistent behavior when I POST to a cross-domain with javascript when using "document.forms[0].submit();"?

I understand that there are security issues (SOP, CORS, etc) with Javascript and cross-site requests with AJAX, however I'm submitting a form from one domain and POSTing it to another. I don't think SOP applies, but correct me if I'm wrong.
The main reason I'm doing cross domain POSTs is because Base64 encoding the data in a GET string would end up with large URLs that may contain sensitive data.
Is it generally acceptable (in mobile and desktop browsers) to use the following script?
Will mobile browsers or any other browser get upset if I follow this redirect pattern?
code
<form action="https://MyotherDomain.com" method="post">
<input type="hidden" name="UIDPName" value="#Model.UIDPName">
<input type="submit" value="Redirect" />
</form>
<script>
window.onload = function(){
document.forms[0].submit();
}
</script>
I saw and use this exact pattern on production-level, enterprise websites. We use it to transfer data being sent via POST to a page of the user-facing site to another one being embedded via iframe.
Here is our exact implementation, where example.com is the domain of the second website:
<form class="js-forwarding-form" target="forwarding-frame" action="http://example.com" method="post">
<input type="hidden" name="example" value="example">
</form>
<iframe name="forwarding-frame" src=""></iframe>
$(document).ready(function() {
$('.js-forwarding-form').submit();
});
The <body onload="document.forms[0].submit()"> version works the same.
There is no reason for it not to work because CORS and SOP only apply to requests started in JavaScript (XMLHttpRequest, etc) whereas here you're only triggering the submit of an HTML form. It has been tested and works on all major desktop browsers (not tested under IE8) as well as mobile browsers.
As for whether this is acceptable or not, well, you just have to remind yourself that this data transfer is done in plain sight on the browser. All values sent this way should be sanitized/validated like if it was user input.

Automatic login script for a website on windows machine?

I saw some guy had a file (I guess a batch file). On clicking of the batch file he was able to log in to multiple sites. (Perhaps it was done using VB.)
I looked for such a script on Google but didn't find anything useful.
I know a bit of C++ and UNIX (also some HTML and JavaScript). I don't know if it can be done on a windows machine using these languages, but even if it could be done I think it would be difficult compared to VB or C## or some other high level languages.
I learned how to open multiple sites using basic windows batch commands enclosed in a batch file like:
start http://www.gmail.com
start http://stackoverflow.com
But still I can't figure out how actually clicking on the batch file would help me to log in to the sites without even typing the username and password.
Do I need to start learning Visual Basic, .NET, or windows batch programming to do this?
One more thing: can I also use it to log in to remote desktops?
From the term "automatic login" I suppose security (password protection) is not of key importance here.
The guidelines for solution could be to use a JavaScript bookmark (idea borrowed form a nice game published on M&M's DK site).
The idea is to create a javascript file and store it locally. It should do the login data entering depending on current site address. Just an example using jQuery:
// dont forget to include jQuery code
// preferably with .noConflict() in order not to break the site scripts
if (window.location.indexOf("mail.google.com") > -1) {
// Lets login to Gmail
jQuery("#Email").val("youremail#gmail.com");
jQuery("#Passwd").val("superSecretPassowrd");
jQuery("#gaia_loginform").submit();
}
Now save this as say login.js
Then create a bookmark (in any browser) with this (as an) url:
javascript:document.write("<script type='text/javascript' src='file:///path/to/login.js'></script>");
Now when you go to Gmail and click this bookmark you will get automatically logged in by your script.
Multiply the code blocks in your script, to add more sites in the similar manner. You could even combine it with window.open(...) functionality to open more sites, but that may get the script inclusion more complicated.
Note: This only illustrates an idea and needs lots of further work, it's not a complete solution.
The code below does just that. The below is a working example to log into a game. I made a similar file to log in into Yahoo and a kurzweilai.net forum.
Just copy the login form from any webpage's source code. Add value= "your user name" and value = "your password". Normally the -input- elements in the source code do not have the value attribute, and sometime, you will see something like that: value=""
Save the file as a html on a local machine double click it, or make a bat/cmd file to launch and close them as required.
<!doctype html>
<!-- saved from url=(0014)about:internet -->
<html>
<title>Ikariam Autologin</title>
</head>
<body>
<form id="loginForm" name="loginForm" method="post" action="http://s666.en.ikariam.com/index.php?action=loginAvatar&function=login">
<select name="uni_url" id="logServer" class="validate[required]">
<option class="" value="s666.en.ikariam.com" fbUrl="" cookieName="" >
Test_en
</option>
</select>
<input id="loginName" name="name" type="text" value="PlayersName" class="" />
<input id="loginPassword" name="password" type="password" value="examplepassword" class="" />
<input type="hidden" id="loginKid" name="kid" value=""/>
</form>
<script>document.loginForm.submit();</script>
</body></html>
Note that -script- is just -script-. I found there is no need to specify that is is JavaScript. It works anyway. I also found out that a bare-bones version that contains just two input filds: userName and password also work. But I left a hidded input field etc. just in case. Yahoo mail has a lot of hidden fields. Some are to do with password encryption, and it counts login attempts.
Security warnings and other staff, like Mark of the Web to make it work smoothly in IE are explained here:
http://happy-snail.webs.com/autologinintogames.htm
I used #qwertyjones's answer to automate logging into Oracle Agile with a public password.
I saved the login page as index.html, edited all the href= and action= fields to have the full URL to the Agile server.
The key <form> line needed to change from
<form autocomplete="off" name="MainForm" method="POST"
action="j_security_check"
onsubmit="return false;" target="_top">
to
<form autocomplete="off" name="MainForm" method="POST"
action="http://my.company.com:7001/Agile/default/j_security_check"
onsubmit="return false;" target="_top">
I also added this snippet to the end of the <body>
<script>
function checkCookiesEnabled(){ return true; }
document.MainForm.j_username.value = "joeuser";
document.MainForm.j_password.value = "abcdef";
submitLoginForm();
</script>
I had to disable the cookie check by redefining the function that did the check, because I was hosting this from XAMPP and I didn't want to deal with it. The submitLoginForm() call was inspired by inspecting the keyPressEvent() function.
You can use Autohotkey, download it from: http://ahkscript.org/download/
After the installation, if you want to open Gmail website when you press Alt+g, you can do something like this:
!g::
Run www.gmail.com
return
Further reference: Hotkeys (Mouse, Joystick and Keyboard Shortcuts)
Well, its true that we can use Vb Script for what you intended to do.
We can open an application through the code like Internet Explorer. We can navigate to site you intend for. Later we can check the element names of Text Boxes which require username and password; can set then and then Login. It works fine all of using code.
No manual interaction with the website. And eventually you will end up signing in by just double clicking the file.
To get you started :
Set objIE = CreateObject("InternetExplorer.Application")
Call objIE.Navigate("https://gmail.com")
This will open an instance of internet explore and navigate to gmail.
Rest you can learn and apply.

Categories