Guest User

web pm3

a guest
Jan 9th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. <!DOCTYPE html>
  4. <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  5. <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  6. <!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
  7. <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  8. <html lang="en">
  9.  
  10. <head>
  11.  
  12.     <meta charset="utf-8">
  13.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  14.     <meta name="viewport" content="width=device-width, initial-scale=1">
  15.     <meta name="description" content="">
  16.     <meta name="author" content="">
  17.     <title>Copy My Tag</title>
  18.     <!-- Bootstrap Core CSS -->
  19.     <link href="css/bootstrap.css" rel="stylesheet">
  20.  
  21.     <!-- Custom CSS -->
  22.     <link rel="stylesheet" href="css/main.css">
  23.     <link href="css/custom.css" rel="stylesheet">
  24.     <link rel="stylesheet" href="./font-awesome/css/font-awesome.min.css">
  25.     <script src="./bebas-neue.js"></script>
  26.  
  27.         <link rel="stylesheet" href="css/jquery-ui.css">
  28.     <!-- Custom Fonts & Icons -->
  29.     <link href='css/fontsgoogleapiscom_css_family=Open_Sans:400,700,600,800.css' rel='stylesheet' type='text/css'>
  30.     <link rel="stylesheet" href="css/icomoon-social.css">
  31.     <link rel="stylesheet" href="css/font-awesome.min.css">
  32.    
  33.     <script src="js/modernizr-2.6.2-respond-1.1.0.min.js"></script>
  34. <script src="js/jquery-1.9.1.min.js"></script>
  35.         <script src="js/bootstrap.min.js"></script>
  36.        
  37.         <script src="js/jquery-ui.js"></script>
  38.         <!-- Scrolling Nav JavaScript -->
  39.         <script src="js/jquery.easing.min.js"></script>
  40.         <script src="js/js.cookie.js"></script>
  41.         <script src="js/spin.js"></script>
  42.         <script>
  43.    
  44.        
  45.         </script>
  46.  
  47.  
  48. <script src="js/base64js.min.js"></script>
  49.     <script>
  50.         actionTimeout = false
  51.         scanCallback = false;
  52.         pendingCall = null
  53.         verifyCallback = false;
  54.         readCallback = false
  55.         feeShown = false
  56.         copyCallback = false
  57.         cgi = "./cgi/"
  58.         APIaddress = "https://proxcloud.de/api"//location.host+':4000'
  59.         serverCheckInterval = null
  60.         processing = false
  61.         proxmarkDevice = null
  62.         packetCounter = 0
  63.         pendingProxPackets = []
  64.         pendingProxPacketsTimeout = null
  65.  
  66.         pendingPackets = {}
  67.  
  68. function sendProxPacket(packet){
  69.             if (packet.counter != undefined){
  70.                 wrapped = packet
  71.             } else {
  72.                 wrapped = {"type":"proxReponse","data": packet, "counter":packetCounter}
  73.                 packetCounter++
  74.             }
  75.             wrapped.timeout = setTimeout(function (){
  76.                 sendProxPacket(wrapped)
  77.             }, 2400)
  78.             pendingProxPackets.push(wrapped)
  79.             pendingPackets[wrapped.counter] = wrapped
  80.            
  81.             clearTimeout(pendingProxPacketsTimeout)
  82.             pendingProxPacketsTimeout = setTimeout(function (){
  83.                 sendToServer(pendingProxPackets)
  84.                 pendingProxPackets = []
  85.             }, 100)
  86.            
  87.            
  88.         }
  89.         function sendToServer(packet, callback){
  90.             getFromServer()
  91.            
  92.             $.post(APIaddress+"?cookie="+Cookies.get('sessionid'), JSON.stringify({"packets":packet}), function (data) {
  93.                 getFromServer()
  94.                 if (callback){
  95.                     callback(data)             
  96.                 }
  97.                 }
  98.             ).fail(function (a,b,c,d){
  99.                 //alert(b)
  100.                 console.log(a)
  101.             });
  102.            
  103.         }
  104.         function informUser(data){
  105.             if (data.responseType){
  106.                 if (data.responseType == 'foundCard' || data.responseType == 'searchFail'){
  107.                     if (scanCallback){
  108.                         scanCallback(data);
  109.                         scanCallback = false
  110.                     }
  111.                 }
  112.                 if (data.responseType == 'verifyResult' && verifyCallback){
  113.                     verifyCallback(data);
  114.                     verifyCallback = false
  115.                 }
  116.                 if (data.responseType == 'cardDump' && readCallback){
  117.                     readCallback(data)
  118.                     readCallback = false
  119.                 }
  120.                 if (data.responseType = 'copyResult' && copyCallback){
  121.                     copyCallback(data)
  122.                     copyCallback = false
  123.                 }
  124.                
  125.             }
  126.         }
  127.         function writeUSB(data){
  128.             if (proxmarkDevice){
  129.                 console.log("writing to pm3 ")
  130.                 proxmarkDevice.claimInterface(1).then(() => {
  131.                     proxmarkDevice.controlTransferOut({
  132.                         requestType: 'class',
  133.                         recipient: 'interface',
  134.                         request: 34,
  135.                         value: 0x03,
  136.                         index: 0x00})
  137.                     .then(() => {
  138.                         readUSB(proxmarkDevice)
  139.                     })
  140.                     //cmd = new Uint16Array([0x0107,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00])
  141.                     tmp = new ArrayBuffer(packetSize)
  142.                     array = new Uint8Array(tmp)
  143.                     array.set(new Uint8Array(data.buffer))
  144.                     proxmarkDevice.transferOut(1, array)
  145.                 })
  146.             }
  147.         }
  148.         usbSize = 64
  149.         packetSize = 544
  150.         buff = new ArrayBuffer(packetSize)
  151.         currnetPacket = new Uint8Array(buff)
  152.         byteCount = 0
  153.         function readUSB(device){
  154.             device.transferIn(2, usbSize)
  155.             .then(result => {
  156.                 readUSB(device);
  157.                 if (result.status == 'ok'){
  158.                     currnetPacket.set(new Uint8Array(result.data.buffer), byteCount)
  159.                     byteCount = byteCount + result.data.byteLength
  160.                     if (byteCount >= packetSize) {
  161.                         /*str = ""
  162.                         view = new DataView(currnetPacket.buffer)
  163.                         for (i = 0; i < packetSize; i++){
  164.                             str = str+String.fromCharCode(view.getUint8(i))
  165.                         }*/
  166.                         //str = str.replace(/[^A-Za-z 0-9 \.,\?""!@#\$%\^&\*\(\)-_=\+;:<>\/\\\|\}\{\[\]`~]*/g, "");
  167.                         /*console.log(str)
  168.                         alert(str)*/
  169.                         console.log("read from  pm3 ")
  170.                         sendProxPacket(base64js.fromByteArray(currnetPacket))
  171.                         byteCount = 0
  172.                         clearTimeout(actionTimeout)
  173.                         actionTimeout = setTimeout(showActionTimeoutError, 30000)
  174.                     }
  175.                
  176.                 }
  177.             })
  178.         }
  179.         function connectUSB(){
  180.  
  181.             var device;
  182.    
  183.             navigator.usb.requestDevice({ filters: [{ vendorId: 65021 }] })
  184.             .then(selectedDevice => {
  185.                device = selectedDevice;
  186.                return device.open(); // Begin a session.
  187.              })
  188.             .then(() => device.selectConfiguration(1)) // Select configuration #1 for the device.
  189.             .then(() => device.claimInterface(0))
  190.             .then(() => {
  191.                 proxmarkDevice = device;
  192.                 $('#connectionStatus').css('color', 'green')
  193.                 $('#connectionStatus').html("Connected &#10004;")
  194.                
  195.                 $('#connectButton').hide()
  196.             })
  197.             .catch(error => {
  198.                 console.log(error);
  199.              });
  200.             /*
  201.             .then(() => device.controlTransferOut({
  202.                 requestType: 'vendor',
  203.                 recipient: 'device',
  204.                 request: 0x01,
  205.                 value: 0x05,
  206.                 index: 0x00})) // Ready to receive data , new Uint16Array([1,2,3])
  207.             .then(result => {
  208.                 console.log(result);
  209.             })*/
  210.         }
  211.  
  212. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  213.         card = null;
  214.    
  215.         function doLogin(data){
  216.             $('#loginForm').hide()     
  217.             $('#loginbanner').hide()
  218.             $('#welcomeName').text(data.email)
  219.             $('#wlecomebanner').show()
  220.             $("#balance").text(data.balance)
  221.            
  222.         }
  223.         waitingResponse = false
  224.         function getFromServer(callback){
  225.             if (!processing){
  226.                 clearInterval(serverCheckInterval)
  227.                 serverCheckInterval = null
  228.                 return
  229.             }
  230.             if (waitingResponse){
  231.                 return
  232.             }
  233.             waitingResponse = true
  234.             pendingCall = $.ajax({
  235.                 type: "GET",
  236.                 url: APIaddress+"?cookie="+Cookies.get('sessionid'),
  237.                 dataType: "jsonp",
  238.                 success: function (data) {
  239.                 console.log('got pack from server '+data.type)
  240.  
  241.                 if (data.type == 'packetAck'){
  242.                     console.log("acking"+data.counters)
  243.                     for (ack in data.counters){
  244.                         if(data.counters[ack]){
  245.                             if(pendingPackets[data.counters[ack]]){
  246.                                 clearTimeout(pendingPackets[data.counters[ack]].timeout)
  247.                             }
  248.                             delete pendingPackets[data.counters[ack]]
  249.                         }
  250.                     }
  251.                    
  252.                     //return
  253.                 }
  254.                 waitingResponse = false
  255.                 if (data.status){
  256.                     if (data.status == 'notLoggedIn'){
  257.                         console.log("not looged into service...")
  258.                         return;
  259.                     }      
  260.                 }
  261.                 if (data.type == 'proxCmd'){
  262.                     //console.log("got packget from server"+base64js.toByteArray(data.data))
  263.                     writeUSB(base64js.toByteArray(data.data))
  264.                 }
  265.                 if (data.type == 'userReponse'){
  266.                     //print "got packget from server"#, response
  267.                     informUser(data)
  268.                 }
  269.                 if (data.type == 'cardData'){
  270.                     saveCardData(data)
  271.                 }
  272.                 if (data.type == 'actionFinished'){
  273.                     processing = false;
  274.                     clearInterval(serverCheckInterval)
  275.                     serverCheckInterval = null
  276.                 }
  277.                 if (callback){
  278.                     callback()
  279.                 }
  280.                 getFromServer()
  281.                 },
  282.             }).fail(function (a,b,c){
  283.                
  284.                 waitingResponse = false
  285.                 if(b!='abort'){
  286.                     setTimeout(getFromServer, 1000)
  287.                     console.log('error: get request to server failed, trying again')
  288.                 }
  289.                
  290.                 //$('#connectionStatus').html("Could not connect to client, are you sure it's running?")
  291.             });
  292.            
  293.         }
  294.        
  295.        
  296.         function scan(type, callback){
  297.             scanCallback = callback;
  298.             processing = true
  299.             sendToServer([{
  300.                 "type":"userCmd",
  301.                 "cmd": "scan",
  302.                 "data":type    
  303.             }])
  304.         }
  305.         function verify(type, callback){
  306.             verifyCallback = callback;
  307.             processing = true
  308.             sendToServer([{
  309.                 "type":"userCmd",
  310.                 "cmd": "verify",
  311.                 "id":type      
  312.             }])
  313.         }
  314.         function dump(type, callback){
  315.             readCallback = callback;
  316.             processing = true
  317.             sendToServer([{
  318.                 "type":"userCmd",
  319.                 "cmd": "dump",
  320.                 "id":type,
  321.                 "skipFee": feeShown    
  322.             }])
  323.         }
  324.         function copy(id, callback){
  325.             copyCallback = callback
  326.             sendToServer([{
  327.                 "type":"userCmd",
  328.                 "cmd": "clone",
  329.                 "id":id    
  330.             }])
  331.         }
  332.         function snoop(id, callback){
  333.             snoopCallback = callback
  334.             sendToServer([{
  335.                 "type":"userCmd",
  336.                 "cmd": "snoop",
  337.                 "id":id    
  338.             }])
  339.            
  340.         }
  341.     function login(){
  342.         email = $('#username').val()
  343.         pass = $('#password').val()
  344.         $('#regStatus').hide()
  345.         $('#loginForm').fadeTo(500, 0.2)
  346.         $('#loginStatus').hide()
  347.         $.post( cgi+"/login.py", { username: email, password:pass }, function( data ) {
  348.           console.log( data );
  349.             if (data.status){
  350.                 $.get(cgi+"/checkAccount.py", function(data){
  351.                     doLogin(data)
  352.                 })
  353.                
  354.             } else {
  355.                 $('#loginForm').fadeTo(500, 1)
  356.                 $('#loginStatus').show()
  357.                 $('#loginStatus').text(data.result)
  358.             }
  359.         }, "json");
  360.         return false
  361.     }
  362.     function register(){
  363.         email = $('#username').val()
  364.         pass = $('#password').val()
  365.         $('#loginForm').fadeTo(500, 0.2)
  366.         $('#loginStatus').hide()
  367.         $.post( cgi+"/register.py", { username: email, password:pass }, function( data ) {
  368.           console.log( data );
  369.             if (data.status){
  370.                 $('#loginForm').fadeTo(500, 1)
  371.                 $('#regStatus').show()
  372.                 $('#regStatus').text(data.result)
  373.                
  374.             } else {
  375.                 $('#loginForm').fadeTo(500, 1)
  376.                 $('#loginStatus').show()
  377.                 $('#loginStatus').text(data.result)
  378.             }
  379.         }, "json");
  380.     }
  381.     function resetPassword(){
  382.         email = $('#username').val()
  383.         $('#loginForm').fadeTo(500, 0.2)
  384.         $('#loginStatus').hide()
  385.         $.post( cgi+"/resetPassword.py", { username: email}, function( data ) {
  386.           console.log( data );
  387.             if (data.status){
  388.                 $('#loginForm').fadeTo(500, 1)
  389.                 $('#regStatus').show()
  390.                 $('#regStatus').text(data.result)
  391.                
  392.             } else {
  393.                 $('#loginForm').fadeTo(500, 1)
  394.                 $('#loginStatus').show()
  395.                 $('#loginStatus').text(data.result)
  396.             }
  397.         }, "json");
  398.     }
  399.    
  400.     function supportedVersion() {    
  401.         var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
  402.  
  403.         version = raw ? parseInt(raw[2], 10) : false;
  404.         return version >= 61
  405.     }
  406.     function isChrome(){
  407.         return /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
  408.     }
  409.     function supportedBrowser(){
  410.         return isChrome() && supportedVersion()
  411.     }
  412.     jQuery.fn.extend({
  413.         disable: function(state) {
  414.         return this.each(function() {
  415.             this.disabled = state;
  416.             if (state){
  417.                 $(this).parent().addClass('disabledButton')
  418.                 $(this).removeClass('active-button')
  419.             } else {
  420.                 $(this).parent().removeClass('disabledButton')
  421.                 $(this).addClass('active-button')
  422.             }  
  423.         });
  424.         }
  425.     });
  426.     function restartServer(callback){
  427.        
  428.         waitingResponse = false;
  429.         packetCounter = 0
  430.         feeShown = false
  431.         for (d in pendingPackets){
  432.             clearTimeout(d)
  433.         }
  434.         pendingPackets = {}
  435.         if(pendingCall){
  436.             pendingCall.abort()
  437.         }
  438.         clearTimeout(pendingProxPacketsTimeout)
  439.         $.ajax({
  440.             type: "GET",
  441.             url: APIaddress+"?restart=1.py",
  442.             dataType: "jsonp",
  443.             success: function (data) {
  444.             console.log("restarted")
  445.             waitingResponse = false;
  446.             packetCounter = 0
  447.             feeShown = false
  448.             for (d in pendingPackets){
  449.                 clearTimeout(d)
  450.             }
  451.             pendingPackets = {}
  452.             if(pendingCall){
  453.                 pendingCall.abort()
  454.             }
  455.             callback()
  456.             },
  457.         }).fail(function (){
  458.             //waitingResponse = false
  459.             //getFromServer()
  460.             //$('#connectionStatus').html("Could not connect to client, are you sure it's running?")
  461.         });
  462.     }
  463.    
  464.     function startLoading(){
  465.         var opts = {
  466.               lines: 13 // The number of lines to draw
  467.             , length: 28 // The length of each line
  468.             , width: 14 // The line thickness
  469.             , radius: 42 // The radius of the inner circle
  470.             , scale: 1 // Scales overall size of the spinner
  471.             , corners: 1 // Corner roundness (0..1)
  472.             , color: '#000' // #rgb or #rrggbb or array of colors
  473.             , opacity: 0 // Opacity of the lines
  474.             , rotate: 0 // The rotation offset
  475.             , direction: 1 // 1: clockwise, -1: counterclockwise
  476.             , speed: 0.5 // Rounds per second
  477.             , trail: 60 // Afterglow percentage
  478.             , fps: 20 // Frames per second when using setTimeout() as a fallback for CSS
  479.             , zIndex: 2e9 // The z-index (defaults to 2000000000)
  480.             , className: 'spinner' // The CSS class to assign to the spinner
  481.             , top: '50%' // Top position relative to parent
  482.             , left: '50%' // Left position relative to parent
  483.             , shadow: false // Whether to render a shadow
  484.             , hwaccel: false // Whether to use hardware acceleration
  485.             , position: 'absolute' // Element positioning
  486.         }
  487.         var target = document.getElementById('actionArea')
  488.         var spinner = new Spinner(opts).spin(target);
  489.     }
  490.  
  491.     function hideLoading(){
  492.         $('#spinbackground').hide()
  493.         $('.spinner').hide()
  494.         clearTimeout(actionTimeout)
  495.     }
  496.    
  497.     function showLoading(){
  498.         clearTimeout(actionTimeout)
  499.         actionTimeout = setTimeout(showActionTimeoutError, 30000)
  500.         $('#spinbackground').show()
  501.         $('.spinner').show()
  502.     }
  503.  
  504.     function showActionTimeoutError(){
  505.        
  506.        
  507.         $("#timeoutDialog").dialog('open')
  508.        
  509.     }
  510.  
  511.     function closeTimeoutDialog(){
  512.         step(0)
  513.         $("#timeoutDialog").dialog('close')
  514.     }
  515.  
  516.     $( document ).ready(function() {
  517.         startLoading()
  518.         hideLoading();
  519.         $.get(cgi+"/checkAccount.py", function(data){
  520.             if(data.status){
  521.                 doLogin(data)
  522.             } else {
  523.                 $('#loginForm').show()
  524.             }
  525.         })
  526.         $("#timeoutDialog").dialog()
  527.         $("#timeoutDialog").dialog('close')
  528.         $('#loginButton').on('click', login)
  529.         $('#registerButton').on('click', register)
  530.         $('#passwordResetButton').on('click', resetPassword)
  531.        
  532.         if (!isChrome()){
  533.             $('#browserwarning').html("You are using an unsupported browser. Please open this page using Google Chrome.")
  534.         } else if (!supportedVersion()){
  535.             $('#browserwarning').html("You are using an outdated version of Chrome, please update your browser to version 61 or later")
  536.         } else {
  537.             $('#browserwarning').hide()
  538.         }
  539.         disableSteps()
  540.         $("#scanButton").disable(false)
  541.         $("#dialog").dialog({width: Math.min(window.innerWidth, 800)})
  542.         //$("#dialog").dialog( "option", "maxWidth", 800 );
  543.         $("#dialog").dialog('close')
  544.         $("#StatusDialog").dialog()
  545.         $("#StatusDialog").dialog('close')
  546.         $( document ).ready(function() {
  547.             $('#copyrightYear').html((new Date()).getFullYear())
  548.         });
  549.         restartServer(hideLoading)
  550.     });
  551.     function stop(){
  552.         return false
  553.     }
  554.     function disableSteps(){
  555.         $("#verifyButton").disable(true)
  556.         $("#readButton").disable(true)
  557.         $("#copyButton").disable(true)
  558.         $("#snoopButton").disable(true)
  559.         $("#scanButton").disable(true)
  560.         $("#saveButton").disable(true)
  561.     }
  562.     function step(stepID){
  563.         showLoading()
  564.         if (stepID == 0){
  565.             $('#currentStep').html('Step 1 - Scan')
  566.             $('#stepMessage').html('Click "Scan" to begin')
  567.             disableSteps()
  568.             $("#scanButton").disable(false)
  569.             restartServer(hideLoading)
  570.  
  571.         } else if (stepID == 1){
  572.            
  573.             disableSteps()
  574.             scan('all', function (data){
  575.                 hideLoading()
  576.                 if (data && data.responseType=="foundCard"){
  577.                     card = data.cards[0]['data']
  578.  
  579.                     cards = ""
  580.                     canCopy = true
  581.                     for (c in data.cards){
  582.                         cards = cards + data.cards[c]['cardName']+' card, ID: '+data.cards[c]['data']['id'].toUpperCase()
  583.                         if(!data.cards[c]['canBeCopied']){
  584.                             cards = cards +" - <span style=\"color:red;\">This card can't currently be copied</span>"
  585.                             canCopy = false
  586.                         }
  587.                         cards = cards +"<br>"
  588.                     }
  589.  
  590.                     $('#stepMessage').html('Found '+cards+'<br><br>Place the blank card on the Proxmark3 to check it is the right type')
  591.                     if (canCopy){
  592.                         $("#verifyButton").disable(false)
  593.                         $('#currentStep').html('Step 2 - Verify')
  594.                     } else {
  595.                         $('#currentStep').html('Step 1 - Scan')
  596.                         //$('#stepMessage').html('Click "Scan" to begin')
  597.                     }
  598.                    
  599.                 }
  600.                 if (data && data.responseType =="searchFail"){
  601.                     $("#scanButton").disable(false)
  602.                     card = false
  603.                     $('#stepMessage').html('Failed to find card<br><br>Try scanning again with the card in a different position')
  604.                     clearInterval(serverCheckInterval)
  605.                     serverCheckInterval = null
  606.                 }
  607.             })
  608.            
  609.            
  610.         } else if(stepID == 2){
  611.            
  612.             disableSteps()
  613.             verify(card['id'], function(result){
  614.                 hideLoading()
  615.                 if (result['match']){
  616.                     fee = ""
  617.                     if (card['fee']){
  618.                         fee = "<br><br>Reading this card type requires a fee. Proceeding will deduct "+card['fee']+" from your account"
  619.                     }
  620.                     $('#stepMessage').html('&#10004; This is the right type of card! You can proceed to "Read"'+fee)
  621.                     $("#readButton").disable(false)
  622.                     $('#currentStep').html('Step 3 - Read')
  623.                 } else {
  624.                     if (result.userMessage){
  625.                         $('#stepMessage').html('&#10006; '+result.userMessage)
  626.                     } else {
  627.                         $('#stepMessage').html("&#10006; couldn't verify card, please try again")
  628.                     }
  629.                     $("#verifyButton").disable(false)
  630.                 }
  631.             })
  632.            
  633.         } else if (stepID == 3){
  634.             disableSteps()
  635.             dump(card['id'], function(result){
  636.                 hideLoading()
  637.                 if (result['result']){
  638.                     $('#currentStep').html('Step 4 - Copy')
  639.                     $('#stepMessage').html('Card successfully read. Place blank card on the proxmark3 to copy')
  640.                     $("#copyButton").disable(false)
  641.                     $("#saveButton").disable(false)
  642.                 } else {
  643.                     if (result.reason == 'fee'){
  644.                         $('#stepMessage').html('&#10004; This is the right type of card! You can proceed to "Read"<br><span style="font-size:small">Reading this type of card requires a fee. Click "Read" again to proceed, proceeding will deduct 5€ from your account.</span>')
  645.                         feeShown = true
  646.                     } else {
  647.                         if (result.userMessage){
  648.                             $('#stepMessage').html('&#10006; '+result.userMessage)
  649.                         } else {
  650.                             $('#stepMessage').html('Error reading card, please try again')
  651.                         }
  652.                        
  653.                     }
  654.                     $("#readButton").disable(false)
  655.                     $("#saveButton").disable(false)
  656.                 }
  657.             })
  658.         } else if (stepID == 3.5){
  659.             $('#stepMessage').html('In order to read this card, you need to place the proxmark3 between the card and a reader')
  660.         } else if (stepID == 4){
  661.             disableSteps()
  662.             copy(card['id'], function(result){
  663.                 hideLoading()
  664.                 if (result['result']){
  665.                     $('#currentStep').html('Done')
  666.                     $("#saveButton").disable(false)
  667.                     $('#stepMessage').html('&#10004; Complete, card successfully copied')
  668.                 } else {
  669.                     $('#stepMessage').html('Copying failed, please try again')
  670.                     $("#copyButton").disable(false)
  671.                 }
  672.             })
  673.            
  674.            
  675.         }
  676.     }
  677.     function saveCard(){
  678.         sendToServer([{
  679.             "type":"userCmd",
  680.             "cmd": "getCard",
  681.             "cardID":card['id']    
  682.         }])
  683.     }
  684.  
  685.     function saveCardData(data){
  686.         if(data.card.data.join){
  687.             data.card.data = data.card.data.join('')
  688.         }      
  689.         $.post("./copymytag/save.py", data.card, function (data) {
  690.             alert(data.result)
  691.             }
  692.         ).fail(function (a,b,c,d){
  693.             //alert(b)
  694.             console.log(a)
  695.         });
  696.     }
  697.     </script>
  698.  
  699. </head>
  700.     <body>
  701.        
  702.        
  703.  <header class="navbar navbar-inverse navbar-fixed-top" style= "      height: 94px;  background-color: white;" role="banner">
  704.         <div class="container">
  705.             <div class="navbar-header">
  706.                 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
  707.                     <span class="sr-only">Toggle navigation</span>
  708.                     <span class="icon-bar"></span>
  709.                     <span class="icon-bar"></span>
  710.                     <span class="icon-bar"></span>
  711.                 </button>
  712.                 <a class="navbar-brand" href="index.html"><img style="    height: 90px;" src="img/logo.jpg" alt=""></a>
  713.             </div>
  714.             <div class="collapse navbar-collapse">
  715.                 <ul class="nav navbar-nav navbar-right">
  716.                  
  717.                 </ul>
  718.             </div>
  719.         </div>
  720.     </header><!--/header-->
  721.    
  722.  
  723.         <!-- Page Title -->
  724.         <div class="section section-breadcrumbs">
  725.             <div class="container">
  726.                 <div class="row">
  727.                     <div class="col-md-12">
  728.                         <h2 style="color:white">Control Panel</h2>
  729.                         <h4>You are logged in as <span id="welcomeName"></span></h4>
  730.                        
  731.                     </div>
  732.                 </div>
  733.             </div>
  734.         </div>
  735.        
  736.        
  737.         <div class="section">
  738.             <div class="container">
  739.                 <div class="row">
  740.                 <div  class="col-sm-12">
  741.                         <h4 id="browserwarning" style="color:red"></h4>
  742.                         <h4 id="loginbanner">Login to start using the control panel</h4>
  743.                         <div id="wlecomebanner" style="display:none">
  744.                        
  745.                         <h5>Proxmark3 Status: <span id="connectionStatus" style="color: red;">Disconenctd &#10008;</span><span id='connectButton'> - <button onclick="connectUSB()">Connect Now</button></span></h5><br>
  746.                         <div id="actionArea">
  747.                         <div id=stepPanel style="/*margin-left: 8%;*/width: 81%;height: 200px;">
  748.                             <h3 style=" font-weight: bolder;" align="center" ><span id="currentStep">Step 1 - Scan</span></h3>
  749.                             <br><br>
  750.                             <h3 id="stepMessage" style="font-weight: bolder;" align="center" >Click "Scan" to begin</h3><br><br>
  751.                         </div>
  752.                        
  753.                         <ul style="   /* margin-left: -5%;*/list-style: none;" class="breadcrumbs-two">
  754.                             <li style="width:18%" ><button class="active-button" style="width:100%" id='scanButton' onclick="step(1)">Scan</button></li>
  755.                             <li style="width:18%"><button class="test active-button" style="width:100%" id='verifyButton' onclick="step(2)">Verify</button></li>
  756.                             <li style="width:18%"><button class="active-button" style="width:100%" id='readButton' onclick="step(3)">Read</button></li>
  757.                             <li style="width:18%"><button class="active-button" style="width:100%" id='copyButton' onclick="step(4)">Copy</button></li>
  758.                             <li style="width:18%"><button class="active-button" style="width:100%" id='saveButton' onclick="saveCard()">Save</button></li>
  759.                         </ul>  
  760.                         <ul style="     display: none;   margin-left: -5%;list-style: none;" class="breadcrumbs-two">
  761.                             <li style="width:18%" ><button style="width:100%; border: none;  background: none;" disabled></button></li>
  762.                             <li style="width:18%"><button style="width:100%; border: none;  background: none;" disabled></button></li>
  763.                             <li style="width:18%"><button style="width:100%; background-color: #ddd;" id='snoopButton' onclick="step(3.5)">Snoop</button></li>
  764.                         </ul>  
  765.                         <br>
  766.                         </div>
  767.                         <br><br>
  768.                         <button style="width:20%; border: none;  background: none;" disabled></button>
  769.                         <button style="width:10%; border: none;  background: none;" disabled></button>
  770.                         <button class="back-button" style="width:20%;" id='snoopButton' onclick="step(0)">Restart</button>
  771.                    
  772.                         </div>
  773.                            <div id="loginStatus" style="margin:0px 0px 10px 0px;background-color: rgba(255, 0, 0, 0.36);"></div>
  774.                         <form id="loginForm"  style="display:none;padding: 20px;box-shadow:none;" class="modal-content animate" action="login.php" onSubmit="return stop();">
  775.                             <div class="">
  776.                               <label><b>Email</b></label>
  777.                               <input style="    padding: 7px;border-radius: 6px;" id="username" type="text" placeholder="Enter email" name="username" required>
  778.  
  779.                               <label><b>Password</b></label>
  780.                               <input style="    padding: 7px;border-radius: 6px;" id="password" type="password" placeholder="Enter Password" name="password" required>
  781.        
  782.                               <button id="loginButton" style="margin-left:10px" type="submit">Login</button>
  783.                             </div>
  784.  
  785.                            
  786.                           </form>
  787.                    
  788.                     </div>
  789.                 </div>
  790.             </div>
  791.         </div>     
  792.        
  793.      
  794.     </body>
  795. </html>
Add Comment
Please, Sign In to add comment