text stringlengths 100 9.93M | category stringclasses 11
values |
|---|---|
import struct, string
data=open("dump","rb").read()
events=[]
for i in range(len(data)/24):
ev=data[i*24:i*24+24]
time=ev[:16]
ev=ev[16:]
tp=ev[:2]
ev=ev[2:]
code=ev[:2]
ev=ev[2:]
val=ev
events.append( ( struct.unpack("<H",tp)[0], struct.unpack("<H",code)[0], struct.unpack("<I",val)... | sec-knowleage |
# Floppy
Misc.
## Description:
> Using the credentials from the letter, you logged in to the Foobanizer9000-PC. It has a floppy drive...why? There is an .ico file on the disk, but it doesn't smell right..
A binary file was attached.
## Solution:
Let's inspect the attached file:
```console
root@kali:/media/sf_CTFs/googl... | sec-knowleage |
runlevel
===
打印当前Linux系统的运行等级
## 补充说明
**runlevel命令** 用于打印当前Linux系统的运行等级。
### 语法
```shell
runlevel
```
### 知识扩展
linux操作系统自从开始启动至启动完毕需要经历几个不同的阶段,这几个阶段就叫做runlevel,同样,当linux操作系统关闭时也要经历另外几个不同的runlevel,下面我们就准备详细介绍一下runlevel,并向您展示一些小技巧来让您的linux系统避免不必要的重启动。
runlevel可以认为是系统状态,形象一点,您可以认为runlevel有点象微软的windows操作系统中的Normal,safemo... | sec-knowleage |
# rop chain
Binary Exploitation, 350 points
## Description:
> Can you exploit the following program and get the flag?
```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdbool.h>
#define BUFSIZE 16
bool win1 = false;
bool win2 = false;
void win_function... | sec-knowleage |
# 十四、XML 外部实体注入
> 作者:Peter Yaworski
> 译者:[飞龙](https://github.com/)
> 协议:[CC BY-NC-SA 4.0](http://creativecommons.org/licenses/by-nc-sa/4.0/)
XML 外部实体(XXE)漏洞涉及利用应用解析 XML 输入的方式,更具体来说,应用程序处理输入中外部实体的包含方式。为了完全理解理解如何利用,以及他的潜力。我觉得我们最好首先理解什么是 XML 和外部实体。
元语言是用于描述其它语言的语言,这就是 XML。它在 HTML 之后开发,来弥补 HTML 的不足。HTML 用于定义数据的展示,专注于它应该是什么... | sec-knowleage |
### Dynamic Sections.interp
这个节包含了程序对应的解释器。
参与动态链接的可执行文件会具有一个 PT_INTERP 类型的程序头元素,以便于来加载程序中的段。在 exec (BA_OS) 过程中,系统会从该节中提取解释器的路径,并根据解释器文件的段创建初始时的程序镜像。也就是说,系统并不使用给定的可执行文件的镜像,而会首先为解释器构造独立的内存镜像。因此,解释器需要从系统处获取控制权,然后为应用程序提供执行环境。
解释器可能有两种方式获取控制权。
1. 它可以接收一个指向文件头的文件描述符,以便于读取可执行文件。它可以使用这个文件描述符来读取并将可执行文件的段映射到内存中。
2. 有时候根据可执行文件格式... | sec-knowleage |
# Web安全扫描概述
安全扫描:针对Web应用脆弱性识别的一种行为。
## 为什么需要做Web安全扫描?
* 手工安全测试所需时间周期较长,不能满足快速交付的需求;
* 弥补安全测试人员知识技能层面不足;
* 避免安全测试过程中的由于测试人员惰性造成的遗漏;
## 目前Web扫描器能做到什么?
* 基于OWASP Top 10的常规漏洞检测;
* 基于特定的漏洞检测,如:struts2
## 目前Web扫描器的缺点是什么?
* 误报严重,也存在一定程度的漏报,主要是由于扫描规则导致;
* 不能完美支持业务逻辑漏洞的探测;
* 对系统造成脏数据、服务不可用等安全风险;
## 如何改进Web扫描器的缺点?
* 针对扫描规则:完善常规漏... | sec-knowleage |
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
.TH B2SUM 1 2022年9月 "GNU coreutils 9.... | sec-knowleage |
# Photographer 1
> https://download.vulnhub.com/photographer/Photographer.ova
靶场IP:`192.168.32.220`
扫描对外端口服务
```
┌──(root💀kali)-[/tmp]
└─# nmap -p 1-65535 -sV 192.168.32.220 ... | sec-knowleage |
.TH "CLUSTERDB" "1" "2003-11-02" "Application" "PostgreSQL Client Applications"
.SH NAME
clusterdb \- 对一个PostgreSQL数据库进行建簇
.SH SYNOPSIS
.sp
\fBclusterdb\fR\fR [ \fR\fB\fIconnection-option\fB\fR...\fB \fR\fR]\fR\fR [ \fR\fB--table | -t \fItable\fB \fR\fR]\fR\fR [ \fR\fB\fIdbname\fB \fR\fR]\fR
\fBclusterdb\fR\fR [ \fR\f... | sec-knowleage |
# 总结
## 古典密码分析思路
CTF 中有关古典密码的题目,通常是根据密文求出明文,因此采用**唯密文攻击**居多,基本分析思路总结如下:
1. 确定密码类型:根据题目提示、加密方式、密文字符集、密文展现形式等信息。
2. 确定攻击方法:包括直接分析、蛮力攻击、统计分析等方法。对于无法确定类型的特殊密码,应根据其密码特性选用合适的攻击方法。
3. 确定分析工具:以在线密码分析工具与 Python 脚本工具包为主,以离线密码分析工具与手工分析为辅。
以上唯密文攻击方法的适用场景与举例如下:
| 攻击方法 | 适用场景 | 举例 ... | sec-knowleage |
"""
Django settings for cve201914234 project.
Generated by 'django-admin startproject' using Django 2.2.3.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import ... | sec-knowleage |
# SCS7 (crypto, 112p, 134 solved)
In the challenge we get access to a blackbox encryption service.
```
$ nc crypto.chal.ctf.westerns.tokyo 14791
encrypted flag: LY7Gj9deCPzsXNpp0SQcyp9XmtvqUn0ddkWNGFX1AHTbT3mn5uYcu7RbAZ10Tuxp
You can encrypt up to 100 messages.
message: aa
ciphertext: wg9
```
The service gives us ciphe... | sec-knowleage |
# 第9章 两分钟的训练——从零到英雄
> 译者:[@Snowming](https://github.com/Snowming04)
>
> 校对者:@匿名jack

随着时间的推移,直到测试的最后一天你都还没有从目标外部网络取得比较好的突破。因为你需要进入目标内网,了解他们公司的网络布局,获得一些敏感文件或者代码,然后找到更多的网段和高权限用户,最终需要拿到 Cyber Space Kittens 公司太空计划的相关资料,此时你感觉压力很大。你的任务是窃取最新的太空计划相关的绝密信息并且不能失败...现在是两分钟操练的时候了。只剩一点点时间了,你需要从10码线开始... | sec-knowleage |
# Aapche Dubbo Unsafe Java Deserialization (CVE-2019-17564)
[中文版本(Chinese version)](README.zh-cn.md)
Apache Dubbo is a high-performance, java based open source RPC framework.
Apache Dubbo supports different protocols, and its HTTP protocol handler is a wrapper of Spring Framework's `org.springframework.remoting.http... | sec-knowleage |
**注:**请多喝点热水或者凉白开,可预防**肾结石,通风**等。
痛风可伴发肥胖症、高血压病、糖尿病、脂代谢紊乱等多种代谢性疾病。
**攻击机:**
192.168.1.5 Debian
**靶机:**
192.168.1.4 Windows 7
192.168.1.119 Windows 2003
### 攻击机配置:
payload:windows/meterpreter/reverse_tcp
```bash
msf exploit(multi/handler) > show options
Module options (exploit/multi/handler):
Name Current Se... | sec-knowleage |
# Buenos Aires - Conference
Category: Misc.
## Description
> You arrive at the location through the coordinates that you got from the assassin, a luxurious yacht. A fat, bald man lies on a puma couch. He sips on a dry martini, smokes the biggest cigar you've ever seen and when he smiles, a golden tooth is revealed. You... | sec-knowleage |
### 最后一次异常法概述
最后一次异常法的原理是, 程序在自解压或自解密过程中, 可能会触发无数次的异常. 如果能定位到最后一次程序异常的位置, 可能就会很接近自动脱壳完成位置. 现在最后一次异常法脱壳可以利用Ollydbg的异常计数器插件, 先记录异常数目, 然后重新载入, 自动停在最后一次异常处.
### 最后一次异常法概述要点
1. 点击`选项->调试选项—>异常`, 把里面的√全部去掉! 按下`CTRL+F2`重载下程序
2. 开始程序就是一个跳转, 在这里我们按`SHIFT+F9`, 直到程序运行, 记下从开始按`SHIFT+F9`到程序运行的次数`m`!
3. `CTRL+F2`重载程序, 按`SHIFT+F9`(这次... | sec-knowleage |
import os
import re
ARCHIVE_FILE_PATTERN = re.compile(r'^.*\.(tar\.gz|zip|7z|rar|exe|jar|xz|gz|tar|war)$', re.I)
ARCHIVE_EXCEPTED = re.compile(r'[/\\](struts2|CVE-2016-9086|weblogic[/\\]weak_password)[/\\]')
LOWERCASE_EXT_EXCEPTED = re.compile(r'[/\\]\.pytest_cache[/\\]')
def test_filename():
"""
We are not... | sec-knowleage |
msf 内置关于 mssql 插件如下(部分非测试mssql 插件)

关于msf常用攻击mssql插件如下:
1. auxiliary/admin/mssql/mssql_enum
2. auxiliary/admin/mssql/mssql_enum_sql_logins
3. auxiliary/admin/mssql/mssql_escalate_dbowner
4. auxiliary/admin/mssql/mssql_exec
5. auxiliary/admin/mssql/mssql_sql
6... | sec-knowleage |
# Argument Injection
Argument injection is similar to command injection as tainted data is passed to to a command executed in a shell without proper sanitization/escaping.
It can happen in different situations, where you can only inject arguments to a command:
- Improper sanitization (regex)
- Injection of arguments in... | sec-knowleage |
# 缓存
<!-- GFM-TOC -->
* [缓存](#缓存)
* [一、缓存特征](#一缓存特征)
* [二、缓存位置](#二缓存位置)
* [三、CDN](#三cdn)
* [四、缓存问题](#四缓存问题)
* [五、数据分布](#五数据分布)
* [六、一致性哈希](#六一致性哈希)
* [七、LRU](#七lru)
* [参考资料](#参考资料)
<!-- GFM-TOC -->
## 一、缓存特征
### 命中率
当某个请求能够通过访问缓存而得到响应时,称为缓存命中。
缓存命中率越高,缓存的利用率也就越高。
### 最大空间
缓存通常位于内存中,内存的空间... | sec-knowleage |
# Episode 0: Challenge 1
## Description
> A clean and fair game of chess. Careful though, this is not a game for grandmasters to win.
>
> Hint: Don't make this game harder than it needs to be.
A link to an online chess game was attached.
## Solution
The link leads us to an online chess game called "Hacker Chess". In ... | sec-knowleage |
#2016移动安全事记
时间线
- 0x00
- 1.6 [“百脑虫”手机病毒分析报告](http://blogs.360.cn/360mobile/2016/01/06/analysis_of_bainaochong/)
于15年末,360移动安全团队发现,以功能模块形式捆绑在各类应用中,可进行提权、替换系统启动脚本、对抗安全工具、静默"推广"应用等。
- 1.8 [京东钱包越权查询之任意查看两账户之- 0x间的转账信息](http://www.wooyun.org/bugs/wooyun-2016-0168304)
年初,白帽子[骑虎打狗](http://www.wooyun.org/whitehats/%E9%A... | sec-knowleage |
# Dogestore (crypto, 267p, 27 sovled)
In the task we get [server code](fragment.rs), [encrypted flag](encrypted_secret) and endpoint to connect to.
What the code does is pretty simple, even if you don't know Rust:
1. Read input bytes from user.
2. Decrypt the data using AES-CTR.
3. Deserialize the data by matching neig... | sec-knowleage |
---
title: Docker
date: 2020-12-30 10:55:24
background: bg-[#488fdf]
tags:
- container
- virtual
categories:
- Programming
intro: |
This is a quick reference cheat sheet for [Docker](https://docs.docker.com/get-started/). And you can find the most common Docker commands here.
plugins:
- copyCode
---... | sec-knowleage |
mkcert
===
用来生成自签证书的工具
## 示例
`mkcert` 是 GO 编写的,一个简单的**零配置**的用来生成自签证书的工具。
下面给一个简单的示例,在本地生成自签证书,并使用让 nc 使用生成的证书。
```zsh
~ ········································································································································· 10:46:25
❯ mkcert -install
The local CA is already installed... | sec-knowleage |
.\" (C) Copyright 1992-1999 Rickard E. Faith and David A. Wheeler
.\" (faith@cs.unc.edu and dwheeler@ida.org)
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to... | sec-knowleage |
---
title: Pocket
date: 2022-11-23 16:23:31.702053
background: bg-[#d54d57]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 36 keyboard shortcuts found on Pocket for Web
---
Keyboard Shortcuts
------------------
### Viewing Your List
Shortcut | Action
---|---
... | sec-knowleage |
# Metabase Pre-Auth Local File Inclusion (CVE-2021-41277)
[中文版本(Chinese version)](README.zh-cn.md)
Metabase is an open source data analytics platform. In affected versions (x.40.0-x.40.4) a security issue has been discovered with the custom GeoJSON map (`admin->settings->maps->custom maps->add a map`) support, unauth... | sec-knowleage |
# Aria2 任意文件写入漏洞
Aria2是一个命令行下轻量级、多协议、多来源的下载工具(支持 HTTP/HTTPS、FTP、BitTorrent、Metalink),内建XML-RPC和JSON-RPC接口。在有权限的情况下,我们可以使用RPC接口来操作aria2来下载文件,将文件下载至任意目录,造成一个任意文件写入漏洞。
参考文章:[https://paper.seebug.org/120/][1]
## 环境搭建
启动漏洞环境:
```
docker compose up -d
```
6800是aria2的rpc服务的默认端口,环境启动后,访问`http://your-ip:6800/`,发现服务已启动并且返回... | sec-knowleage |
from django.shortcuts import render, HttpResponse
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import D
from django.contrib.gis.db.models.functions import Distance
from django.contrib.gis.db.models import Union
from .models import Collection, Collection2
# Create your views here.
def vuln... | sec-knowleage |
# apache-users包说明
这个Perl脚本程序会列出所有使用Apache UserDir模块中的用户名
[apache-users首页](https://labs.portcullis.co.uk/) | [Kali apache-users仓库](http://git.kali.org/gitweb/?p=packages/apache-users.git;a=summary)
作者: Andy@Portcullis
协议: GPLv2
apache-users包中的工具
apache-users – 列举在Apache UserDir模块中的用户名
```
root@kali:~# apache-users
USAGE... | sec-knowleage |
# 黑灰产情报生产概论
## 数据源
### 真实设施中采集
从黑灰产的真实设施中进行数据的采集。
### 监控中间平台
分析黑灰产链条,**监控**上下游聚集并在进行信息、物品交换的**中间平台**。

图:业务安全情报的生产 - 数据来源[1]
## 数据加工
### 数据提炼
#### 要素采集
以下是一个QQ群组监控中进行**要素(自己定义:在黑产事件中的可观察指标,称为黑产要素)**采集的归类。
P.S. 这是... | sec-knowleage |
# Struts2 S2-057 远程命令执行漏洞(CVE-2018-11776)
当Struts2的配置满足以下条件时:
- alwaysSelectFullNamespace值为true
- action元素未设置namespace属性,或使用了通配符
namespace将由用户从uri传入,并作为OGNL表达式计算,最终造成任意命令执行漏洞。
影响版本: 小于等于 Struts 2.3.34 与 Struts 2.5.16
漏洞详情:
- https://cwiki.apache.org/confluence/display/WW/S2-057
- https://lgtm.com/blog/apache_... | sec-knowleage |
import sys
data = "010001110101111001100011011011100100100100111001010111100100011101000111001110010100011100111001010001110011100101000111001110010101111001100011011011100100100101101110010010010011100100110101010111100110001100111001001101010110111001001001011011100100100101000111010111100011100100110101011011100100... | sec-knowleage |
# EVM: 1
> https://download.vulnhub.com/evm/EVM.ova
靶场IP:`192.168.32.11`
扫描对外端口服务
```
┌──(root㉿kali)-[~]
└─# nmap -sV -p1-65535 192.168.32.11
Starting Nmap 7.92 ( https://nmap.org ) at 2022-09-08 04:16 EDT
Nmap scan report for 192.168.32.11
Host is up (0.00019s latency).
Not shown: 65528 closed tcp ports (reset)
PORT ... | sec-knowleage |
#!/usr/bin/env python3
import requests
import argparse
from bs4 import BeautifulSoup
def get_args():
parser = argparse.ArgumentParser( prog="drupa7-CVE-2018-7602.py",
formatter_class=lambda prog: argparse.HelpFormatter(prog,max_help_position=50),
epilog= '''
... | sec-knowleage |
[返回目录](README-zh.md)
### Hackerone 公开漏洞统计
目前为止,Hackerone 平台已经发现 1731 个公开的漏洞,主要来自 Twitter、Uber、Dropbox、Github 等公司。其中 8 个已经删除,9 个来自互联网或者特定的语言,剩下的 1714 个中,有 1359 个我们可以通过代码或者人工的方式进行分类。
#### 按照错误的类型划分
| 类型 | 数量 | 占比 |
| --- | --- | --- |
| 用户输入过滤 | 481 | 27.8
| 其他代码问题 | 549 | 31.7
| 配置问题... | sec-knowleage |
unzip
===
用于解压缩由zip命令压缩的压缩包
## 补充说明
**unzip命令** 用于解压缩由zip命令压缩的“.zip”压缩包。
### 语法
```shell
unzip(选项)(参数)
```
### 选项
```shell
-c:将解压缩的结果显示到屏幕上,并对字符做适当的转换;
-f:更新现有的文件;
-l:显示压缩文件内所包含的文件;
-p:与-c参数类似,会将解压缩的结果显示到屏幕上,但不会执行任何的转换;
-t:检查压缩文件是否正确;
-u:与-f参数类似,但是除了更新现有的文件外,也会将压缩文件中的其他文件解压缩到目录中;
-v:执行时显示详细的信息;
-z:仅显示压缩文件的备注文字;
-a:对文本文... | sec-knowleage |
# 相关产品
本篇整理态势感知相关产品。
## 国内
[1] 泰坦人工智能安全态势感知——《互联网资产管理与漏洞运营实践
&安全产品线》,华泰证券,https://cloud.ssetech.com.cn/p/DUf-3PEQtwcY7gg
\[2] 盛华安,https://www.cyberskysec.com/
## 国外
## 列表
[1] Reviews for Security Information and Event Management (SIEM) Market,Gartner公司整理的安全信息与事件管理系统(SIME)产品矩阵图,https://www.gartner.com/reviews/market/sec... | sec-knowleage |
#include <cstdio>
#define PRE 1000000000
short pre[PRE];
typedef unsigned long long ull;
ull collatz(ull n){
if(n%2 == 0){
return n/2;
}
return n*3+1;
}
short collatzcnt(ull n){
if(n>=PRE){
return 1+collatzcnt(collatz(n));
}
if(pre[n]==-1){
pre[n]=1+collatzcnt(collatz(n));
}
return pre[n];
}
ull fib... | sec-knowleage |
# 数据分析相关
对于黑灰产的分析,会用到数据分析相关的知识。从数据获取——数据预处理——数据整合——数据分析——数据可视化/形成报告。在风控这块,最后能还原攻击特征,甚至写一些自动化监测、分析的脚本,最后能将这些特征加入风控规则内。
### 资料整合
整合一些和企业安全相关的数据分析资料
- 安全数据分析:[Link](https://github.com/secure-data-analysis-data-sharing/data-analysis)
- 企业安全相关:[Link](https://github.com/AnyeDuke/Enterprise-Security-Skill)
- 科来,网络通讯协议图:[Link]... | sec-knowleage |
name: Update dockerhub
on:
push:
branches:
- 'master'
- 'ci-docker'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ se... | sec-knowleage |
---
title: Slack
date: 2022-11-23 16:23:31.705147
background: bg-[#4d1a51]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 62 keyboard shortcuts found in Slack
---
Keyboard Shortcuts
------------------
### Navigation {.row-span-4}
Shortcut | Action
---|---
`Ta... | sec-knowleage |
# the stuff (Misc, 50pts, 219 solves)
Can you believe Ryan uses Bing?
The pcap file we got, contained a mail exchange. In one of the mails, there was
a password, and the other one contained an attached zip file. Opening it using
password we had, gave us flag.
 | sec-knowleage |
vgdisplay
===
显示LVM卷组的信息
## 补充说明
**vgdisplay命令** 用于显示LVM卷组的信息。如果不指定"卷组"参数,则分别显示所有卷组的属性。
### 语法
```shell
vgdisplay(选项)(参数)
```
### 选项
```shell
-A:仅显示活动卷组的属性;
-s:使用短格式输出的信息。
```
### 参数
卷组:要显示属性的卷组名称。
### 实例
使用vgdisplay命令显示存在的卷组"vg1000"的属性。在命令行中输入下面的命令:
```shell
[root@localhost ~]# vgdisplay vg1000 #显示卷组"vg1000"的属... | sec-knowleage |
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de ... | sec-knowleage |
**前者的话:**从第三季开始引入段子,让本枯燥的学术文章,也变得生动有趣。
第二季的Demo遵循人性五条来设计,回忆这其中五条:
**1:攻击方与防御方的本质是什么?**
增加对方的时间成本,人力成本,资源成本(不限制于服务器资源),金钱成本。
**2:安全公司的本质是什么?**
盈利,最小投入,最大产出。
**3:安全公司产品的本质是什么?**
能适应大部分客户,适应市场化,并且适应大部分机器。(包括不限制于资源紧张,宽带不足等问题的客户)
**4:安全人员的本质是什么?**
赚钱,养家。买房,还房贷。导致,快速解决客户问题(无论暂时还是永久性解决),以免投诉。
**5:对接客户的本质是什么?**
对接客户也是某... | sec-knowleage |
# Kafka Manager 未授权访问漏洞
## 漏洞描述
Kafka Manager是一款用于管理和监控Apache Kafka集群的工具。如果Kafka Manager未正确配置并对外开放,攻击者可能会未授权访问Kafka Manager,从而获取敏感信息,如Kafka集群的配置和使用情况。
此外,如果攻击者具有足够的权限,他们还可以操作Kafka集群,如创建主题、修改配置等,对系统造成威胁。
## 环境搭建
zookeeper
```
docker run -d -p 2181:2181 -e TZ="Asia/Shanghai" wurstmeister/zookeeper:latest
```
kafka-manag... | sec-knowleage |
# lagalem (crypto, 35 solved, 246p)
In the challenge we get [source code](problem.py) and [result](transcript.txt) of this code when executed with the flag present.
Our goal is to use the outputs to recover the original flag.
The encryption itself is:
```python
def encrypt(pubkey, m):
g, h, A, B, p, q = pubkey
... | sec-knowleage |
# CTF 竞赛内容
由于 CTF 的考题范围其实比较宽广,目前也没有太明确的规定界限说会考哪些内容。但是就目前的比赛题型而言的话,主要还是依据常见的 **Web 网络攻防、RE 逆向工程、Pwn 二进制漏洞利用、Crypto 密码攻击、Mobile
移动安全** 以及 **Misc 安全杂项** 来进行分类。
- **Web - 网络攻防**
主要介绍了 Web 安全中常见的漏洞,如 SQL 注入、XSS、CSRF、文件包含、文件上传、代码审计、PHP 弱类型等,Web 安全中常见的题型及解题思路,并提供了一些常用的工具。
- **Reverse Engineering - 逆向工程**
主要介绍了逆向工程... | sec-knowleage |
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.5.
.\"*******************************************************************
.\"
.\" This file was generated with po4a. Translate the source file.
.\"
.\"*******************************************************************
.TH UNEXPAND 1 2022年9月 "GNU coreutils... | sec-knowleage |
import hashlib
import string
charset = string.printable
sought = '9F46A92422658F61A80DDEE78E7DB914'.decode('hex')
for o1 in map(ord, charset):
o3 = o1 ^ (0xa7 ^ 0xc3)
o8 = o1 ^ (0x89 ^ 0xf5)
o2 = o3 ^ (0x48 ^ 0x48)
o5 = o2 ^ (0x55 ^ 0x0d)
o9 = o3 ^ (0xe5 ^ 0xaf)
o0 = o3 ^ o5 ^ o9 ^ (0x48 ^ 0x4... | sec-knowleage |
#!/usr/bin/python
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from builtins import input
from builtins import str
import urllib.request, urllib.error, urllib.parse
import time
import sys
import os
import subprocess
import requests
import readline
import ... | sec-knowleage |
hwclock
===
显示与设定硬件时钟
## 补充说明
**hwclock命令** 是一个硬件时钟访问工具,它可以显示当前时间、设置硬件时钟的时间和设置硬件时钟为系统时间,也可设置系统时间为硬件时钟的时间。
在Linux中有硬件时钟与系统时钟等两种时钟。硬件时钟是指主机板上的时钟设备,也就是通常可在BIOS画面设定的时钟。系统时钟则是指kernel中的时钟。当Linux启动时,系统时钟会去读取硬件时钟的设定,之后系统时钟即独立运作。所有Linux相关指令与函数都是读取系统时钟的设定。
### 语法
```shell
hwclock(选项)
```
### 选项
```shell
--adjust:hwclock每次更改硬件时... | sec-knowleage |
# 其它类型加密
## 培根密码
### 原理
培根密码使用两种不同的字体,代表 A 和 B,结合加密表进行加解密。
| a | AAAAA | g | AABBA | n | ABBAA | t | BAABA |
| --- | ----- | --- | ----- | --- | ----- | --- | ----- |
| b | AAAAB | h | AABBB | o | ABBAB | u-v | BAABB |
| c | AAABA | i-j | ABAAA | p | ABBBA | w | BABAA |
| d | AAABB | k | ABAAB |... | sec-knowleage |
# QR code
Network
## QR recovery (150 points)
> Woops, our graphic designer added some special effects, and now it looks like it's not possible to scan our QR code anymore... Can you recover it?
The following file was provided:

This looks like a QR code for which a twirl effect was applied ... | sec-knowleage |
**连载2:**
在上一篇连载中讲到powershell可无缝来调.net framework。而在实战中,内网的代理尤其重要,如常见的端口转发被反病毒软件盯死。本章无图,其他同学如有环境测试,可补图。
介绍 github:
https://raw.githubusercontent.com/p3nt4/Invoke-SocksProxy/master/Invoke-SocksProxy.psm1
### Examples
**Create a Socks 4/5 proxy on port 1234:**
```bash
Import-Module .\Invoke-SocksProxy.psm1
Invoke-S... | sec-knowleage |
# Hello World! - FLAG0
## 0x00 Index
The home page is looks like the following.

And it will print out hello xyz when you send whatever via a get request.
[http://127.0.0.1/xxxxxxxxxx/?stdin=world][1]

[http://127.0.0.1/xxxxxxxxxx/?stdin=0123456789012345678901234567890123456789][... | sec-knowleage |
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\" Copyright (c) 2000 Scriptics Corporation.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS... | sec-knowleage |
# T1218-001-win-编译HTML文件
## 来自ATT&CK的描述
攻击者可能会滥用编译的HTML文件(.chm)来掩盖恶意代码。CHM文件通常作为微软HTML帮助系统的一部分分发。CHM文件是各种内容的压缩汇编,如HTML文档、图像和脚本/网络相关编程语言,如VBA、JScript、Java和ActiveX。CHM内容的显示是使用由HTML帮助可执行程序(hh.exe)加载的Internet Explorer浏览器的底层组件。
一个包含有效载荷的自定义CHM文件可以被传递给目标,然后由用户执行触发。在不考虑通过hh.exe执行二进制文件的旧系统或未打补丁的系统上,CHM执行也可能绕过应用程序控制。
## 测试案例
编译... | sec-knowleage |
---
title: Emoji
date: 2020-12-15 18:28:43
background: bg-[#ebbe46]
tags:
categories:
- Other
intro: Some of the emoji codes are not super easy to remember, so here is a little cheat sheet.
---
Getting Started
----------
### People
| - | - |
|------------... | sec-knowleage |
# CBC
CBC全称为密码分组链接(Cipher-block chaining) 模式,这里
- IV 不要求保密
- IV 必须是不可预测的,而且要保证完整性。
## 加密
## 解密
## 优缺点
### 优点
1. 密文块不仅和当前密文块相关,而且和前一个密文块或 IV 相关,隐藏了明文的统计特性。
2. 具有有限的两步错误传播特性,即密文块中的一位变化只会影响当前密文块和下一密文块。
3. 具有自同步特性,即第 k 块起密文正确,则第 k+1 块就能正常解密。
### 缺点
1. 加密不能并行,解密可以并行。
## 应用
CBC 应用十分广泛
- 常见的数据加密和 TLS 加密。
- 完整性认证和身份认证。
## 攻击
#... | sec-knowleage |
---
title: 云安全资源
---
<h1 align="center">Awesome Cloud Security 云安全资源汇总 💫 </h1>
<p align="center">
<a href="https://github.com/teamssix/awesome-cloud-security/stargazers" target="_blank"><img alt="GitHub stars" src="https://img.shields.io/github/stars/teamssix/awesome-cloud-security" /></a>
<a href="https://wiki.teamss... | sec-knowleage |
# CODE BLUE CTF 2018 Quals
Team: c7f.m0d3, shalom, chivay, Eternal, nazywam, akrasuski1
### Table of contents
* [LED (crypto)](crypto_LED)
* [lagalem (crypto)](crypto_lagalem)
* [Odin 1 & 2 (re)](odin)
* [MortAl mage aGEnts (only first part) (web)](web_mage) | sec-knowleage |
# The Rabbit Hole
* Category: Misc
* 250 Points
* Solved by the JCTF Team
## Description
> My logs are always leaked, do you think you can read them?
>
> tcp://ctf:ctf@the-rabbit-hole.ctf.bsidestlv.com:5672
## Solution
Port 5672 is assigned to the `RabbitMQ` protocol:
> RabbitMQ is an open-source message-broker softwa... | sec-knowleage |
.\" auto-generated by docbook2man-spec $Revision: 1.1 $
.TH "EXECUTE" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands"
.SH NAME
EXECUTE \- 执行一个准备好的查询
.SH SYNOPSIS
.sp
.nf
EXECUTE \fIplan_name\fR [ (\fIparameter\fR [, ...] ) ]
.sp
.fi
.SH "DESCRIPTION 描述"
.PP
\fBEXECUTE\fR 用于执行一个前面准备好的语句。 因为一个准备好的查询只在会话的生命期里存... | sec-knowleage |
# Flag Server
Category: Binary Exploitation, 50 points
## Description
> I found this cool service that gives out flags, but you need to have a username and password to log in...
```c
#include <stdio.h>
#include <unistd.h>
#include "flag.h"
int get_credentials();
int authenticate_with_server(int *authenticated);
void pr... | sec-knowleage |
---
title: Todoist
date: 2022-11-23 16:23:31.696934
background: bg-[#cc4d3b]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 37 keyboard shortcuts found in Todoist
---
Keyboard Shortcuts
------------------
### Task Quick Add
Shortcut | Action
---|---
`@` | Ad... | sec-knowleage |
# 基本贡献方式
## 我之前没怎么用过 Github
参与 Wiki 的编写**需要**一个 Github 账号, **不需要**高超的 Github 技巧。
举个栗子,假如我想要修改一个页面内容,应该怎么操作呢?
1. 在 [CTF Wiki](https://ctf-wiki.github.io/ctf-wiki/) 上找到对应页面
2. 点击 正文右上方、目录左侧的 **“编辑此页”** 按钮
3. (应该已经跳转到了 Github 上的对应页面吧?)这时候右上方还会有一个 **“编辑此页”** 的按钮,点击它就可以在线编辑了
4. 写好了之后点下方的绿色按钮,可能会提示没有权限。不必担心!Github 会自动帮你 fork... | sec-knowleage |
'\"
'\" Copyright (c) 1993 The Regents of the University of California.
'\" Copyright (c) 1994-1996 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" RCS: @(#) $Id: lsearch.n,v 1.2 2003/11/24 05:09:5... | sec-knowleage |
### Arbitrary Writing原理
动态数组的任意 Storage 存储写漏洞,根据 [官方文档](https://docs.soliditylang.org/en/v0.8.1/internals/layout_in_storage.html#) 介绍,可总结如下
- EVM 中,有三个地方可以存储变量,分别是 Memory、Stack 和 Storage。Memory 和 Stack 是在执行期间临时生成的存储空间,主要负责运行时的数据存储,Storage 是永久存在于区块链中的变量。
+ Memory: 内存,生命周期仅为整个方法执行期间,函数调用后回收,因为仅保存临时变量,故 GAS 开销很小
+... | sec-knowleage |
# Nginx
---
**项目地址**
- https://www.nginx.com/
**配置生成**
- https://github.com/digitalocean/nginxconfig.io
---
## 反向代理
反向代理(Reverse Proxy)方式是指以代理服务器来接受 internet 上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给 internet 上请求连接的客户端,此时代理服务器对外就表现为一个反向代理服务器.
```vim
cd /usr/local/nginx/conf
vim nginx.conf
server {
#侦听的80端口
liste... | sec-knowleage |
## Content Provider任意数据访问漏洞
> 阿里聚安全发布于 2016-06-02
### 漏洞描述
ContentProvider的权限没有做好控制,可能导致APP的敏感数据泄露
content URI是一个标志provider中的数据的URI。Content URI中包含了整个provider的以符号表示的名字(它的authority)和指向一个表的名字(一个路径)。
当调用一个客户端的方法来操作一个 provider 中的一个表,指向表的contentURI是参数之一,如果对ContentProvider的权限没有做好控制,就有可能导致恶意的程序通过这种方式读取APP的敏感数据。
### 影响范围
近乎 And... | sec-knowleage |
.\" auto-generated by docbook2man-spec $Revision: 1.1 $
.TH "SELECT INTO" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands"
.SH NAME
SELECT INTO \- 从一个查询的结果中创建一个新表
.SH SYNOPSIS
.sp
.nf
SELECT [ ALL | DISTINCT [ ON ( \fIexpression\fR [, ...] ) ] ]
* | \fIexpression\fR [ AS \fIoutput_name\fR ] [, ...]
I... | sec-knowleage |
# urlcheck v2
Just like in previous prolem here we have a simple form that makes the http request for us and returns the response. Quick glance at the code:
```python
import os, re, time, ipaddress, socket, requests, flask
from urllib.parse import urlparse
app = flask.Flask(__name__)
app.flag = '***CENSORED***'
def val... | sec-knowleage |
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
.\"
.\" Standard preamble:
.\" ========================================================================
.\".de Sh\" Subsection heading
.\".br
.\".if t .Sp
.\".ne 5
.\".PP
.\"\fB\\$1\fR
.\".PP
.\"..
.\".de Sp\" Vertical space (when we can't use .PP)
.\".if... | sec-knowleage |
version: '2'
services:
postgres:
image: vulhub/postgres:10.7
ports:
- "5432:5432"
environment:
- POSTGRES_PASSWORD=postgres | sec-knowleage |
# 10.4 变态跳台阶
## 题目链接
[牛客网](https://www.nowcoder.com/practice/22243d016f6b47f2a6928b4313c85387?tpId=13&tqId=11162&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
## 题目描述
一只青蛙一次可以跳上 1 级台阶,也可以跳上 2 级... 它也可以跳上 n 级。求该青蛙跳上一个 n 级的台阶总共有多少种跳法。
<div align="center"> <img src="http... | sec-knowleage |
# Me Tarjan, You Jane
Category: Logic, 60 Points
## Description
> Tarjan got lost in the jungle!
>
> Can you help him to find the way to his beloved Jane?
>
> We put our faith in you.
>
> Good Luck!
Two files were attached.
## Solution
Let's take a look at the files.
The first file:
```console
root@kali:/media/sf_CT... | sec-knowleage |
# T1546-001-win-事件触发执行-更改默认文件关联
## 来自ATT&CK描述
攻击者可以通过执行由文件类型关联触发的恶意内容来建立持久性。打开文件时,会检查用于打开文件的默认程序(也称为文件关联或处理程序)。文件关联选择存储在 Windows注册表中,可由具有注册表访问权限的用户、管理员或程序或管理员使用内置的assoc实用程序进行编辑。应用程序可以修改给定文件扩展名的文件关联,以在打开具有给定扩展名的文件时调用任意程序。
系统文件关联被列在HKEY_CLASSES_ROOT.[扩展]下,例如HKEY_CLASSES_ROOT.txt。这些条目指向位于HKEY_CLASSES_ROOT[handler]的该扩展的处理程... | sec-knowleage |
#!/usr/bin/env python2
from flag import FLAG
from gmpy2 import next_prime, powmod
from random import randint, getrandbits
from hashlib import sha512, sha256
from os import urandom
introduction = """
.--. .-------------------------------.
| _| | |
| O O < Hey man, wanna mid ... | sec-knowleage |
MSF的exploit模块下是支持set payload的,同样在复杂的网络环境下,许多模块也同样支持自定义的payload。可以更好的配合第三方框架,如第十一课中提到的Veil-Evasion等。
以exploit/windows/smb/psexec为demo。
攻击机配置如下:
```bash
msf exploit(windows/smb/psexec) > show options
Module options (exploit/windows/smb/psexec):
Name Current Setting Required Description
‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐ ‐‐‐... | sec-knowleage |
# Writeup Backdoor CTF 2016
Team: c7f.m0d3, akrasuski1, cr019283, nazywam, msm, shalom
### Table of contents
* [DTune (Misc)](misc_dtune)
* [Mindblown (Crypto)](crypto_mindblown)
* [Worst-pwn-ever (Pwn)](pwn_worst)
* [ISolve (PPC)](ppc_isolve)
* Busybee (Forensics)
* [Collision-course (Crypto)](crypto_collision_course)... | sec-knowleage |
# Fetcher
15 Points
## Solution
We get a page titled "I issue HTTP requests!" and the ability to enter a URL and click "go".
The developer console outputs the following messages:
```
Loading the code for the Fetcher (15 pt) page. To debug this code, open e9giz.js in Developer Tools.
Did you know you can get a wix site ... | sec-knowleage |
s = open("generated.h").read()
s = s.split("{")[1].split("}")[0]
s = s.split(",")
s = [int(c, 16) for c in s]
# DECRYPT
key = [0x4b, 0xa9, 0xdc, 0x18][::-1]
for i in range(0x38, 0xa0):
s[i] ^= key[i%4]
key = [0x17, 0xdb, 0x41, 0xdc][::-1]
for i in range(0xf4, 0x13c):
s[i] ^= key[i%4]
key = [0x73, 0xd4, 0x01,... | sec-knowleage |
ld
===
将目标文件连接为可执行程序
## 补充说明
**ld命令** 是GNU的连接器,将目标文件连接为可执行程序。
### 语法
```shell
ld(选项)(参数)
ld [options] objfile ...
```
### 选项
```shell
-o:指定输出文件名;
-e:指定程序的入口符号。
```
### 参数
目标文件:指定需要连接的目标文件。
### 实例
这告诉ld通过将文件 `/lib/crt0.o` 与 `hello.o` 和库 `libc.a` 链接起来,生成一个名为 `output` 的文件,该文件将来自标准搜索目录。
```shell
ld -o <output> /lib/c... | sec-knowleage |
# Episode 1: Challenge 3
## Description
> Your opponents are always learning. They’ll keep coming back stronger.
>
> Hint: Opponents patch their vulnerabilities, too. The same strategy won’t work twice.
A link to an online chess game was attached.
## Solution
This is the follow-up for [Episode 0: Challenge 1](e00c01.... | sec-knowleage |
# T1564-001-win-发现攻击者在回收站中隐藏恶意软件
## 来自ATT&CK的描述
攻击者可能会将文件和目录设置为隐藏,以逃避检测机制。为了防止普通用户意外更改系统上的特殊文件,大多数操作系统都具有“隐藏”文件的功能。当用户使用GUI浏览文件系统或在命令行上使用常规命令时,这些文件不会显示。用户必须通过一系列图形用户界面(GUI)提示或使用命令行开关(对于Windows为dir /a,对于Linux和macOS为ls –a)明确要求显示隐藏文件。
在Linux和Mac上,用户只需将“.”标记为隐藏,即可将其标记为隐藏。作为文件或文件夹名称中的第一个字符。默认情况下,以“.”开头的文件和文件夹在Finder应用程序和标准命... | sec-knowleage |
# Statistics 2
Category: AI Research, 20 points
## Description
> Still refering to challenge Statistics1:
>
> What is the maximum number of neurons that will be dropped?
## Solution:
This is the follow-up question for [Statistics](Statistics.md).
Reminder:
> For each K'th neuron, an eight-sided die is tossed K times... | sec-knowleage |
---
title: SketchUp Pro
date: 2022-11-23 16:23:31.693091
background: bg-[#265a94]
label:
tags:
-
-
categories:
- Keyboard Shortcuts
intro: |
A visual cheat-sheet for the 135 default keyboard shortcuts found in SketchUp Pro
---
Keyboard Shortcuts {.cols-2}
------------------
### General I
Shortcut |... | sec-knowleage |
# SpEL
---
## SpEL简介
在 Spring 3 中引入了 Spring 表达式语言(Spring Expression Language,简称 SpEL),这是一种功能强大的表达式语言,支持在运行时查询和操作对象图,可以与基于 XML 和基于注解的 Spring 配置还有 bean 定义一起使用。
在 Spring 系列产品中,SpEL 是表达式计算的基础,实现了与 Spring 生态系统所有产品无缝对接。Spring 框架的核心功能之一就是通过依赖注入的方式来管理 Bean 之间的依赖关系,而 SpEL 可以方便快捷的对 ApplicationContext 中的 Bean 进行属性的装配和提取。由于它能够在运行时... | sec-knowleage |
# Zip Slip
> The vulnerability is exploited using a specially crafted archive that holds directory traversal filenames (e.g. ../../shell.php). The Zip Slip vulnerability can affect numerous archive formats, including tar, jar, war, cpio, apk, rar and 7z. The attacker can then overwrite executable files and either invok... | sec-knowleage |
# Tiny elves (misc, 50+2p, 59 solved)
In the challenge we get a [source code](tiny_elves_fake.py) running on the server.
The code is quite simple:
```python
#!/usr/bin/python3
import os, tempfile, subprocess
try:
data = input(">").strip()
if len(data) > 12: raise Exception("too large")
with tempfile.Tempora... | sec-knowleage |
# iptables实现waf
iptables工作在主机层面,对于进出的网络或者主机的数据报文,根据事先设定好的检查规则对其检查,并作出相应的处理。
## iptables实现waf
### iptables拦截ip
```
# 拦截ip
iptables -A INPUT -p tcp --dport 80 -s 192.168.199.1 -j DROP
# 删除拦截
iptables -D INPUT -p tcp --dport 80 -s 192.168.199.1 -j DROP
```
### 利用ipset进行批量IP拦截
```
# 创建ip集
ipset create bloodzer0 hash:ip
# 查... | sec-knowleage |
从 xp 开始默认有 .net framework,在 powershell 后,调用起来更方便。
### 连载1
System.Data.SqlClient 命名空间是用于 SQL Server 的 .NET 数据提供程序。在net framework2.0中新增加SqlDataSourceEnumerator 类。提供了一种枚举本地网络内的所有可用 SQL Server 实例机制。微软官方是这样解释的:
> SQL Server 2000 和 SQL Server 2005 进行应用程序可以确定在当前网络中的 SQL Server实例存在。SqlDataSourceEnumerator类公开给应用程序开发人员,提供此信息Da... | sec-knowleage |
# S L M a i l nQHhO
< |