A-A+

Tampermonkey 自动登陆login.oracle.com/mysso/signon.jsp 脚本

2019年05月30日 11:33 学习笔记 暂无评论 阅读 27 views 次

【注意:此文章为博主原创文章!转载需注意,请带原文链接,至少也要是txt格式!】

效果图片:

自动登录Oracle官网,方便下载Oracle的各种产品

首先我们先看一下https://login.oracle.com/mysso/signon.jsp登陆页面的html源码。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<h2> Oracle 帐户登录
</h2>
<form method="post" action="/oam/server/sso/auth_cred_submit" name="LoginForm" autocomplete="off">
<ul>
<input type="hidden" name="v" value="v1.4">
<input type="hidden" name="request_id" value="5803170980593311289">
<input type="hidden" name="OAM_REQ" value="VERSION_4~fvvdlFpgvUu5qF%2bIOlcphcef%2fQeF1%2bUVh5KGfLcm4c%2bNa3sVpBPizjUGi7LaPKV7qg9HyDXZie8QtF6IfWs70mzBybZoKZW0Too0ssH2vw4h93OsjPIzvF0vcbKsVDFd6MLjHWasiVgcXU9PBsqnaGI%2fVOdUT%2b6fbGdqnjPELtt9PPBEBTR7y2rKWdPpxtYfDGWpa6elg%2bAZ0D17p8cxfyGNaHIWY6DOK%2bjFThsuE5t9H92yJ2zP8gPIUhBqcRZu%2fXuIY9R%2fMaa7WVtX4mRIaf8chplvXOoFsIj5VSwJfwj0SiaEOrCNAG4pUEJOPX9vLVaj1GQ8jkZsQkSyHAW%2fyLVMrJcwgo4jzVRn%2bOvq6hoOLQL6NMAaBuV2uidL5RsUs419yCpX04JhvkX2HeZRY8fZgj5eJMB8Tlmp6Ry1SGZOe0FYNseEDDqdGJuL1SqhDmRjO3RAU7GffOmdeZ9hLyw6W%2fulkPDWj%2b2Hi1mY%2fh9mGcFJNrQAAeLuQVb9U8r4uzblkB8kfwwTZFvK051q1Q2e6un1BQNH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jMYX8Il2rM11WiCrtVM44IWi%2fb%2bBKSq6cyVqVyclVVj0%2fRvzWQK7BLq9AjzH9M%2f%2fSpCII0koYyMiArUMD8Tvx7btIH8whmIfsqjY8fIpM7AA6XEAncqLLQvuONVspnGInNNGkQ1LBzlcZXNe5C5MI8BbST0o72KrErMy6oagvSIJE64SeDFBS4mQF%2bDhRmYGEOSIvF%2bld9Z72QtxMbnaQqK5%2fqfLTlEki4gL8PaY5wcWNUGtrCxi0hw5ojwa%2f%2bZiMarDVteGyPVLkwACRWoUV9OL6V2zDmFKYBIvtaKTj2k98bLnPJ887Q6cLODlgRyYu6Ipmr0PT1S306BF54VjHLZGLKINhpwp0AHR7e0sc7CxSJFnZ9ZEUhsSRySI%2b8KHzFo%2b%2bb8uj%2bLgjhgYMxp1CGS0HH6gFkyvec3%2bZa7kfCgG%2b72ubQaWVHX4gY8e%2fjKXlPW5nKXkFuJeERof6TZCnIzl8mGuyzEZH%2bpuBuvi%2bkL%2fbDQvBLqAp%2ffdOiDFAiivWScjiq3iBqhzcqZAS7nudYFgvSRn9qA%2foqm0amezkl5%2bO3pphQ%2bTzO0fwHN1QF%2bQlvmOKo7JW%2fHyU5YMnOEBtsRrRA78phcE5jDNRH4vH1QLhkH1fXXlcZjx0kdtXKUUOYMjkBf%2bBaOqpAaZ%2fWopZIlRAMZXg33sMHANEvNCOkHq7YcwFdEmyIjYaTgE7yyTOQ%3d%3d">
<input type="hidden" name="locale" value="">
<li>
<div class="cb41w2">
<label for="sso_username"> 用户名
<span class="hideFromScreen">
<span id="readerunameerrormsg" class="error-show"></span>
<span id="readerunamerequired" class="error-hide"> 错误:
请输入您的用户名和密码
</span>
</span>
</label>
<input type="text" id="sso_username" name="ssousername" title=" 请输入用户名
" maxlength="80" value="" tabindex="1"/>
<span class="cb41w5">
<span class="cb41w6">
<span role="tooltip" class="cb41noteshoverbtn" tabindex="5" title=" 用户名帮助
"><span class="cb41notescontent"> 用户名通常是您的电子邮件地址。
<a href=" https://profile.oracle.com/myprofile/account/forgot-username.jspx
" tabindex="6" target="_blank" rel="noopener noreferrer"> 忘记用户名?
</a></span></span>
</span>
</span>
</div>
</li>
<li>
<div class="cb41w3">
<label for="ssopassword"> 密码
<span class="hideFromScreen">
<span id="readerpwderrormsg" class="error-show"></span>
<span id="readerpwdrequired" class="error-hide"> 错误:
请输入您的用户名和密码
</span>
</span>
</label>
<input type="password" id="ssopassword" name="password" title=" 请输入密码
" value="" maxlength="255" tabindex="2"/>
<span class="cb41w5">
<span class="cb41w6">
<span role="tooltip" class="cb41noteshoverbtn" tabindex="7" title=" 密码帮助
"><span class="cb41notescontent"><a href=" https://profile.oracle.com/myprofile/account/forgot-password.jspx
" tabindex="8" target="_blank" rel="noopener noreferrer"> 忘记密码?
</a></span></span>
</span>
</span>
</div>
</li>
</ul>
<div class="cb41w7">
<span id="required" class="error-hide">
<div class="cb41error">
请输入您的用户名和密码
</div>
</span>
</div>
<div class="cb41w4">
<span><input type="button" value=" 登录
" tabindex="3" title=" 请单击此处登录
" onclick="doLogin(document.LoginForm);"/></span>
</div>
<div class="need-help">
<a href=" https://www.oracle.com/corporate/contact/help.html
" tabindex="4" target="_blank" rel="noopener noreferrer"> 需要帮助?
</a>
</div>
</form>

自动登录Oracle官网,方便下载Oracle的各种产品,比如:Java JDK,Weblogic等

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// ==UserScript==
// @name         Oracle download auto login
// @namespace    http://gv7.me/articles/2019/oracle-download-auto-login-tampermonkey-script/
// @version      0.1
// @description  自动登录Oracle官网,方便下载Oracle的各种产品,比如:Java JDK,Weblogic等
// @author       c0ny1
// @match        https://login.oracle.com/mysso/signon.jsp
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
    //是否自动点击登录
    var is_auto_login = true;
 
     //获取随机数
     function random(lower, upper) {
        return Math.floor(Math.random() * (upper - lower)) + lower;
    }
    //通过标签名,属性名和属性值来定位元素
    function getTargetByTAV(t_tag,t_attr,t_value){
        var target = document.getElementsByTagName(t_tag);
        for(var i=0;i <target.length;i++){
            if(target[i].getAttribute(t_attr) == t_value){
                return target[i];
            }
        }
    }
 
 
   //存储账号密码
    var users = new Array(3);
    var passs = new Array(3);
    users[0] = "1772885836@qq.com";
    passs[0] = "OracleTest1234";
    users[1] = "541509124@qq.com";
    passs[1] = "LR4ever.1314";
    users[2] = "2696671285@qq.com";
    passs[2] = "Oracle123";
 
    var sso_username = document.getElementById("sso_username");
    var sso_password = document.getElementById("ssopassword");
    var i = random(0,users.length - 1);
    sso_username.value = users[i];
    sso_password.value = passs[i];
 
    if(is_auto_login){
        var btn_login = getTargetByTAV("input","tabindex",3);
        btn_login.click();
    }
 
})();

文章原创,脚本不是。

布施恩德可便相知重

微信扫一扫打赏

支付宝扫一扫打赏

×

给我留言