()
| 840 | } |
| 841 | |
| 842 | public void run() { |
| 843 | gui.btnGetCaptcha.setEnabled(false); |
| 844 | //清洗验证码URL |
| 845 | HttpService service = new HttpService(url); |
| 846 | gui.tfURL.setText(service.toString()); |
| 847 | |
| 848 | try { |
| 849 | byte[][] bytesResResp = Util.requestImage(url,raw); |
| 850 | // BurpExtender.stdout.println("820"); |
| 851 | // byte[] byteRes = bytesResResp[0]; // 只有响应包 |
| 852 | gui.byteRes = bytesResResp[0]; // 只有响应包 |
| 853 | byte[] byteResp = bytesResResp[1]; // 响应头+响应包 |
| 854 | String words = gui.tfWords.getText().trim(); |
| 855 | String token = gui.tfToken.getText().trim(); |
| 856 | // BurpExtender.stdout.println("825"); |
| 857 | |
| 858 | if ( !token.trim().equals("") ) { |
| 859 | gui.tokenwords = extractToken(new String(byteResp) ,token); |
| 860 | if ( gui.tokenwords.length() > 40 ) { |
| 861 | gui.tokenword = gui.tokenwords.substring(0,10) + "...." + gui.tokenwords.substring(gui.tokenwords.length()-10 , gui.tokenwords.length() ); |
| 862 | gui.tfTokenex.setText( gui.tokenword ); |
| 863 | } else { |
| 864 | stdout.println(gui.tokenwords.length()); |
| 865 | gui.tfTokenex.setText( gui.tokenwords ); |
| 866 | } |
| 867 | } else { |
| 868 | gui.tokenwords = ""; |
| 869 | } |
| 870 | if(!words.trim().equals("")){ |
| 871 | |
| 872 | gui.byteImg = dataimgToimg(new String(gui.byteRes) ,words); |
| 873 | |
| 874 | }else { |
| 875 | if (Util.isImage(gui.byteRes)) { |
| 876 | BurpExtender.gui.byteImg = gui.byteRes; |
| 877 | } else if (Util.isImage(new String(gui.byteRes))) { |
| 878 | BurpExtender.gui.byteImg = dataimgToimg(new String(gui.byteRes)); |
| 879 | } else { |
| 880 | gui.lbImage.setIcon(null); |
| 881 | gui.lbImage.setText("获取到的不是图片文件或者未设置关键词!"); |
| 882 | gui.lbImage.setForeground(Color.RED); |
| 883 | return; |
| 884 | } |
| 885 | } |
| 886 | stdout.println( "get:" + Arrays.toString(BurpExtender.gui.byteImg).length()); |
| 887 | // stdout.println("successsuccesssuccesssuccessend\n"); |
| 888 | |
| 889 | ImageIcon icon = Util.byte2img(BurpExtender.gui.byteImg); |
| 890 | BurpExtender.gui.lbImage.setIcon(icon); |
| 891 | BurpExtender.gui.lbImage.setText(""); |
| 892 | } catch (Exception e) { |
| 893 | BurpExtender.stderr.println(e.getMessage()); |
| 894 | }finally { |
| 895 | gui.getBtnGetCaptcha().setEnabled(true); |
| 896 | } |
| 897 | } |
| 898 | } |
| 899 |
nothing calls this directly
no test coverage detected