| 132 | } |
| 133 | |
| 134 | @Test |
| 135 | public void it() throws UnsupportedEncodingException { |
| 136 | // static { |
| 137 | System.getProperties().setProperty("socksProxyHost", "127.0.0.1"); |
| 138 | System.getProperties().setProperty("socksProxyPort", "1080"); |
| 139 | |
| 140 | // } |
| 141 | String Header = |
| 142 | "Content-Length: 29\n" + |
| 143 | "Accept-Encoding: */*\n" + |
| 144 | "User-Agent: PostmanRuntime/7.35.0\n" + |
| 145 | "Connection: close\n"; |
| 146 | HashMap<String, String> headerMap = new HashMap<>(); |
| 147 | String[] lines = Header.split("\n"); |
| 148 | |
| 149 | for (String line : lines) { |
| 150 | String[] parts = line.split(": "); |
| 151 | if (parts.length == 2) { |
| 152 | headerMap.put(parts[0], parts[1]); |
| 153 | } |
| 154 | } |
| 155 | // Pattern ExpPattern =Pattern.compile("jsp"); |
| 156 | // Matcher matcher = ExpPattern.matcher("{\"data\":{\"id\":59,\"path\":\"VIDEO/230824120904159934.jsp\"},\"errMsg\":\"success!\",\"success\":true}"); |
| 157 | // String MatchContent = matcher.group(); |
| 158 | // System.out.println(MatchContent); |
| 159 | |
| 160 | String path = "https://github.com/bcvgh/daydayExp-pocs"; |
| 161 | getFiles("yongyou",headerMap); |
| 162 | // Response response = HttpTools.get(path,headerMap,"Utf-8"); |
| 163 | // String regex = "/tree/main/[0-9a-zA-Z]*\">([0-9a-zA-Z]*)<"; |
| 164 | // Pattern pattern = Pattern.compile(regex); |
| 165 | // Matcher matcher = pattern.matcher(response.getText()); |
| 166 | // while (matcher.find()){ |
| 167 | // System.out.println(matcher.group(1)); |
| 168 | } |
| 169 | // String input = "{\"data\":{\"id\":59,\"path\":\"VIDEO/230824120904159934.jsp\"},\"errMsg\":\"success!\",\"success\":true}"; |
| 170 | // |
| 171 | // // Regular expression to match JSON data containing ".jsp" path |