登录情况下有效。 Web.xml中有个j2me的servlet ![]() else if (ACTION_TYPE.equals("ACTION_VIEW_EMAIL_ATTACHS")) { /* 348 */ String sessionId = dataInputStream.readUTF(); /* 349 */ if (sessionId == null) { /* 350 */ return; /* */ } /* */ /* 353 */ String mbtype = dataInputStream.readUTF(); /* 354 */ String msgid = dataInputStream.readUTF(); /* 355 */ String realFileName = dataInputStream.readUTF(); /* 356 */ String fileName = dataInputStream.readUTF(); /* 357 */ dataOutputStream.writeUTF(MailAdmin.getAttachContent(sessionId, /* 358 */ mbtype, msgid, realFileName, fileName)); /* */ } /* */ } /* */ catch (Exception e) { /* 362 */ e.printStackTrace(); /* */ } /* */ /* 367 */ byte[] bs1 = byte_stream.toByteArray(); /* */ /* 369 */ byte[] bs = ZipUtil.compress(bs1); /* 370 */ response.setContentLength(bs.length); /* 371 */ response.getOutputStream().write(bs); /* */ /* 374 */ response.getOutputStream().flush(); /* */ }
程序使用readUTF()获取数据,然后在357那里调用了MailAdmin.getAttachContent()方法,在MailAdmin.java文件中找到此方法定义: /* */ public static String getAttachContent(String sessionid, String mbtype, String msgid, String realFileName, String fileName) /* */ throws UnsupportedEncodingException /* */ { /* 421 */ MailSession ms = MailMain.s_sessionadmin.getSession(sessionid); /* 422 */ UserInfo userinfo = ms.userinfo; /* 423 */ msgid = /* 424 */ Util.formatRequest(msgid, MailMain.s_os, SysConts.New_InCharSet); /* 425 */ String prefix = ms.temp_path; /* 426 */ String path = prefix + SysConts.FILE_SEPARATOR + userinfo.getUid() + /* 427 */ "@" + userinfo.domain; /* 428 */ path = path + SysConts.FILE_SEPARATOR + /* 429 */ Util.GBToISO(mbtype, ms.encoding, MailMain.s_os); /* 430 */ path = path + SysConts.FILE_SEPARATOR + msgid; /* */ /* 432 */ String realfile = path + SysConts.FILE_SEPARATOR + realFileName; /* 433 */ String strContent = ""; /* */ /* 435 */ if (fileName.endsWith(".txt")) { /* 436 */ FileInputStream fis = null; /* 437 */ byte[] bs = null; /* */ try /* */ { /* 440 */ File f = new File(realfile); /* 441 */ if (f.exists()) { /* 442 */ int iLen = (int)f.length(); /* 443 */ bs = new byte[iLen]; /* 444 */ fis = new FileInputStream(realfile); /* 445 */ fis.read(bs); /* 446 */ fis.close(); /* */ } /* */ } catch (Exception localException) { /* */ } /* */ try { /* 451 */ if (fis != null) /* 452 */ fis.close(); /* */ } /* */ catch (Exception localException1) { /* */ } /* 456 */ if (bs != null) /* 457 */ strContent = new String(bs, ServerConf.s_Default_Encoding); /* 458 */ } else if (fileName.endsWith(".pdf")) { /* 459 */ strContent = PDFUtil.getTextFromPDF(realfile); /* 460 */ } else if (fileName.endsWith(".doc")) { /* 461 */ strContent = POIUtil.getTextFromWord(realfile); /* 462 */ } else if (fileName.endsWith(".ppt")) { /* 463 */ strContent = POIUtil.getTextFromPowerPoint(realfile); /* 464 */ } else if (fileName.endsWith(".xls")) { /* 465 */ strContent = POIUtil.getTextFromExcel(realfile); /* */ } /* 467 */ strContent = Util.replace(strContent, "\r", ""); /* 468 */ return strContent; /* */ }
最终的读取的文件路径realfile由以下的数据组成: String realfile = path + SysConts.FILE_SEPARATOR + realFileName; 控制realFileName参数的值即可浏览文件,下面用writeUTF构造POST数据(注意需要登录之后的sessionid): 混淆代码过滤数据你懂的 |
-
上一篇: 百度开放平台某SQL注入 - 网站安全 - 自学php
下一篇: 百度云加速/加速乐/安全宝/360等所有waf产品某些
还没有人抢沙发呢~