…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
"].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)});
--------------------------------------------------------------------------------
/static/layui-v2.2.45/layui/lay/modules/laytpl.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.45 MIT License By http://www.layui.com */
2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)});
--------------------------------------------------------------------------------
/static/layui-v2.2.45/layui/lay/modules/tree.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.45 MIT License By http://www.layui.com */
2 | ;layui.define("jquery",function(e){"use strict";var o=layui.$,a=layui.hint(),i="layui-tree-enter",r=function(e){this.options=e},t={arrow:["",""],checkbox:["",""],radio:["",""],branch:["",""],leaf:""};r.prototype.init=function(e){var o=this;e.addClass("layui-box layui-tree"),o.options.skin&&e.addClass("layui-tree-skin-"+o.options.skin),o.tree(e),o.on(e)},r.prototype.tree=function(e,a){var i=this,r=i.options,n=a||r.nodes;layui.each(n,function(a,n){var l=n.children&&n.children.length>0,c=o(''),s=o(["",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),""].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o(''));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})});
--------------------------------------------------------------------------------
/static/layui-v2.2.45/layui/lay/modules/util.js:
--------------------------------------------------------------------------------
1 | /** layui-v2.2.45 MIT License By http://www.layui.com */
2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['',e.bar1?'- '+c[0]+"
":"",e.bar2?'- '+c[1]+"
":"",'- '+c[2]+"
","
"].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o0;r--)if("interactive"===o[r].readyState){e=o[r].src;break}return e||o[n].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),i=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},a="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};n.prototype.cache=o,n.prototype.define=function(e,t){var n=this,r="function"==typeof e,i=function(){return"function"==typeof t&&t(function(e,t){layui[e]=t,o.status[e]=!0}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?i.call(n):(n.use(e,i),n)},n.prototype.use=function(e,n,l){function s(e,t){var n="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||n.test((e.currentTarget||e.srcElement).readyState))&&(o.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void(o.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?p.use(e.slice(1),n,l):"function"==typeof n&&n.apply(layui,l)}var p=this,y=o.dir=o.dir?o.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(p.each(e,function(t,o){"jquery"===o&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],o.host=o.host||(y.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),p;if(o.modules[f])!function g(){return++m>1e3*o.timeout/4?i(f+" is not a valid module"):void("string"==typeof o.modules[f]&&o.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?y+"lay/":/^\{\/\}/.test(p.modules[f])?"":o.base||"")+(p.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=o.version===!0?o.v||(new Date).getTime():o.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||a?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),o.modules[f]=h}return p},n.prototype.getStyle=function(t,o){var n=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return n[n.getPropertyValue?"getPropertyValue":"getAttribute"](o)},n.prototype.link=function(e,n,r){var a=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof n&&(r=n);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,p=0;return u.rel="stylesheet",u.href=e+(o.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof n?a:(function y(){return++p>1e3*o.timeout/100?i(e+" timeout"):void(1989===parseInt(a.getStyle(t.getElementById(c),"width"))?function(){n()}():setTimeout(y,100))}(),a)},n.prototype.addcss=function(e,t,n){return layui.link(o.dir+"css/"+e,t,n)},n.prototype.img=function(e,t,o){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,o(e)}))},n.prototype.config=function(e){e=e||{};for(var t in e)o[t]=e[t];return this},n.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),n.prototype.extend=function(e){var t=this;e=e||{};for(var o in e)t[o]||t.modules[o]?i("模块名 "+o+" 已被占用"):t.modules[o]=e[o];return t},n.prototype.router=function(e){var t=this,e=e||location.hash,o={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(e=e.replace(/^#\//,"").replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),o.search[t[0]]=t[1]}():o.path.push(t)}),o):o},n.prototype.data=function(t,o){if(t=t||"layui",e.JSON&&e.JSON.parse){if(null===o)return delete localStorage[t];o="object"==typeof o?o:{key:o};try{var n=JSON.parse(localStorage[t])}catch(r){var n={}}return"value"in o&&(n[o.key]=o.value),o.remove&&delete n[o.key],localStorage[t]=JSON.stringify(n),o.key?n[o.key]:n}},n.prototype.device=function(t){var o=navigator.userAgent.toLowerCase(),n=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(o.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(o)?"windows":/linux/.test(o)?"linux":/iphone|ipod|ipad|ios/.test(o)?"ios":/mac/.test(o)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((o.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:n("micromessenger")};return t&&!r[t]&&(r[t]=n(t)),r.android=/android/.test(o),r.ios="ios"===r.os,r},n.prototype.hint=function(){return{error:i}},n.prototype.each=function(e,t){var o,n=this;if("function"!=typeof t)return n;if(e=e||[],e.constructor===Object){for(o in e)if(t.call(e[o],o,e[o]))break}else for(o=0;oi?1:r
2 | /* 宫格 */
3 | .site-doc-icon{margin-bottom: 50px; font-size: 0;color: #393D49;}
4 | .site-doc-icon li{display: inline-block; vertical-align: middle; width: 127px; line-height: 40px; padding: 30px; margin-right: -1px; margin-bottom: -1px; border: 1px solid #e2e2e2; font-size: 14px; text-align: center; color: #00c1de; transition: all .3s; -webkit-transition: all .3s;}
5 | .site-doc-icon li .layui-icon{display: inline-block; font-size: 36px;}
6 |
7 | .site-doc-icon li .fontclass{display: none;}
8 | .site-doc-icon li:hover{background-color: #F0F0F0; color: #00c1de;}
9 | .site-doc-icon li a:hover{color: #00c1de;}
10 |
11 | @font-face {font-family: "iconfont";
12 | src: url('../static/cm-font/iconfont.eot'); /* IE9*/
13 | src: url('../static/cm-font/iconfont.eot#iefix') format('embedded-opentype'), /* IE6-IE8 */
14 | url('../static/cm-font/iconfont.woff') format('woff'), /* chrome, firefox */
15 | url('../static/cm-font/iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
16 | url('../static/cm-font/iconfont.svg#iconfont') format('svg'); /* iOS 4.1- */
17 | }
18 |
19 | .iconfont {
20 | font-family:"iconfont" !important;
21 | font-size:45px;
22 | font-style:normal;
23 | -webkit-font-smoothing: antialiased;
24 | -webkit-text-stroke-width: 0.2px;
25 | -moz-osx-font-smoothing: grayscale;
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 |
--------------------------------------------------------------------------------
/templates/feis/asysi.html:
--------------------------------------------------------------------------------
1 |
19 |
20 |
21 |
53 |
--------------------------------------------------------------------------------
/templates/feis/asysi_result.html:
--------------------------------------------------------------------------------
1 | {{ rep_result['error'] }}
2 | {% if rep_result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
详细信息
20 | {% if rep_result['msg']['public_key']=='RSA' %}
21 |
22 |
密钥类型
23 |
{{ rep_result['msg']['public_key'] }}
24 |
25 |
26 |
密钥强度
27 |
{{ rep_result['msg']['public_key_size'] }}
28 |
29 |
30 |
PN(e)
31 |
{{ rep_result['msg']['public_key_e'] }}
32 |
33 |
34 |
PN(n)
35 |
36 |
{{ rep_result['msg']['public_key_n'] }}
37 |
38 |
39 |
40 |
DER值
41 |
42 |
{{ rep_result['msg']['public_key_der'] }}
43 |
44 |
45 | {% elif rep_result['msg']['public_key']=='DSA' %}
46 |
47 |
密钥类型
48 |
{{ rep_result['msg']['public_key'] }}
49 |
50 |
51 |
密钥强度
52 |
{{ rep_result['msg']['public_key_size'] }}
53 |
54 |
55 |
PN(y)
56 |
57 |
{{ rep_result['msg']['public_key_y'] }}
58 |
59 |
60 |
61 |
DER值
62 |
63 |
{{ rep_result['msg']['public_key_der'] }}
64 |
65 |
66 | {% elif rep_result['msg']['public_key']=='ECDSA' %}
67 |
68 |
密钥类型
69 |
{{ rep_result['msg']['public_key'] }}
70 |
71 |
72 |
密钥强度
73 |
{{ rep_result['msg']['public_key_size'] }}
74 |
75 |
76 |
PN(x)
77 |
78 |
{{ rep_result['msg']['public_key_x'] }}
79 |
80 |
81 |
82 |
PN(y)
83 |
84 |
{{ rep_result['msg']['public_key_y'] }}
85 |
86 |
87 |
88 |
DER值
89 |
90 |
{{ rep_result['msg']['public_key_der'] }}
91 |
92 |
93 | {% endif %}
94 |
95 |
96 |
97 |
98 | {% else %}
99 |
104 |
105 |
106 |
{{ rep_result['msg'] }}
107 |
108 |
109 | {% endif %}
110 |
111 |
122 |
--------------------------------------------------------------------------------
/templates/feis/jiajiemi.html:
--------------------------------------------------------------------------------
1 |
26 |
27 |
61 |
--------------------------------------------------------------------------------
/templates/feis/jiaoyan.html:
--------------------------------------------------------------------------------
1 |
2 |
30 |
31 |
32 |
37 |
38 |
71 |
--------------------------------------------------------------------------------
/templates/feis/jiaoyan_result.html:
--------------------------------------------------------------------------------
1 | {{ jy_result['error'] }}
2 |
7 |
8 |
9 | {% if jy_result['error'] %}
10 |
{{ jy_result['msg'] }}
11 | {% else %}
12 |
{{ jy_result['msg'] }}
13 | {% endif %}
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/templates/feis/priv_xiugai.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/templates/feis/priv_xiugai_result.html:
--------------------------------------------------------------------------------
1 | {{ key_reuslt['error'] }}
2 | {% if key_reuslt['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
私钥信息
20 |
21 |
新密码
22 |
{{ key_reuslt['new_pass'] }}
23 |
24 |
25 |
明文
26 |
27 |
28 |
{{ key_reuslt['new_key'] }}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | {% else %}
37 |
42 |
43 |
44 |
{{ key_reuslt['msg'] }}
45 |
46 |
47 | {% endif %}
48 |
49 |
--------------------------------------------------------------------------------
/templates/feis/pub_priv_double.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/templates/feis/pub_priv_double_result.html:
--------------------------------------------------------------------------------
1 | {{ result['error'] }}
2 | {% if result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
20 |
公钥明文
21 |
22 |
23 |
{{ result['pub_key'] }}
24 |
25 |
26 |
27 |
28 |
私钥明文
29 |
30 |
31 |
{{ result['priv_key'] }}
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | {% else %}
40 |
45 |
46 |
47 |
{{ result['msg'] }}
48 |
49 |
50 | {% endif %}
51 |
52 |
--------------------------------------------------------------------------------
/templates/feis/tiqu.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
56 |
--------------------------------------------------------------------------------
/templates/feis/tiqu_result.html:
--------------------------------------------------------------------------------
1 | {{ tiqu_result['error'] }}
2 | {% if tiqu_result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
公钥
20 |
21 |
PEM值
22 |
23 |
{{ tiqu_result['public_key_pem'] }}
24 |
25 |
26 |
27 |
DER值
28 |
29 |
{{ tiqu_result['public_key_der'] }}
30 |
31 |
32 |
33 |
34 |
35 |
36 | {% else %}
37 |
42 |
43 |
44 |
{{ tiqu_result['msg'] }}
45 |
46 |
47 | {% endif %}
48 |
49 |
60 |
--------------------------------------------------------------------------------
/templates/gmssl.html:
--------------------------------------------------------------------------------
1 | 暂无此功能!
--------------------------------------------------------------------------------
/templates/logs.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wossl33/wossl/e0e55fe87235ad02ea67f8797cf4f6469d3bf78d/templates/logs.html
--------------------------------------------------------------------------------
/templates/ssl/ssl_deep.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 | 获取服务端支持的协议/加密套件、是否存在SSL常见漏洞、证书及证书链等。
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/templates/ssl/ssl_suites.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 | 检测服务端支持的加密协议,如TLS1.0,SSL3.0等;以及支持的加密套件,如TLS_RSA_WITH_AES_256_CBC_SHA256。
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/templates/ssl/ssl_woshou.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
25 |
26 |
27 |
28 |
29 | 模拟Wireshark对SSL握手过程抓包,对SSL握手过程进行分析,快速定位问题。
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/templates/ssl/vuls_check.html:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
27 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/templates/tools/aes_cipher.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/templates/tools/cer_check.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/templates/tools/cert_create_result.html:
--------------------------------------------------------------------------------
1 | {{ result['error'] }}
2 | {% if result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
20 |
证书明文
21 |
22 |
23 |
{{ result['cert'] }}
24 |
25 |
26 |
27 |
28 |
私钥明文
29 |
30 |
31 |
{{ result['priv_key'] }}
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | {% else %}
40 |
45 |
46 |
47 |
{{ result['msg'] }}
48 |
49 |
50 | {% endif %}
51 |
52 |
--------------------------------------------------------------------------------
/templates/tools/cipher_result.html:
--------------------------------------------------------------------------------
1 | {{ aes_result['error'] }}
2 | {% if aes_result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
{{ flag }}
20 |
26 |
27 |
28 |
29 |
30 | {% else %}
31 |
36 |
37 |
38 |
{{ aes_result['msg'] }}
39 |
40 |
41 | {% endif %}
42 |
43 |
--------------------------------------------------------------------------------
/templates/tools/csr_check.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/templates/tools/csr_create_result.html:
--------------------------------------------------------------------------------
1 | {{ result['error'] }}
2 | {% if result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
20 |
CSR明文
21 |
22 |
23 |
{{ result['csr'] }}
24 |
25 |
26 |
27 |
28 |
私钥明文
29 |
30 |
31 |
{{ result['priv_key'] }}
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 | {% else %}
40 |
45 |
46 |
47 |
{{ result['msg'] }}
48 |
49 |
50 | {% endif %}
51 |
52 |
--------------------------------------------------------------------------------
/templates/tools/des_cipher.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/templates/tools/hash.html:
--------------------------------------------------------------------------------
1 |
37 |
42 |
43 |
--------------------------------------------------------------------------------
/templates/tools/hash_result.html:
--------------------------------------------------------------------------------
1 | {{ hash_result['error'] }}
2 | {% if hash_result['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
{{ flag }}
20 |
26 |
27 |
28 |
29 |
30 | {% else %}
31 |
36 |
37 |
38 |
{{ hash_result['msg'] }}
39 |
40 |
41 | {% endif %}
42 |
43 |
--------------------------------------------------------------------------------
/templates/tools/pre_cer.html:
--------------------------------------------------------------------------------
1 |
26 |
27 |
--------------------------------------------------------------------------------
/templates/tools/pre_cer_result.html:
--------------------------------------------------------------------------------
1 | {{ key_reuslt['error'] }}
2 | {% if key_reuslt['error'] %}
3 |
15 |
16 |
17 |
18 |
19 |
私钥信息
20 |
21 |
密码
22 |
{{ key_reuslt['msg']['key'] }}
23 |
24 |
25 |
明文
26 |
27 |
28 |
{{ key_reuslt['msg']['key_string'] }}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | {% else %}
37 |
42 |
43 |
44 |
{{ key_reuslt['msg'] }}
45 |
46 |
47 | {% endif %}
48 |
49 |
--------------------------------------------------------------------------------
/templates/tools/rsa_check.html:
--------------------------------------------------------------------------------
1 |
2 |
34 |
35 |
36 |
41 |
42 |
--------------------------------------------------------------------------------
/templates/tools/rsa_check_result.html:
--------------------------------------------------------------------------------
1 | {{ rsa_check_r['error'] }}
2 |
7 |
8 |
9 | {% if rsa_check_r['error'] %}
10 |
{{ rsa_check_r['msg'] }}
11 | {% else %}
12 |
{{ rsa_check_r['msg'] }}
13 | {% endif %}
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/test/base.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 |
3 | # 对字符串进行按长度分割
4 | def split_string(string,width):
5 | if isinstance(string,str):
6 | string=string
7 | else:
8 | string=str(int(string))
9 | return '\n'.join([string[i:i+width] for i in range(0,len(string),width)])
--------------------------------------------------------------------------------
/test/create_key.py:
--------------------------------------------------------------------------------
1 | from cryptography.hazmat.backends import default_backend
2 | from cryptography.hazmat.primitives import serialization
3 | from cryptography.hazmat.primitives.asymmetric import rsa,dsa,ec
4 |
5 | key=ec.generate_private_key(
6 | curve=ec.SECP192R1(),
7 | backend=default_backend()
8 | )
9 |
10 | if __name__ == '__main__':
11 | try:
12 | with open('./key.pem','wb') as f:
13 | f.write(key.private_bytes(
14 | encoding=serialization.Encoding.PEM,
15 | format=serialization.PrivateFormat.PKCS8,
16 | encryption_algorithm=serialization.NoEncryption(),
17 | ))
18 | print('private key is ok')
19 | except Exception as e:
20 | print(e)
--------------------------------------------------------------------------------
/test/create_key.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wossl33/wossl/e0e55fe87235ad02ea67f8797cf4f6469d3bf78d/test/create_key.pyc
--------------------------------------------------------------------------------
/test/csr.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIIBWTCCAQ4CAQAwbjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQH
3 | DA1TYW4gRnJhbmNpc2NvMRMwEQYDVQQKDApNeSBDb21wYW55MRAwDgYDVQQLDAdD
4 | b21wYW55MRMwEQYDVQQDDApteXNpdGUuY29tMEkwEwYHKoZIzj0CAQYIKoZIzj0D
5 | AQEDMgAEQ7phe563jhXWZaivHGeg2k1F3wI3TKMc8jvBI8LhjYMcYGl18Ab7ejI7
6 | 3LqXASRXoE4wTAYJKoZIhvcNAQkOMT8wPTA7BgNVHREENDAyggpteXNpdGUuY29t
7 | gg53d3cubXlzaXRlLmNvbYIUc3ViZG9tYWluLm15c2l0ZS5jb20wCgYIKoZIzj0E
8 | AwIDOQAwNgIZALVCga5VRIQ792Wz22hh0yiizFEzaN2MzQIZAO/lRmZXxyywZ6sV
9 | zpTzKZp0LmQoztUe1Q==
10 | -----END CERTIFICATE REQUEST-----
11 |
--------------------------------------------------------------------------------
/test/csr.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | from cryptography import x509
3 | from cryptography.hazmat.backends import default_backend
4 | from cryptography.hazmat.primitives import hashes,serialization
5 | from cryptography.hazmat.primitives.asymmetric import rsa,dsa,ec
6 | from base import split_string
7 | import binascii
8 |
9 | # 读取CSR内容
10 | def readCSR(pem_req_data):
11 | csr=None
12 | try:
13 | csr=x509.load_pem_x509_csr(pem_req_data,default_backend())
14 | except Exception,e:
15 | print e
16 | return {'error':False,'msg':u'CSR内容错误!'}
17 | # csr句柄获取
18 | if isinstance(csr,x509.CertificateSigningRequest):
19 | rep_reuslt={}
20 | # 获取subject基本信息
21 | subject_check=['commonName','countryName','stateOrProvinceName','localityName','organizationName','organizationalUnitName']
22 | for attr in csr.subject:
23 | if attr.oid._name in subject_check:
24 | rep_reuslt[attr.oid._name]=attr.value
25 | subject_check.remove(attr.oid._name)
26 |
27 | for i in subject_check:
28 | rep_reuslt[i]=""
29 | # csr扩展信息
30 | public_extensions=[]
31 | if csr.extensions:
32 | try:
33 | for extension in csr.extensions:
34 | for value in extension.value:
35 | if isinstance(value,x509.DNSName):
36 | public_extensions.append(value.value)
37 | rep_reuslt['extension']=','.join(public_extensions)
38 | except Exception,e:
39 | print e
40 | return {'error':False,'msg':u'CSR扩展错误!'}
41 | else:
42 | rep_reuslt['extension']=''
43 | # 获取密钥强度
44 | rep_reuslt['public_key_size']=str(csr.public_key().key_size)
45 | # 密钥类型
46 | if isinstance(csr.public_key(),rsa.RSAPublicKey):
47 | rep_reuslt['public_key']="RSA"
48 | rep_reuslt['public_key_n']=split_string(csr.public_key().public_numbers().n,64)
49 | rep_reuslt['public_key_e']=csr.public_key().public_numbers().e
50 | elif isinstance(csr.public_key(),dsa.DSAPublicKey):
51 | rep_reuslt['public_key']="DSA"
52 | rep_reuslt['public_key_y']=split_string(csr.public_key().public_numbers().y,64)
53 | elif isinstance(csr.public_key(),ec.EllipticCurvePublicKey):
54 | rep_reuslt['public_key']="ECDSA"
55 | rep_reuslt['public_key_x']=split_string(csr.public_key().public_numbers().x,64)
56 | rep_reuslt['public_key_y']=split_string(csr.public_key().public_numbers().y,64)
57 | else:
58 | rep_reuslt['public_key']=""
59 | # 签名算法
60 | if isinstance(csr.signature_hash_algorithm,hashes.MD5):
61 | rep_reuslt['sign_with']="MD5"
62 | elif isinstance(csr.signature_hash_algorithm,hashes.SHA1):
63 | rep_reuslt['sign_with']="SHA1"
64 | elif isinstance(csr.signature_hash_algorithm,hashes.SHA224):
65 | rep_reuslt['sign_with']="SHA224"
66 | elif isinstance(csr.signature_hash_algorithm,hashes.SHA256):
67 | rep_reuslt['sign_with']="SHA256"
68 | elif isinstance(csr.signature_hash_algorithm,hashes.SHA384):
69 | rep_reuslt['sign_with']="SHA384"
70 | elif isinstance(csr.signature_hash_algorithm,hashes.SHA512):
71 | rep_reuslt['sign_with']="SHA512"
72 | elif isinstance(csr.signature_hash_algorithm,hashes.BLAKE2b):
73 | rep_reuslt['sign_with']="BLAKE2b"
74 | elif isinstance(csr.signature_hash_algorithm,hashes.BLAKE2s):
75 | rep_reuslt['sign_with']="BLAKE2s"
76 | else:
77 | rep_reuslt['sign_with']=""
78 | # 签名信息及是否有效
79 | rep_reuslt['csr_signture']=split_string(binascii.hexlify(csr.signature),64)
80 | if csr.is_signature_valid:
81 | rep_reuslt['csr_sign_valid']=u"是"
82 | else:
83 | rep_reuslt['csr_sign_valid']=u"否"
84 | # 公钥明文
85 | rep_reuslt['public_key_string']=csr.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
86 | return {'error':True,'msg':rep_reuslt}
87 | else:
88 | return {'error':False,'msg':u'对象类型错误!'}
89 |
90 | if __name__=='__main__':
91 | pem_data=b''
92 | try:
93 | with open('./csr.pem','rb') as f:
94 | pem_data=f.read()
95 | except Exception as e:
96 | print(e)
97 |
98 | print readCSR(pem_data)
--------------------------------------------------------------------------------
/test/csr.txt:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIICwDCCAagCAQAwezELMAkGA1UEBhMCQ04xDzANBgNVBAgMBua5luWMlzEPMA0G
3 | A1UEBwwG5q2m5rGJMTMwMQYDVQQKDCrmrabmsYnph5Hono3nlLXlrZDnu5Pnrpfk
4 | uK3lv4PmnInpmZDlhazlj7gxFTATBgNVBAMMDHd3dy53aGNyYy5jbjCCASIwDQYJ
5 | KoZIhvcNAQEBBQADggEPADCCAQoCggEBAL7Qkbk8cSFI3NIym4dNjvzlp+CGlvM4
6 | ga9QhQ6OBl39JBfqucAQQ5PLC95nAkMbc8+YPHEkPCrTar1Z46dOuGxQyzDTAWz9
7 | p3OKvfjTT5tUvtHw8GeMod03w3+WRDyWXchRSIRNjjAYnJcO3NiKpM8SgYp+BDhg
8 | K6kNkkgp4k7+FfmpJsypMJ0j3JEd+0GNpdy+Uj/2ryT9LuQQxpMhn1fHU+qmMYQZ
9 | jtf1J8vpT6HpzraNmiaFcS2MOMmVI2uMUg8mIvNjsBQmCgfUACDNQcKni/tQlbCY
10 | Ek/XjE8M+xS+nEg6hH2wRtIHybO4MolnDughPH+RRrOgYyLlQ/Z5Z5cCAwEAAaAA
11 | MA0GCSqGSIb3DQEBCwUAA4IBAQBVpuObR9zvz8NRcvzWNy1i9tLbcsq9XZ7Q8i1P
12 | bG/IuR+Vb6A6gQAOO0qtS/BFNKHIpMxTy41iGT38F3KcWFT9QMoYPxAU19T5CK1R
13 | UDL8Cj69sM8FimbJ3mpw2ddzfnqpNWiFnCzTs8pBLZw+VPvrd19+oucecimw+ymk
14 | pT8415xrEnBlAGi0yE7brN84gEoGJg5FaBr2/jdtsS5uQraJ029b65YVifbhmwsz
15 | +h1Mx8aOTILVLvdUE5i+kw0Pf7mNXfsn3f4oMC/93yWLG2Y2yULVQ0rPFgsAnlA7
16 | QkDgf9SiyenavEJxR720mGET6uuqGt9R0WaxP3jxsi0XsWY0
17 | -----END CERTIFICATE REQUEST-----
18 |
--------------------------------------------------------------------------------
/test/flaskTest.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | from flask import Flask,render_template,request
3 | import csr
4 | import cer
5 | import rsa
6 | import key
7 |
8 | app = Flask(__name__)
9 |
10 | # 首页
11 | @app.route('/')
12 | def index():
13 | client_ip=request.remote_addr
14 | return render_template('index.html',client_ip=client_ip)
15 | # gmssl项目
16 | @app.route('/gmssl')
17 | def gmssl():
18 | return render_template('gmssl.html')
19 | # 控制台
20 | @app.route('/this_console')
21 | def this_console():
22 | return render_template('console.html')
23 |
24 | # 登录日志
25 | @app.route('/log')
26 | def log():
27 | return render_template('logs.html')
28 |
29 | # 版本信息
30 | @app.route('/banner')
31 | def banner():
32 | return render_template('banner.html')
33 |
34 | '''
35 | SSL工具集
36 | '''
37 | @app.route('/csr_check')
38 | def csr_check():
39 | return render_template('tools/csr_check.html')
40 | @app.route('/csr_create')
41 | def csr_create():
42 | return render_template('tools/csr_create.html')
43 | @app.route('/cer_check')
44 | def cer_check():
45 | return render_template('tools/cer_check.html')
46 | @app.route('/rsa_check')
47 | def rsa_check():
48 | return render_template('tools/rsa_check.html')
49 | @app.route('/pre_cer')
50 | def pre_cer():
51 | return render_template('tools/pre_cer.html')
52 | @app.route('/pro_suites')
53 | def pro_suites():
54 | return render_template('tools/pro_suites.html')
55 | '''
56 | SSL漏洞检测
57 | '''
58 | @app.route('/vuls_check')
59 | def vuls_check():
60 | return render_template('vules/vuls_check.html')
61 | @app.route('/heart_bleed')
62 | def heart_bleed():
63 | return render_template('vules/heart_bleed.html')
64 | @app.route('/freak_attack')
65 | def freak_attack():
66 | return render_template('vules/freak_attack.html')
67 | @app.route('/ssl_poodle')
68 | def ssl_poodle():
69 | return render_template('vules/ssl_poodle.html')
70 | @app.route('/ccs_injection')
71 | def ccs_injection():
72 | return render_template('vules/ccs_injection.html')
73 | @app.route('/cbc_padding')
74 | def cbc_padding():
75 | return render_template('vules/cbc_padding.html')
76 | @app.route('/csr_check_show',methods=['POST'])
77 | def csr_check_show():
78 | pem_data=request.form['csr_content'].encode('utf-8')
79 | return render_template('tools/csr_check_result.html',csr_content=csr.readCSR(pem_data))
80 | @app.route('/cer_check_show',methods=['POST'])
81 | def cer_check_show():
82 | pem_data=request.form['cer_content'].encode('utf-8')
83 | return render_template('tools/cer_check_result.html',cer_content=cer.readCER(pem_data))
84 | @app.route('/rsa_check_show',methods=['POST'])
85 | def rsa_check_show():
86 | req_cer_csr=request.form['cer_csr'].encode('utf-8')
87 | csr_pri=request.form['csr_pri'].encode('utf-8')
88 | key=str(request.form['key'])
89 | if int(request.form['suite_type']) == 1:
90 | if key:
91 | return render_template('tools/rsa_check_result.html',rsa_check_r=rsa.cer_key(req_cer_csr,csr_pri,key))
92 | else:
93 | return render_template('tools/rsa_check_result.html',rsa_check_r=rsa.cer_key(req_cer_csr,csr_pri))
94 | elif int(request.form['suite_type']) == 2:
95 | return render_template('tools/rsa_check_result.html',rsa_check_r=rsa.cer_csr(req_cer_csr,csr_pri))
96 | elif int(request.form['suite_type']) == 3:
97 | if key:
98 | return render_template('tools/rsa_check_result.html',rsa_check_r=rsa.csr_key(req_cer_csr,csr_pri,key))
99 | else:
100 | return render_template('tools/rsa_check_result.html',rsa_check_r=rsa.csr_key(req_cer_csr,csr_pri))
101 | else:
102 | return render_template('tools/rsa_check_result.html',rsa_check_r={'msg':u'校验类型有误!'})
103 | @app.route('/pre_cer_result',methods=['POST'])
104 | def pre_cer_result():
105 | priv_content=request.form['priv_content'].encode('utf-8')
106 | key=str(request.form['key'])
107 | if int(request.form['jjm_type']) == 1:
108 | return render_template('tools/pre_cer_result.html',key_reuslt=rsa.jjm_1(priv_content,key))
109 | elif int(request.form['jjm_type']) == 2:
110 | return render_template('tools/pre_cer_result.html',key_reuslt=rsa.jjm_2(priv_content,key))
111 | else:
112 | return render_template('tools/pre_cer_result.html',key_reuslt={'error':True,'msg':u'异常错误!'})
113 |
114 | @app.route('/create_csr',methods=['POST'])
115 | def create_csr():
116 | com_name=request.form['com_name'].encode('utf-8').decode('utf-8')
117 | bumen_name=request.form['bumen_name'].encode('utf-8').decode('utf-8')
118 | zuzhi_name=request.form['zuzhi_name'].encode('utf-8').decode('utf-8')
119 | city_name=request.form['city_name'].encode('utf-8').decode('utf-8')
120 | shengfen_name=request.form['shengfen_name'].encode('utf-8').decode('utf-8')
121 | guojia_name=request.form['guojia_name'].encode('utf-8').decode('utf-8')
122 | beiyong_name=request.form['beiyong_name'].encode('utf-8').decode('utf-8')
123 | mysf=str(request.form['mysf'])
124 | if str(request.form['myqd']):
125 | myqd=str(request.form['myqd'])
126 | elif mysf == 'ECDSA' and not str(request.form['myqd']):
127 | myqd='P256'
128 | else:
129 | myqd='2048'
130 |
131 | if str(request.form['qmsf']):
132 | qmsf=str(request.form['qmsf'])
133 | else:
134 | qmsf='SHA1'
135 | key_pass=str(request.form['key_pass'])
136 | return render_template('tools/csr_create_result.html',result=key.create_csr(com_name,bumen_name,zuzhi_name,city_name,shengfen_name,guojia_name,mysf,beiyong_name,myqd,qmsf,key_pass))
137 |
138 | if __name__ == '__main__':
139 | app.debug=True
140 | app.run()
141 |
--------------------------------------------------------------------------------
/test/rsa.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | from cryptography import x509
3 | from cryptography.hazmat.backends import default_backend
4 | from cryptography.hazmat.primitives import serialization
5 |
6 | def cer_csr(cer_pem_data,csr_pem_data):
7 | cer=None
8 | csr=None
9 | try:
10 | cer=x509.load_pem_x509_certificate(cer_pem_data,default_backend())
11 | except Exception,e:
12 | print e
13 | return {'error':False,'msg':u'证书内容错误!'}
14 |
15 | try:
16 | csr=x509.load_pem_x509_csr(csr_pem_data,default_backend())
17 | except Exception,e:
18 | print e
19 | return {'error':False,'msg':u'CSR内容错误!'}
20 |
21 | if isinstance(cer,x509.Certificate) and isinstance(csr,x509.CertificateSigningRequest):
22 | # 公钥明文
23 | cer_public_key=cer.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
24 | csr_public_key=csr.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
25 | if cer_public_key == csr_public_key:
26 | return {'error':True,'msg':u'匹配成功!'}
27 | else:
28 | return {'error':False,'msg':u'匹配失败!'}
29 | else:
30 | return {'error':False,'msg':u'证书/CSR内容错误!'}
31 |
32 | def csr_key(csr_pem_data,key_pem_data,key_passwd=None):
33 | csr=None
34 | key=None
35 |
36 | try:
37 | csr=x509.load_pem_x509_csr(csr_pem_data,default_backend())
38 | except Exception,e:
39 | print e
40 | return {'error':False,'msg':u'CSR内容错误!'}
41 |
42 | try:
43 | key=serialization.load_pem_private_key(key_pem_data,password=key_passwd,backend=default_backend())
44 | except Exception,e:
45 | print e
46 | return {'error':False,'msg':u'私钥内容错误!'}
47 | if isinstance(csr,x509.CertificateSigningRequest):
48 | csr_public_key=csr.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
49 | key_public_key=key.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
50 | if csr_public_key == key_public_key:
51 | return {'error':True,'msg':u'匹配成功!'}
52 | else:
53 | return {'error':False,'msg':u'匹配失败!'}
54 | else:
55 | return {'error':False,'msg':u'CSR/私钥内容错误!'}
56 |
57 | def cer_key(cer_pem_data,key_pem_data,key_passwd=None):
58 | cer=None
59 | key=None
60 | try:
61 | cer=x509.load_pem_x509_certificate(cer_pem_data,default_backend())
62 | except Exception,e:
63 | print e
64 | return {'error':False,'msg':u'证书内容错误!'}
65 | try:
66 | key=serialization.load_pem_private_key(key_pem_data,password=key_passwd,backend=default_backend())
67 | except Exception,e:
68 | print e
69 | return {'error':False,'msg':u'私钥内容错误!'}
70 | if isinstance(cer,x509.Certificate):
71 | # 公钥明文
72 | cer_public_key=cer.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
73 | key_public_key=key.public_key().public_bytes(serialization.Encoding.PEM,serialization.PublicFormat.SubjectPublicKeyInfo)
74 | if csr_public_key == key_public_key:
75 | return {'error':True,'msg':u'匹配成功!'}
76 | else:
77 | return {'error':False,'msg':u'匹配失败!'}
78 | else:
79 | return {'error':False,'msg':u'证书/私钥内容错误!'}
80 |
81 | def jjm_1(key_pem_data,pass_key):
82 | try:
83 | key=serialization.load_pem_private_key(key_pem_data,password=None,backend=default_backend())
84 | except Exception,e:
85 | print e
86 | return {'error':False,'msg':u'私钥内容/密码错误!'}
87 | result={}
88 | try:
89 | result['key_string']=key.private_bytes(
90 | encoding=serialization.Encoding.PEM,
91 | format=serialization.PrivateFormat.PKCS8,
92 | encryption_algorithm=serialization.BestAvailableEncryption(pass_key)
93 | )
94 | except Exception,e:
95 | print e
96 | return {'error':False,'msg':u'密码错误!'}
97 | result['key']=pass_key
98 | return {'error':True,'msg':result}
99 |
100 | def jjm_2(key_pem_data,pass_key):
101 | try:
102 | key=serialization.load_pem_private_key(key_pem_data,password=pass_key,backend=default_backend())
103 | except Exception,e:
104 | print e
105 | return {'error':False,'msg':u'私钥内容/密码错误!'}
106 | result={}
107 | try:
108 | result['key_string']=key.private_bytes(
109 | encoding=serialization.Encoding.PEM,
110 | format=serialization.PrivateFormat.PKCS8,
111 | encryption_algorithm=serialization.NoEncryption()
112 | )
113 | except Exception,e:
114 | print e
115 | return {'error':False,'msg':u'密码错误!'}
116 | result['key']=pass_key
117 | return {'error':True,'msg':result}
118 |
119 | if __name__=='__main__':
120 | cer_pem_data=b''
121 | try:
122 | with open('./key.pem','rb') as f:
123 | cer_pem_data=f.read()
124 | except Exception as e:
125 | print(e)
126 |
127 | print jjm_2(cer_pem_data,'123456')
128 |
--------------------------------------------------------------------------------
/test/suites.py:
--------------------------------------------------------------------------------
1 | from cryptography import x509
2 | from cryptography.x509.oid import NameOID
3 | from cryptography.hazmat.primitives import hashes
4 | from create_key import key,default_backend,serialization
5 | #create a csr
6 | csr=x509.CertificateSigningRequestBuilder().subject_name(x509.Name([
7 | # Provide various details about who we are.
8 | x509.NameAttribute(NameOID.COUNTRY_NAME, u"US"),
9 | x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, u"CA"),
10 | x509.NameAttribute(NameOID.LOCALITY_NAME, u"San Francisco"),
11 | x509.NameAttribute(NameOID.ORGANIZATION_NAME, u"My Company"),
12 | x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, u"Company"),
13 | x509.NameAttribute(NameOID.COMMON_NAME, u"mysite.com"),
14 | ])).add_extension(x509.SubjectAlternativeName([
15 | # Describe what sites we want this certificate for.
16 | x509.DNSName(u"mysite.com"),
17 | x509.DNSName(u"www.mysite.com"),
18 | x509.DNSName(u"subdomain.mysite.com"),
19 | ]),
20 | critical=False,
21 | # Sign the CSR with our private key.
22 | ).sign(key,hashes.SHA256(),default_backend())
23 |
24 | def create_csr(com_name,bumen_name,zuzhi_name,city_name,shengfen_name,guojia_name,mysf,beiyong_name,myqd,qmsf,key_pass):
25 | private_key=None
26 | if mysf == 'RSA':
27 | csr_subject_name=x509.CertificateSigningRequestBuilder().subject_name(x509.Name([
28 | # Provide various details about who we are.
29 | x509.NameAttribute(NameOID.COUNTRY_NAME, guojia_name),
30 | x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, shengfen_name),
31 | x509.NameAttribute(NameOID.LOCALITY_NAME, city_name),
32 | x509.NameAttribute(NameOID.ORGANIZATION_NAME, zuzhi_name),
33 | x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, bumen_name),
34 | x509.NameAttribute(NameOID.COMMON_NAME, com_name),
35 | ]))
36 | csr.add_extension()
37 | #create a csr
38 | csr=x509.CertificateSigningRequestBuilder().subject_name(x509.Name([
39 | # Provide various details about who we are.
40 | x509.NameAttribute(NameOID.COUNTRY_NAME, guojia_name),
41 | x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, shengfen_name),
42 | x509.NameAttribute(NameOID.LOCALITY_NAME, city_name),
43 | x509.NameAttribute(NameOID.ORGANIZATION_NAME, zuzhi_name),
44 | x509.NameAttribute(NameOID.ORGANIZATIONAL_UNIT_NAME, bumen_name),
45 | x509.NameAttribute(NameOID.COMMON_NAME, com_name),
46 | ])).add_extension(x509.SubjectAlternativeName([
47 | # Describe what sites we want this certificate for.
48 | x509.DNSName(u"mysite.com"),
49 | x509.DNSName(u"www.mysite.com"),
50 | x509.DNSName(u"subdomain.mysite.com"),
51 | ]),
52 | critical=False,
53 | # Sign the CSR with our private key.
54 | ).sign(key,hashes.SHA256(),default_backend())
55 | return None
56 | if __name__ == '__main__':
57 | try:
58 | with open("./csr.pem","wb") as f:
59 | f.write(csr.public_bytes(serialization.Encoding.PEM))
60 | print("csr create is ok")
61 | except Exception as e:
62 | print(e)
63 |
64 | try:
65 | with open('./key.pem','wb') as f:
66 | f.write(key.private_bytes(
67 | encoding=serialization.Encoding.PEM,
68 | format=serialization.PrivateFormat.PKCS8,
69 | encryption_algorithm=serialization.NoEncryption(),
70 | ))
71 | print('private key is ok')
72 | except Exception as e:
73 | print(e)
74 |
--------------------------------------------------------------------------------
/test/test.py:
--------------------------------------------------------------------------------
1 | from OpenSSL import crypto
2 |
3 | def gen_pkcs12(cert_pem=None,key_pem=None,ca_pem=None,friendly_name=None):
4 | p12=crypto.PKCS12()
5 | if cert_pem:
6 | ret = p12.set_certificate(crypto.load_certificate(crypto.FILETYPE_PEM, cert_pem))
7 | assert ret is None
8 | if key_pem:
9 | ret = p12.set_privatekey(crypto.load_privatekey(crypto.FILETYPE_PEM, key_pem))
10 | assert ret is None
11 | if ca_pem:
12 | ret = p12.set_ca_certificates(
13 | (crypto.load_certificate(crypto.FILETYPE_PEM, ca_pem),)
14 | )
15 | assert ret is None
16 | if friendly_name:
17 | ret = p12.set_friendlyname(friendly_name)
18 | assert ret is None
19 | return p12
20 |
21 | if __name__=='__main__':
22 | cer_pem_data=b''
23 | key_pem_data=b''
24 | try:
25 | with open('./whcrc.cer','rb') as f:
26 | cer_pem_data=f.read()
27 | except Exception as e:
28 | print(e)
29 |
30 | try:
31 | with open('./key.pem','rb') as f:
32 | key_pem_data=f.read()
33 | except Exception as e:
34 | print(e)
35 |
36 | print gen_pkcs12(cer_pem_data,key_pem_data).export()
--------------------------------------------------------------------------------
/test/whcrc.cer:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIE4zCCA8ugAwIBAgIQIBUBPyhX/Ic0hkZ12DrpfTANBgkqhkiG9w0BAQsFADBV
3 | MQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmlj
4 | YXRpb24gQXV0aG9yaXR5MRQwEgYDVQQDDAtDRkNBIE9WIE9DQTAeFw0xNzExMjgw
5 | OTI4NTNaFw0xODExMjgwOTI4NTNaMHsxCzAJBgNVBAYTAkNOMQ8wDQYDVQQIDAbm
6 | uZbljJcxDzANBgNVBAcMBuatpuaxiTEzMDEGA1UECgwq5q2m5rGJ6YeR6J6N55S1
7 | 5a2Q57uT566X5Lit5b+D5pyJ6ZmQ5YWs5Y+4MRUwEwYDVQQDDAx3d3cud2hjcmMu
8 | Y24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC+0JG5PHEhSNzSMpuH
9 | TY785afghpbzOIGvUIUOjgZd/SQX6rnAEEOTywveZwJDG3PPmDxxJDwq02q9WeOn
10 | TrhsUMsw0wFs/adzir3400+bVL7R8PBnjKHdN8N/lkQ8ll3IUUiETY4wGJyXDtzY
11 | iqTPEoGKfgQ4YCupDZJIKeJO/hX5qSbMqTCdI9yRHftBjaXcvlI/9q8k/S7kEMaT
12 | IZ9Xx1PqpjGEGY7X9SfL6U+h6c62jZomhXEtjDjJlSNrjFIPJiLzY7AUJgoH1AAg
13 | zUHCp4v7UJWwmBJP14xPDPsUvpxIOoR9sEbSB8mzuDKJZw7oITx/kUazoGMi5UP2
14 | eWeXAgMBAAGjggGHMIIBgzAJBgNVHRMEAjAAMGwGCCsGAQUFBwEBBGAwXjAoBggr
15 | BgEFBQcwAYYcaHR0cDovL29jc3AuY2ZjYS5jb20uY24vb2NzcDAyBggrBgEFBQcw
16 | AoYmaHR0cDovL2d0Yy5jZmNhLmNvbS5jbi9vdm9jYS9vdm9jYS5jZXIwFwYDVR0R
17 | BBAwDoIMd3d3LndoY3JjLmNuMAsGA1UdDwQEAwIFoDAdBgNVHQ4EFgQU9imGOVDM
18 | tNE2w10qb0dZwcOImZAwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMB8G
19 | A1UdIwQYMBaAFGaz7/tUlYfprKWWVq7mfe060EPRMEYGA1UdIAQ/MD0wOwYGZ4EM
20 | AQICMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2ZjYS5jb20uY24vdXMvdXMt
21 | MTIuaHRtMDsGA1UdHwQ0MDIwMKAuoCyGKmh0dHA6Ly9jcmwuY2ZjYS5jb20uY24v
22 | T1ZPQ0EvUlNBL2NybDI0LmNybDANBgkqhkiG9w0BAQsFAAOCAQEAgBjhyLmsxqGk
23 | lthjD+45z1/CdF/gg0lQZvJeEmP7dLQbfN5hENPiyYHQCwGkd3+XkrP0LmROJ1xr
24 | i64WxSqh5XKreq+Pg7unVJqOUj6sjYdOFsjuMeoDSN/nYg4kbcocMuQ4yhSAnpVa
25 | 2QdBlnHCiSTv7g/mp7Afki2bo/eX+UU2lttgqxB57pNzr/9sv/j593sqqGA27gbI
26 | FwIjCXdI5PvmxiTx6Yz79ASAiq7h7AHMosHaqJPekVLHx9iCBSkThyMJ/u47UFnv
27 | nKmgSTVQol3iYZiI21al2CQ+c2LCE/rUkjHnGwSK1sYrmJ+ET4+eNUjfaSOt+HoS
28 | p8qZr3tXeg==
29 | -----END CERTIFICATE-----
--------------------------------------------------------------------------------
/test/x509.py:
--------------------------------------------------------------------------------
1 | x=u'中国,日本'
2 | print x.split(',')
3 |
4 |
5 | '''
6 | subject_check=['commonName','countryName','stateOrProvinceName','localityName','organizationName','organizationalUnitName']
7 | for i in cert.subject:
8 | if isinstance(i,x509.NameAttribute):
9 | print i.oid._name
10 | '''
11 | 'commonName','countryName','stateOrProvinceName','localityName','organizationName','organizationalUnitName'
12 | '''
13 | def extensions_type(exten):
14 | if isinstance(exten,x509.extensions.SubjectAlternativeName):
15 | pass
16 | elif isinstance(exten,x509.extensions.BasicConstraints):
17 | pass
18 | elif isinstance(exten,x509.extensions.KeyUsage):
19 | pass
20 | elif isinstance(exten,x509.extensions.CRLDistributionPoints):
21 | pass
22 | elif isinstance(exten,x509.extensions.CertificatePolicies):
23 | pass
24 | elif isinstance(exten,x509.extensions.ExtendedKeyUsage):
25 | pass
26 | elif isinstance(exten,x509.extensions.AuthorityKeyIdentifier):
27 | pass
28 | elif isinstance(exten,x509.extensions.AuthorityInformationAccess):
29 | pass
30 | elif isinstance(exten,x509.extensions.UnrecognizedExtension):
31 | pass
32 | elif isinstance(exten,x509.extensions.AuthorityKeyIdentifier):
33 | pass
34 | elif isinstance(exten,x509.extensions.AuthorityKeyIdentifier):
35 | pass
36 | print cert.serial_number
37 | print binascii.hexlify(cert.fingerprint(hashes.SHA256()))
38 | print cert.not_valid_before
39 | print cert.not_valid_before
40 | print cert.version
41 | for i in cert.extensions:
42 | print type(i)
43 |
44 | x509.AccessDescription
45 | x509.AuthorityInformationAccess
46 | x509.AuthorityInformationAccessOID
47 | x509.AuthorityKeyIdentifier
48 | x509.BasicConstraints
49 | x509.CRLDistributionPoints
50 | x509.CRLEntryExtensionOID
51 | x509.CRLNumber
52 | x509.CRLReason
53 | x509.DirectoryName
54 | x509.DistributionPoint
55 | x509.DuplicateExtension
56 | x509.DNSName
57 | x509.ExtendedKeyUsage
58 |
59 | x509.ExtendedKeyUsageOID
60 | x509.ExtensionNotFound
61 | x509.GeneralName
62 | x509.GeneralNames
63 | x509.InhibitAnyPolicy
64 | x509.InvalidityDate
65 | x509.InvalidVersion
66 | x509.IPAddress
67 | x509.IssuerAlternativeName
68 | x509.KeyUsage
69 | x509.Name
70 | x509.NameAttribute
71 | x509.NameConstraints
72 | x509.NoticeReference
73 |
74 | x509.ObjectIdentifier
75 | x509.OCSPNoCheck
76 | x509.UserNotice
77 | x509.UnsupportedGeneralNameType
78 | x509.UnsupportedExtension
79 | x509.UnrecognizedExtension
80 | x509.UniformResourceIdentifier
81 | x509.SubjectKeyIdentifier
82 | x509.SubjectAlternativeName
83 | x509.SignatureAlgorithmOID
84 | x509.RFC822Name
85 | x509.RelativeDistinguishedName
86 | x509.ReasonFlags
87 | x509.PolicyInformation
88 | x509.PolicyConstraints
89 | x509.OtherName
90 | '''
--------------------------------------------------------------------------------
/views.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | from flask import Flask,render_template,request
3 | from app import app
4 | from cer import views as cer_views
5 |
6 | # 首页
7 | @app.route('/')
8 | def index():
9 | # 测试环境下获取客户端IP
10 | client_ip=request.remote_addr
11 | # 生产环境下获取客户端IP
12 | '''
13 | if request.headers['X-Real-IP']:
14 | client_ip=request.headers['X-Real-IP']
15 | else:
16 | client_ip=request.headers['X-Forwarded-For']
17 | '''
18 | return render_template('index.html',client_ip=client_ip)
19 |
20 | # 控制台
21 | @app.route('/this_console')
22 | def this_console():
23 | return render_template('console.html')
24 |
25 | # SSL深度检查
26 | @app.route('/gmssl')
27 | def gmssl():
28 | return render_template('gmssl.html')
29 |
30 | # 登录日志
31 | @app.route('/log')
32 | def log():
33 | return render_template('logs.html')
34 |
35 | # 关于
36 | @app.route('/abort')
37 | def abort():
38 | return render_template('abort.html')
39 |
40 | # 主页侧边栏--AES加解密
41 | @app.route('/aes_cipher')
42 | def aes_cipher():
43 | return render_template('tools/aes_cipher.html')
44 | @app.route('/des_cipher')
45 | def des_cipher():
46 | return render_template('tools/des_cipher.html')
47 | @app.route('/tdes_cipher')
48 | def tdes_cipher():
49 | return render_template('tools/3des_cipher.html')
50 |
51 | # 主页侧边栏--证书工具
52 | @app.route('/csr_check')
53 | def csr_check():
54 | return render_template('tools/csr_check.html')
55 | @app.route('/csr_create')
56 | def csr_create():
57 | return render_template('tools/csr_create.html')
58 | @app.route('/cer_check')
59 | def cer_check():
60 | return render_template('tools/cer_check.html')
61 | @app.route('/rsa_check')
62 | def rsa_check():
63 | return render_template('tools/rsa_check.html')
64 | @app.route('/pre_cer')
65 | def pre_cer():
66 | return render_template('tools/pre_cer.html')
67 | @app.route('/cert_create')
68 | def cert_create():
69 | return render_template('tools/cert_create.html')
70 |
71 | # 主页侧边栏--漏洞检测
72 | @app.route('/vuls_check')
73 | def vuls_check():
74 | return render_template('ssl/vuls_check.html')
75 | @app.route('/ssl_woshou')
76 | def ssl_woshou():
77 | return render_template('ssl/ssl_woshou.html')
78 | @app.route('/ssl_xieyi_taojian')
79 | def ssl_xieyi_taojian():
80 | return render_template('ssl/ssl_suites.html')
81 | @app.route('/ssl_deep')
82 | def ssl_deep():
83 | return render_template('ssl/ssl_deep.html')
84 |
85 | # 底栏
--------------------------------------------------------------------------------
/views.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wossl33/wossl/e0e55fe87235ad02ea67f8797cf4f6469d3bf78d/views.pyc
--------------------------------------------------------------------------------
/wossld.service:
--------------------------------------------------------------------------------
1 | [Unit]
2 | Description=Gunicorn Demo
3 | After=network.target
4 |
5 | [Service]
6 | User=root
7 | Group=root
8 | PIDFile=/tmp/gunicorn.pid
9 | WorkingDirectory=/root/wossl
10 | ExecStart=/usr/bin/gunicorn -c wsgi_config.py wsgi:app
11 | ExecReload=/bin/kill -s HUP $MAINPID
12 | ExecStop=/bin/kill -s TERM $MAINPID
13 |
14 | [Install]
15 | WantedBy=multi-user.target
16 |
--------------------------------------------------------------------------------
/wsgi.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | # 生产环境Gunicorn部署Flask应用
3 | from app import app
4 | from views import *
5 |
6 | if __name__ == '__main__':
7 | from werkzeug.contrib.fixers import ProxyFix
8 | app.wsgi_app=ProxyFix(app.wsgi_app)
9 | app.run()
--------------------------------------------------------------------------------
/wsgi_config.py:
--------------------------------------------------------------------------------
1 | # -*- coding:utf-8 -*-
2 | # wossl.service加载配置文件
3 | import os
4 | import gevent.monkey
5 | gevent.monkey.patch_all()
6 |
7 | import multiprocessing
8 |
9 | debug=True
10 | loglevel='debug'
11 | bind='192.168.85.81:8080'
12 | pidfile='/tmp/gunicorn.pid'
13 | logfile='/tmp/debug.log'
14 | # 多核多线程
15 | workers = multiprocessing.cpu_count()*2 + 1
16 | worker_class = 'gunicorn.workers.ggevent.GeventWorker'
17 |
--------------------------------------------------------------------------------