CTFshow_web_Upload

151-170

web151(ǰ����֤�����)

  • ����
  1. ľ���ļ�����Ϊeval.png���ϴ�ʱʹ��bpץ������filename���޸�eval.pngΪeval.php
    1. ֻ����png
  2. ����/upload/eval.php
  3. ʹ��antsword����/upload/eval.php��Ȼ�󼴿�
  • �ļ��ϴ�����֪ʶ��
  1. ������ץ���ķ�����ֱ�Ӷ�ǰ���ļ������޸�
    1. F12�򿪼��
    2. �ҵ�ǰ����֤�Ĵ���
    3. ���������޶��ļ������ļ������޸�Ϊphp��
    4. �ϴ����ں��Ŵ����php�ļ�
    5. ���ø��ļ�

web152(�����֤��һ)

  • ����
  1. ��������web151һģһ��
  • �ļ��ϴ�����֪ʶ��
  1. ��࿴Դ�룬type=button���п�������Ϣ
    1. �����пɲ鵽<button type=”button” class=”layui-btn” id=”upload” lay-data=”{url: ‘upload.php’, accept: ‘images’,exts:’png’}”>��chat����˵ʹ��Layui��ܣ�ע��accept �� exts����
  • �ļ��ϴ�����֪ʶ��
  1. ��������ӵĺ�����޷�ʹ���޸�ҳ��js�����������ƹ��ģ�becuase��˻���Content-Type���ݼ�mime type
    1. ֻ��mime type���м�����Ի�����ʹ��bpץ���ķ��������ƹ�

web153(user.ini+include)

  • ����
  1. ����auto_prepend_file=1.png����Ϊ.user.ini���ļ��ϴ�(����Ҫbpץ������)
  2. Ȼ���ϴ��ں�һ�仰ľ����.png�ļ��Զ������ļ�����
  3. ���������һ����
    1. ע�⣺�Ͻ�������ʹ�õ���…/upload/index.phps
  • �ļ��ϴ�֪ʶ�㲹��
  1. ��CTFER_�ļ��ϴ�
  2. php���ǰ(��������ǰ)����ʹ��@�����ⱨ��(�κ��������error)

web154(user.ini+�ļ�����У��)

  • ����
  1. ץ�����汾php 7,nginx 1.6������ûɶ��00�ض�Ҳ�ò���
  2. �鿴upload����index.php��url�п��Կ���Ҳ���Դ��н���ó�
  3. �ϴ�.user.ini���ֿ��У��ϴ�php�ļ��������ݼ�飬����php��ػ���ħ��ͷ���Ƚ�<?php��Ϊ<?=���ֿ���antsword������
    1. �˴�û��ʹ��<??>������̱�ǩʹ����Ҫ����ij������

web155(ͬweb154 pass)

web156-159(web154-web159����ʹ��fuzz+.user.ini)

  • web156
  1. �����ʹ�õĶ�[]���й��ˣ�ʹ��{}�������
  2. <?= @eval($_POST{“shell”})?>
  • web157
  1. ������{}��[]��php
  2. ����ֱ���ϴ�����ִ���ļ�������linux�п���cat ../flag.???
  • web158
  1. ǰ������Ϲ�����;�ֺţ���php��?>û��Ӱ��
  2. payloadֱ������ִ�м���
  • web159
  1. ��ǰ��Ļ����Ϲ���()���ţ�����ֱ��ʹ�÷�����``������ֱ��ʹ������ִ��
  2. payload:
  • �ļ��ϴ�����֪ʶ��
  1. web156��php��$_POST�������ʹ��{}������������Ԫ�أ�������[]ʱ����ʹ��
  2. web157��linux������ִ�п�����???���ϴ�����ľ�����Կ�������ִ��
    1. �ϴ�includeʵ����Ҳû���ϴ�ľ����ûʲô���ã����ÿ���ļ����м��
    2. but include�п��Խ��а�����־�����ļ��ϴ�ת���ļ��ϴ��ĵ�����(web159����ʹ��log�ķ���)
    3. �����Խ��php://filter�����ʹ��
  3. web159������ʹ��include log�ķ���û�гɹ�
    1. �ؼ����ƹ�����ʹ��.�������ַ���ƴ��

web160(��־�ļ�����)

  • ���ⲽ��
  1. Դ�룬uploadĿ¼�����������Ͱ汾������.user.ini
  2. Ȼ��include��־������������ʵ�������Dz����пո�(ʹ��bp����)
  3. ������־�ļ�nginx��/var/log/nginx/access.log
  • �ļ��ϴ�֪ʶ�㲹��
  1. ������ݺ��������˿���ʹ��bp����fuzz
  2. �ļ���������������ʹ��αЭ��
    1. payload��<?=include”ph”.”p://filter/convert.base64-encode/resource=../flag.p”.”hp”?>

web161(ħ��ͷ+��־�ļ�����)

  • ���ⲽ��
  1. ��Դ�룬��/upload��ץ�����汾�������
  2. �ϴ�.user.ini���ԣ��ϴ�upload.png���У���wp���Ǽ�ħ��ͷ
  • �ļ��ϴ�֪ʶ�㲹��
  1. ħ��ͷ�����CTFER_�ļ��ϴ�
  2. ��־�������ɣ����ua��д�������ֱ��д��get����post�У�������url������ܹ�����
    1. ua��д�����ʱ�ᱨ������1δ���壬1�������ǵ�key��˵���Ѿ�ֲ����