text stringlengths 100 9.93M | category stringclasses 11
values |
|---|---|
# ls
Category: Crypto, 300 Points
## Description
> Boss wanted to give people access to only see the directories list in a filesystem.
>
> Now you can run anything on my OS... so long as it's `ls` (with parameters).
>
> Send the commands in one or more files, then zip that file. I only accept zips, everything else is... | sec-knowleage |
# SSRF
## SSRF 简介
SSRF,Server-Side Request Forgery,服务端请求伪造,是一种由攻击者构造形成由服务器端发起请求的一个漏洞。一般情况下,SSRF 攻击的目标是从外网无法访问的内部系统。
漏洞形成的原因大多是因为服务端提供了从其他服务器应用获取数据的功能且没有对目标地址作过滤和限制。
攻击者可以利用 SSRF 实现的攻击主要有 5 种:
1. 可以对外网、服务器所在内网、本地进行端口扫描,获取一些服务的 banner 信息
2. 攻击运行在内网或本地的应用程序(比如溢出)
3. 对内网 WEB 应用进行指纹识别,通过访问默认文件实现
4. 攻击内外网的 web 应用,主要是使用 G... | sec-knowleage |
# Apache Unomi 远程表达式代码执行漏洞(CVE-2020-13942)
Apache Unomi 是一个基于标准的客户数据平台(CDP,Customer Data Platform),用于管理在线客户和访客等信息,以提供符合访客隐私规则的个性化体验。在Apache Unomi 1.5.1级以前版本中,存在一处表达式注入漏洞,远程攻击者通过MVEL和OGNL表达式即可在目标服务器上执行任意命令。
参考链接:
- https://www.checkmarx.com/blog/apache-unomi-cve-2020-13942-rce-vulnerabilities-discovered/
- https://gi... | sec-knowleage |
# Bluetooth Device Manager, Exp, 200pts
> You have a basic car model and would like to enable some extra features? That navigation with traffic should be neat. Right. It is expensive, you know. Or not, if you can access the control interface. Try bluetooth this time. We think, it could be used for purposes other than m... | sec-knowleage |
# Kioptrix3-WalkThrough
---
## 免责声明
`本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.`
---
**靶机地址**
- https://www.vulnhub.com/entry/kioptrix-level-12-3,24/
**Description**
It's been a while since the last Kioptrix VM challenge. Life keeps getting the way of these things you know.
After the seeing the number of downlo... | sec-knowleage |
# SonarQube
开源代码质量管理工具。
[官网地址](https://www.sonarqube.org/)
[官方文档](https://docs.sonarqube.org/display/SONAR/Documentation/)
## SonarQube安装与使用
### Centos7安装SonarQube
> 数据库不要使用mariadb
>
> 不要使用root进行安装,es会提示"can not run elasticsearch as root"
* **解决依赖**
```
# 安装jvm环境
yum install java-1.8.0-openjdk.x86_64 java-1.8.0-openjd... | sec-knowleage |
# T1218-011-win-基于白名单url.dll执行payload
## 来自ATT&CK的描述
Rundll32.exe程序可以调用来执行任意二进制文件。攻击者可能会利用此功能来代理执行代码,从而避免触发那些可能不会监控rundll32.exe进程执行的安全工具,因为正常操作中使用rundll32.exe的Windows会有白名单或误报。
Rundll32.exe可用于通过未记录的shell32.dll函数Control_RunDLL和 Control_RunDLLAsUser来执行控制面板项目文件(.cpl)。双击.cpl文件也会触发rundll32.exe执行。
Rundll32也可用于执行JavaScript等脚本。... | sec-knowleage |
# Server Side Include Injection (SSI Injection)
## Introduction
SSI (Server Side Includes) Injection is a type of web security vulnerability that occurs when a web application allows untrusted user-supplied data to be used as part of a Server Side Include (SSI) directive
## Where to find
Usually it can be found anywher... | sec-knowleage |
package org.pwntester.action;
import com.opensymphony.xwork2.ActionSupport;
public class IndexAction extends ActionSupport {
private String id;
public String changeId(){
return SUCCESS;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id ... | sec-knowleage |
# Baby Pinhole (crypto)
In the task we get [ciphertext](ciphertext), [publickey](publickey), [crypto generator](generate.py) and [server code](server.py).
The encryption used here is Paillier cryptosystem.
Crypto parameters generation if flawless, there are large strong primes and unfactorizable 1024 bit modulus.
The e... | sec-knowleage |
# S2-046 远程代码执行漏洞(CVE-2017-5638)
影响版本: Struts 2.3.5 - Struts 2.3.31, Struts 2.5 - Struts 2.5.10
漏洞详情:
- https://cwiki.apache.org/confluence/display/WW/S2-046
- https://xz.aliyun.com/t/221
## 漏洞环境
执行如下命令启动struts2 2.3.30:
```
docker compose up -d
```
环境启动后,访问`http://your-ip:8080`即可看到上传页面。
## 漏洞复现
与s2-045类似,但是输... | sec-knowleage |
.TH SMBMNT 8 "26 Apr 2000" "smbmnt 2.0.7"
.PP
.SH "NAME 名字"
smbmnt \- 装载 SMB 文件系统的协助工具。
.PP
.SH "总览"
\fBsmbmnt\fP mount-point [ -s share ] [ -r ] [ -u uid ] [ -g gid ] [ -f mask ] [ -d mask ]
.PP
.SH "描述"
.PP
smbmnt 用于协助 smbmount 程序完成实际装载 SMB 共享资源。
smbmnt 必须以 root 用 setuid 来安装,这样普通用户才能
装载他们的 SMB 共享资源。它在装载点和装载目录... | sec-knowleage |
# 36. 二叉搜索树与双向链表
[NowCoder](https://www.nowcoder.com/practice/947f6eb80d944a84850b0538bf0ec3a5?tpId=13&tqId=11179&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github)
## 题目描述
输入一棵二叉搜索树,将该二叉搜索树转换成一个排序的双向链表。要求不能创建任何新的结点,只能调整树中结点指针的指向。
<div align="center"> <img src="https://cs-... | sec-knowleage |
.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" ... | sec-knowleage |
# 前端攻防
---
## 免责声明
`本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.`
---
## 前端加解密
**相关文章**
- [浅析前端加密后数据包的修改方法](https://www.freebuf.com/articles/web/223011.html)
- [浅谈web安全之前端加密](https://mp.weixin.qq.com/s/W1Jbrj6Jtg-J3-AX4eO-Eg)
- [当爆破遇到JS加密](https://www.freebuf.com/articles/web/261459.html)
**相关案例**
- [H5页面漏洞挖掘之路-加... | sec-knowleage |
from library import *
if len(sys.argv) > 2:
n = int(sys.argv[2])
else:
n = None
i, o, t = load_npz(sys.argv[1], n)
t1 = t[0][261968:][:2000]
t2 = t[0][286991+57:][:2000]
show_traces([t1, t2]) | sec-knowleage |
package org.vulhub.impl;
import org.vulhub.api.CalcService;
public class CalcServiceImpl implements CalcService {
@Override
public Integer add(Integer a, Integer b) {
return a + b;
}
@Override
public Integer minus(Integer a, Integer b) {
return a - b;
}
} | sec-knowleage |
## Serial (Reverse, 150p)
Run and capture the flag!
Download serial
###ENG
[PL](#pl-version)
We were given a binary, asking for a serial and telling us whether it's correct. Disassembling it gave a weird result -
for example:
```
0x00400a2c je 0x400a3c
0x00400a2e mov ax, 0x5eb
0x00400a32 xor eax... | sec-knowleage |
import sys, string
def is_printable(s):
for c in s:
if c not in string.printable:
return False
return True
i = int(sys.argv[1], 0)
if len(sys.argv) > 2:
l = int(sys.argv[2], 0)
else:
l = 256
s = open("climate.bin", "rb").read()
i -= 0x2000
i += 0x12612
data = s[i:][:l]
print data... | sec-knowleage |
# Go through the hole
* Category: Web
* 400 Points
* Solved by the JCTF Team
## Description
> There is a rabbit hole that has a secret passage that leads to another world.
>
> Can you find this hidden path?
```go
func accessHandler(w http.ResponseWriter, r *http.Request) {
file := strings.Join(r.URL.Query()["file"... | 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 TAC 1 2022年9月 "GNU coreutils 9.1"... | sec-knowleage |
### RC4基本介绍
RSA 由 Ron Rivest 设计,最初隶属于 RSA 安全公司,是一个专利密码产品。它是面向字节的流密码,密钥长度可变,非常简单,但也很有效果。RC4 算法广泛应用于 SSL/TLS 协议和 WEP/WPA 协议。
### RC4基本流程
RC4 主要包含三个流程
- 初始化 S 和 T 数组。
- 初始化置换 S。
- 生成密钥流。
### RC4基本流程初始化 S 和 T 数组
初始化 S 和 T 的代码如下
```c
for i = 0 to 255 do
S[i] = i
T[i] = K[i mod keylen])
```
### RC4基本流程初始化置换 S
```c
j = 0
f... | sec-knowleage |
# 字节码
---
Java 之所以可以“一次编译,到处运行”,一是因为 JVM 针对各种操作系统、平台都进行了定制,二是因为无论在什么平台,都可以编译生成固定格式的字节码(.class 文件)供 JVM 使用。
`.class` 文件是一组以 8 位字节为基础单位的二进制流,各个数据项严格按照顺序紧凑地排列在 `.class` 文件中,中间没有添加任何分隔符。整个 `.class` 文件本质上就是一张表。
---
## 字节码
### 什么是字节码
之所以被称之为字节码,是因为字节码文件由十六进制值组成,而 JVM 以两个十六进制值为一组,即以字节为单位进行读取。在 Java 中一般是用 javac 命令编译源代码为字节码文件,一... | sec-knowleage |
# Account Takeover
## Introduction
Account Takeover (known as ATO) is a type of identity theft where a bad actor gains unauthorized access to an account belonging to someone else.
## How to exploit
1. Using OAuth Misconfiguration
- Victim has a account in evil.com
- Attacker creates an account on evil.com using O... | sec-knowleage |
### 区块链学习资源
#### Books
- 《以太坊技术详解与实战》-- 以太坊创始人、首席科学家 Vitalik Buterin 倾力推荐
- 待补充
#### papers
- 智能合约 [https://github.com/hzysvilla/Academic_Smart_Contract_Papers](https://github.com/hzysvilla/Academic_Smart_Contract_Papers)
- 区块链(包括智能合约)[https://github.com/jianyu-niu/blockchain_conference_paper](https://github.com/jianyu... | sec-knowleage |
# Ez web (web, 100p, 185 solved)
A very simple web challenge.
The site says it's under construction and there is not much there, but if we check `robots.txt` we can see:
```
User-agent: *
Disallow: /flag/
```
And in `flag` directory there is `flag.txt` but it says we're not allowed to see it.
However if we look at the ... | sec-knowleage |
### so 基本介绍
- 为什么会用到 Shared Object(SO)
- 开发效率
- 快速移植
- so 的版本
- 根据 CPU 平台有所不一样
### so 加载方法
- System.loadLibrary
- 如果加载的文件名是 xxx ,那么其实加载的是项目中 libs 目录下的 libxxx.so文件。
- System.load
- 对应 lib 的绝对路径。
主要使用第一种方式,第二种方式主要用于在插件中加载 so 文件。
### loadLibrary 加载流程
根据官方 API 介绍
> The call `System.loadLibrary(name)` i... | sec-knowleage |
### 图片分析类题目简介
图像文件能够很好地包含黑客文化,因此 CTF 竞赛中经常会出现各种图像文件。
图像文件有多种复杂的格式,可以用于各种涉及到元数据、信息丢失和无损压缩、校验、隐写或可视化数据编码的分析解密,都是 Misc 中的一个很重要的出题方向。涉及到的知识点很多(包括基本的文件格式,常见的隐写手法及隐写用的软件),有的地方也需要去进行深入的理解。
### 元数据(Metadata)介绍
> 元数据(Metadata),又称中介数据、中继数据,为描述数据的数据(Data about data),主要是描述数据属性(property)的信息,用来支持如指示存储位置、历史数据、资源查找、文件记录等功能。
元数据中隐藏信息在比... | sec-knowleage |
# 0x00 简介
Aggressor Script是Cobalt Strike 3.0版及更高版本中内置的脚本语言,可以修改和扩展Cobalt Strike客户端。
Aggressor Script遵循Sleep Scripting Language语法http://sleep.dashnine.org/manual
# 0x01 使用
> view ->Script Console
当然你也可以在 Cobalt Stike > script Manager 来操作管理
输入help 内置几个命令如下
Command| Arguments | What it does
-| -| -|
? | "*foo*" iswm ... | sec-knowleage |
apt-get
===
Debian Linux发行版中的APT软件包管理工具
## 补充说明
**apt-get命令** 是Debian Linux发行版中的APT软件包管理工具。所有基于Debian的发行都使用这个包管理系统。deb包可以把一个应用的文件包在一起,大体就如同Windows上的安装文件。
### 语法
```shell
apt-get [OPTION] PACKAGE
```
### 选项
```shell
apt-get install # 安装新包
apt-get remove # 卸载已安装的包(保留配置文件)
apt-get purge # 卸载已安装的包(删除配置文件)
apt-get u... | sec-knowleage |
### Blockchain Security Challenges Game of Ethereum Smart Contract Security
- [https://ethernaut.openzeppelin.com/](https://ethernaut.openzeppelin.com/)
+ WP 链接 [https://hitcxy.com/2019/ethernaut/](https://hitcxy.com/2019/ethernaut/)
- [https://capturetheether.com/challenges/](https://capturetheether.com/challenges... | sec-knowleage |
# Fix my pdf (misc, 100p)
## PL
`For ENG scroll down`
Dostajemy [taki oto pdf](fix_my_pdf.pdf) od autorów zadania.
Wszelkie próby załadowania go do jakiegoś czytnika pdf kończą się niepowodzeniem - wyraźnie wygląda na uszkodzony.
Możemy jeszcze otworzyć go z ciekawości w notepadzie/vimie/emacsie żeby przyjrzeć sie jeg... | sec-knowleage |
# T1584-004-盗取基础设施-服务器
## 来自ATT&CK的描述
攻击则可能会攻击第三方服务器,这些服务器可以在扫描目标时使用。使用服务器可以让攻击者策划、发动和执行行动。在攻击后的活动中,攻击者可以利用服务器执行各种任务,包括用于指挥和控制。攻击者可能不购买服务器或虚拟私人服务器,而是利用自己攻击获取的第三方服务器用以支持行动。
攻击者还可能攻击Web服务器用以支持水坑操作,如Drive-by Compromise。
简单来说:就是通过攻击第三方服务器,作为跳板机,俗称“肉鸡”。
## 测试案例
暂无
## 检测日志
无法有效监测
## 测试复现
无
## 测试留痕
无
## 检测规则/思路
无
## 建议
### 缓解... | sec-knowleage |
# authenticate
Binary Exploitation, 350 points
## Description:
> Can you authenticate to this service and get the flag?
```c
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
int authenticated = 0;
int flag() {
char flag[48];
FILE *file;
file = fopen("flag.txt"... | sec-knowleage |
# Web Cache Deception
## Introduction
Web Cache Deception is an attack in which an attacker deceives a caching proxy into improperly storing private information sent over the internet and gaining unauthorized access to that cached data
## Where to find
`-`
## How to exploit
* Normal Request (For example in the settings... | sec-knowleage |
# Vue-Router
vue-router 是指定的路由库,它通过管理 URL,实现组件间切换,和状态 (state) 的变化。类似 React 中的 react-router
### 装包
```
npm install vue-router --save
```
### 注入 router
导入 router
```js
import router from './router'
```
将 router 注入到组件中
```js
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})
```
### 创建 Router... | sec-knowleage |
# The 3D Printer Task (misc, 252+12 pts, 12 solved)
Provided recording shows 3D printing session. Unfortunately the video was damaged after first letters, so the flag should be recovered from the audio.
Spectrogram analysis revealed some interesting patterns, best visible in 16000 Hz:
:
print(line.decode('utf8').rstrip())
def read_at_least_raw(sock, cunt):
res = b''
while len(res) < cunt:
res += sock.recv(1)
return res
def read_at_least(sock, cunt):
res = b''
while len(... | sec-knowleage |
# Micro-CMS v2 - FLAG2
## 0x00 Index

## 0x01 Log In
Try bypass username using
```
' or 1=1#
```
And try run the password.

## 0x02 FLAG
Get FLAG and password **grover**
 | sec-knowleage |
# Keygenme (RE, 400p)
This challenge took me a lot of time, but it was worth it (both because it was fun, and because it was worth a lot of points). It was created by redford (personally I'm fan of his challenges, but of course YMMV).
So we had a binary with simple key checking. Entered key was simply treated as number... | sec-knowleage |
# 20. 表示数值的字符串
[牛客网](https://www.nowcoder.com/practice/e69148f8528c4039ad89bb2546fd4ff8?tpId=13&tqId=11206&tab=answerKey&from=cyc_github)
## 题目描述
```
true
"+100"
"5e2"
"-123"
"3.1416"
"-1E-16"
```
```
false
"12e"
"1a3.14"
"1.2.3"
"+-5"
"12e+4.3"
```
## 解题思路
使用正则表达式进行匹配。
```html
[] : 字符集合
() : 分组
? : 重复 0 ~ 1 次
+ ... | sec-knowleage |
# 凭据
> 部分内容由 [the-fog](https://github.com/the-fog) 提供,仅做部分内容排版修改
---
**简介**
Credential Manager,中文翻译为凭据管理器,用来存储凭据(例如网站登录和主机远程连接的用户名密码) 如果用户选择存储凭据,那么当用户再次使用对应的操作,系统会自动填入凭据,实现自动登录 凭据保存在特定的位置,被称作为保管库(vault)(位于%localappdata%/MicrosoftVault
- https://docs.microsoft.com/zh-cn/windows/win32/secauthn/kinds-of-credentials?redire... | sec-knowleage |
# Investigative Reversing 2
Forensics, 350 points
## Description:
> We have recovered a binary and an image See what you can make of it. There should be a flag somewhere.
## Solution:
This is the follow-up for [Investigative Reversing 1](Investigative_Reversing_1.md).
Again, let's check the binary with Ghidra:
```c
un... | sec-knowleage |
# Battleships (reverse, ppc, 872p)
> A perfect candidate should be a strong leader, excellent negotiator and outstanding commander. Among his qualities must be strategic thinking and battle skills.Campaign office reports that large naval exercise will take place in the neighbouring city where anyone could try himself a... | sec-knowleage |
# Redux
### 什么是`Redux`
Redux作为一个`React`的组件,Redux 是`JavaScript`状态容器,提供可预测化的状态管理。
Redux在React中主要负责组件间数据传递,是一个数据流管理工具。
Redux作者`Dan`有一句名言
>一个 React 的 props 还用不好的开发者,是不应该去学 Redux
### Redux 的工作原理
Redux 是 Facebook 的 Flux 架构的一种简化实现。
(Redux 既是一个表示 “已返回” 的英文单词,也是 reducer + flux 的混合词。)
Flux 在本质上采用了模型-视图-控制器 (MVC) 的结构,但引入了很高的复杂性。
... | sec-knowleage |
version: '2'
services:
electron:
image: vulhub/electron:wine
command: bash /docker-entrypoint.sh
volumes:
- ./src:/project
- ./build:/build
- ./docker-entrypoint.sh:/docker-entrypoint.sh
web:
image: nginx:1
volumes:
- ./build:/usr/share/nginx/html
ports:
- "8080:80" | sec-knowleage |
#!/usr/bin/env python3
import xmlrpc.client
import sys
target = sys.argv[1]
command = sys.argv[2]
with xmlrpc.client.ServerProxy(target) as proxy:
old = getattr(proxy, 'supervisor.readLog')(0,0)
logfile = getattr(proxy, 'supervisor.supervisord.options.logfile.strip')()
getattr(proxy, 'supervisor.supervis... | sec-knowleage |
from array import array
key = [61, 251, 230, 205, 222, 131, 222, 225, 240, 218, 160, 165, 78, 144, 102, 187]
aes_sbox = array('B',
'637c777bf26b6fc53001672bfed7ab76'
'ca82c97dfa5947f0add4a2af9ca472c0'
'b7fd9326363ff7cc34a5e5f171d83115'
'04c723c31896059a071280e2eb27b275'
'09832c1a1b6e5aa0523bd6b329... | sec-knowleage |
from django.db import models
class User(models.Model):
username = models.CharField('Username', unique=True, max_length=32) | sec-knowleage |
# GitHub信息泄漏监控
为什么要监控GitHub,因为随着企业发展,各个团队信息安全意识不到位,可能导致涉及公司的敏感信息被上传到GitHub,主要包括:公司业务代码信息、服务器账号密码或私钥信息、内部核心资料(员工信息、项目文档)等等。
GitHub监控只是一个辅助手段,不要过分依赖监控平台,因为GitHub监控需要人员参与处理,所以会存在漏报的情况。**我们需要做到从制度管控到员工安全意识培训等多方面来提高整体安全水平。**
## 监控模式
### 通过API进行监控
token有查询频次限制。
[API文档](https://developer.github.com/v3/search/#search-code)
###... | sec-knowleage |
# Ext Super Magic
Forensics, 250 points
## Description:
> We salvaged a ruined Ext SuperMagic II-class mech recently and pulled the filesystem out of the black box. It looks a bit corrupted, but maybe there's something interesting in there.
Attached was a binary file.
### Hints:
* Are there any [tools](https://en.wikip... | sec-knowleage |
---
title: Tmux
date: 2021-02-20 14:31:24
background: bg-emerald-600
tags:
- utility
- terminal
- session
categories:
- Linux Command
intro: |
The tmux cheat sheet quick reference of most commonly used shortcuts and commands
plugins:
- copyCode
---
Tmux CLI
-------
### New session {.row-span-2}... | sec-knowleage |
# Mac-Plan
---
## 快捷键
- 锁屏 : Control + Command + Q
- 截图 : Shift + Command + 5
- 刷新 : Command + R
- 行首 : Command + 左键
- 行末 : Command + 右键
- 输入Emoji 表情和颜文字 : Control + Command + space
---
## 启动项
```bash
ls /Library/LaunchAgents
```
---
## 代理
```bash
# 请根据自己的代理软件进行调整!!!!
export https_proxy=http://127.0.0.1:7890;export htt... | sec-knowleage |
# FILE结构
## FILE介绍
FILE在Linux系统的标准IO库中是用于描述文件的结构,称为文件流。
FILE结构在程序执行fopen等函数时会进行创建,并分配在堆中。我们常定义一个指向FILE结构的指针来接收这个返回值。
FILE结构定义在libio.h中,如下所示
```c
struct _IO_FILE {
int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
#define _IO_file_flags _flags
/* The following pointers correspond to the C++ streambuf p... | sec-knowleage |
# 如何使用 CTF Wiki
## 简介
CTF Wiki 由三个姊妹项目构成
- [ctf-wiki](https://github.com/ctf-wiki/ctf-wiki),介绍 CTF 相关安全知识。
- [ctf-challenges](https://github.com/ctf-wiki/ctf-challenges),存储 CTF Wiki 中使用到的题目以及一些典型题目的附件、题解。
- [ctf-tools](https://github.com/ctf-wiki/ctf-tools),介绍 CTF 中常用到的工具。
## 如何找题目附件
我们可以在 `ctf-challenges` 仓库下找到题目附件。以[... | sec-knowleage |
jq
===
一个灵活的轻量级命令行JSON处理器
### 补充说明
jq 是 stedolan 开发的一个轻量级的和灵活的命令行JSON处理器,源码请参考 [jq 项目主页](https://github.com/stedolan/jq)
jq 用于处理JSON输入,将给定过滤器应用于其JSON文本输入并在标准输出上将过滤器的结果生成为JSON。
最简单的过滤器是`.`,它将jq的输入未经修改地复制到其输出中(格式设置除外)。
请注意,jq 当前仅支持64位双精度浮点数(IEEE754)。
### 安装
```bash
# Debian系,如 Ubuntu
sudo apt-get install jq
# RedHat系, 如 ... | sec-knowleage |
## equation (Crypto, 2p)
Here is a RSA private key with its upper part masked. Can your recover the private key and decrypt the file?
###ENG
[PL](#pl-version)
We have the picture:

from which we can extract the base64 of the private key part:
```
Os9mhOQRdqW2cwVrnNI72DLcAXpXUJ1HGwJBANWiJcDUGxZpnERxVw7s0... | sec-knowleage |
### 古典密码简介
在古典密码学中,我们主要介绍单表替代密码,多表替代密码,以及一些其它比较有意思的密码。
值得一提的是,在古典密码学中,设计者主要考虑消息的保密性,使得只有相关密钥的人才可以解密密文获得消息的内容,对于消息的完整性和不可否认性则并没有进行太多的考虑。
- 拓展阅读
- [CTF 中那些脑洞大开的编码和加密](http://www.tuicool.com/articles/2E3INnm)
- [古典密码学发展史](http://www.oscca.gov.cn/sca/zxfw/2017-04/24/content_1011709.shtml)
- [古典密码——维基百科]... | sec-knowleage |
# 保护壳简介
## 认识壳是什么
**壳** 是在一些计算机软件里也有一段专门负责保护软件不被非法修改或反编译的程序。
它们一般都是先于程序运行,拿到控制权,然后完成它们保护软件的任务。
由于这段程序和自然界的壳在功能上有很多相同的地方,基于命名的规则,就把这样的程序称为 **壳** 了。
## 壳的分类
我们通常将 **壳** 分为两类,一类是压缩壳,另一类是加密壳。
### 压缩壳
压缩壳早在 DOS 时代就已经出现了,但是当时因为计算能力有限,解压开销过大,并没有得到广泛的运用。
使用压缩壳可以帮助缩减 PE 文件的大小,隐藏了 PE 文件内部代码和资源,便于网络传输和保存。
通常压缩壳有两类用途,一种只是单纯用于压缩普通 ... | sec-knowleage |
# STOP GAN
Category: Pwn
## Description
> Success, you've gotten the picture of your lost love, not knowing that pictures and the things you take pictures of are generally two seperate things, you think you've rescue them and their brethren by downloading them all to your ships hard drive. They're still being eaten, bu... | sec-knowleage |
pvs
===
输出物理卷信息报表
## 补充说明
**pvs命令** 用于输出格式化的物理卷信息报表。使用pvs命令仅能得到物理卷的概要信息,如果要得到更加详细的信息可以使用pvdisplay命令。
### 语法
```shell
pvs(选项)(参数)
```
### 选项
```shell
--noheadings:不输出标题头;
--nosuffix:不输出空间大小的单位。
```
### 参数
物理卷:要显示报表的物理卷列表。
### 实例
使用pvs命令显示系统中所有物理卷的信息报表。在命令行中输入下面的命令:
```shell
pvs # 输出物理卷信息报表
```
输出信息如下:
```shell
PV ... | sec-knowleage |
.\" 本文件版权所有(C) 1994-1999 Jeff Tranter
.\" (tranter@pobox.com)
.\" 它可在GNU出版许可版本2或更高版本下发布.参见 GNU 出版许可的 COPYING 章节以
.\" 获知该文件可以重新发布的条件.
.TH EJECT 1 1999年1月21日 Linux User Commands(用户命令)
.SH NAME (名称)
eject \- 弹出可移动介质
.SH SYNOPSIS(总览)
eject -h.breject [-vnrsfq] [<name>]
.br
eject [-vn] -d.breject [-vn] -a on|off|1|0 [<n... | sec-knowleage |
# Omega Sector (web, 44 solved, 140p)
This was a 2 stage web challenge.
Frist part was to get authenticated into the system.
## Authenticate
For starters we get [php source code](index.php) by finding hint in the html about `is_debug=1` parameter.
The important part is:
```php
$remote=$_SERVER['REQUEST_URI'];
if(strpos... | sec-knowleage |
# S2-052 远程代码执行漏洞
影响版本: Struts 2.1.2 - Struts 2.3.33, Struts 2.5 - Struts 2.5.12
漏洞详情:
- http://struts.apache.org/docs/s2-052.html
- https://yq.aliyun.com/articles/197926
## 测试环境搭建
```
docker compose up -d
```
## 漏洞说明
Struts2-Rest-Plugin是让Struts2能够实现Restful API的一个插件,其根据Content-Type或URI扩展名来判断用户传入的数据包类型,有如下映射表:
... | sec-knowleage |
# JBoss JMXInvokerServlet 反序列化漏洞
这是经典的JBoss反序列化漏洞,JBoss在`/invoker/JMXInvokerServlet`请求中读取了用户传入的对象,然后我们利用Apache Commons Collections中的Gadget执行任意代码。
参考文档:
- https://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/
- https://www.se... | sec-knowleage |
# Modbus 仿真环境搭建
<p align="center">
<img src="../../../../assets/img/banner/Modbus.jpg">
</p>
---
## 前言
Modbus 使用一种简单的 Master and Slave 主从协议进行通信。客户机作为主站,向服务器发送请求;服务器(从站)接到请求后,对请求进行分析并作出应答。一般使用上,监控系统 (HMI) 都为 Master,而 PLC、电表、仪表等都为 Slave。
所以,模拟器 Modbus Poll 就是 Master,Modbus Slave 就是 Slave
---
## 安装及使用
官网下载软件安装包
- http... | sec-knowleage |
# 第7章 四分卫突破——逃避杀毒软件和网络检测
> 译者:[@Snowming](https://github.com/Snowming04)

## 为红队行动编写工具
红队人员和渗透测试人员比较明显的区别之一就是红队人员能快速的适应并理解不同的防护。无论是理解低级语言(机器代码和汇编语言),编写`shellcode`,创建自定义的 C2 二进制可执行文件,还是修改代码来隐藏恶意程序,它们都是我们(红队)日常工作的一部分。我总是遇到不会编程的渗透测试人员,虽然这不是一项硬性要求,但是编程水平确实会决定他们专业成长的高度。 因此,我专门编写这一章节来给那些没有使用过偏... | sec-knowleage |
# What Lies Within
Forensics, 150 points
## Description:
> Theres something in the building. Can you retrieve the flag?
An image was attached.
## Solution:
This challenge is similar to last year's [Reading Between the Eyes](/2018_picoCTF/Reading%20Between%20the%20Eyes.md).
The flag was hidden using LSB encoding, and c... | sec-knowleage |
## Start SECCON CTF (Exercise, 50p)
ex1
Cipher:PXFR}QIVTMSZCNDKUWAGJB{LHYEO
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ{}
ex2
Cipher:EV}ZZD{DWZRA}FFDNFGQO
Plain: {HELLOWORLDSECCONCTF}
quiz
Cipher:A}FFDNEVPFSGV}KZPN}GO
Plain: ?????????????????????
###PL
[ENG](#eng-version)
Bardzo proste rozgrze... | sec-knowleage |
# be-quick-or-be-dead-1
Reversing, 200 points
## Description:
> You find [this](https://www.youtube.com/watch?v=CTt1vk9nM9c) when searching for some music, which leads you to **be-quick-or-be-dead-1**. Can you run it fast enough?
Attached was a binary file.
## Solution:
Let's run the file:
```console
root@kali:/media/s... | sec-knowleage |
# QvR Code
Forensics, 150 points
## Description:
> This is now a STEAM focused competition. Check out our new patented Quade van Ravesteyn (QvR) code. QvR beats similar codes by marginally increasing storage capacity. And it’s prettier to look at. Each encoding is like its own masterpiece.

## Soluti... | sec-knowleage |
---
title: 挂载宿主机 procfs 逃逸
---
<center><h1>挂载宿主机 procfs 逃逸</h1></center>
---
## 前言
procfs是一个伪文件系统,它动态反映着系统内进程及其他组件的状态,其中有许多十分敏感重要的文件。因此,将宿主机的procfs挂载到不受控的容器中也是十分危险的,尤其是在该容器内默认启用root权限,且没有开启User Namespace时。
Docker默认情况下不会为容器开启 User Namespace
从 2.6.19 内核版本开始,Linux 支持在 /proc/sys/kernel/core_pattern 中使用新语法。如果该文件中的首个字符是管道符 |... | sec-knowleage |
### PNG文件格式
对于一个 PNG 文件来说,其文件头总是由位固定的字节来描述的,剩余的部分由 3 个以上的 PNG 的数据块(Chunk)按照特定的顺序组成。
文件头 `89 50 4E 47 0D 0A 1A 0A` + 数据块 + 数据块 + 数据块……
### PNG数据块CHUNk介绍
PNG 定义了两种类型的数据块,一种是称为关键数据块(critical chunk),这是标准的数据块,另一种叫做辅助数据块(ancillary chunks),这是可选的数据块。关键数据块定义了 4 个标准数据块,每个 PNG 文件都必须包含它们,PNG 读写软件也都必须要支持这些数据块。
| 数据块符号 | 数据块名称 ... | sec-knowleage |
### 编译内核驱动介绍
这里我们来尝试编译一个驱动模块。驱动代码如下
```c
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("Dual BSD/GPL");
static int ko_test_init(void)
{
printk("This is a test ko!\n");
return 0;
}
static void ko_test_exit(void)
{
printk("Bye Bye~\n");
}
module_init(ko_test_init... | sec-knowleage |
# Windows - Persistence
## Summary
* [Tools](#tools)
* [Hide Your Binary](#hide-your-binary)
* [Disable Antivirus and Security](#disable-antivirus-and-security)
* [Antivirus Removal](#antivirus-removal)
* [Disable Windows Defender](#disable-windows-defender)
* [Disable Windows Firewall](#disable-windows-fir... | sec-knowleage |
# Sandbox Compat (pwn 420p, 5 solved)
> x86 memory segmentation is easy, just put everything untrusted under 4G.
In the task we get [64-bit Linux executable](sandbox) of the server application with its full source code.
The challenge name and description suggest that the application implements a sandbox.
Additional det... | sec-knowleage |
.TH PROTOCOLS 5 "1995 年 10 月 18 日" "Linux" "Linux 程序员手册"
.SH NAME 名称
protocols \- 协议定义文件
.SH 描述
该文件为普通 ASCII 文件,它描述了 TCP/IP 子系统中各类 DARPA internet 协议族.
你应该参考这个文件, 而不是使用 ARPA 的 include 文件中的号码, 更不必去猜测它们.
这些号码将出现在任何 ip 包头的协议字段中.
你应该保持这个文件不变, 因为修改会导致不正确的 ip 包.
协议号码和名字由 DDN 网络信息中心指定.
每行的格式如下:
.RS
.I 协议 号码 别名 ...
.RE
这里的字段以空格... | sec-knowleage |
# MOAR
PWN
## Description:
> Finding yourself on the Foobanizer9000, a computer built by 9000 foos, this computer is so complicated luckily it serves manual pages through a network service. As the old saying goes, everything you need is in the manual.
>
> nc moar.ctfcompetition.com 1337
## Solution:
Connecting to the ... | sec-knowleage |
pstack
===
显示每个进程的栈跟踪
## 补充说明
**pstack命令** 可显示每个进程的栈跟踪。<kbd>pstack</kbd> 命令必须由相应进程的属主或 <tt>root</tt> 运行。可以使用 <kbd>pstack</kbd> 来确定进程挂起的位置。此命令允许使用的唯一选项是要检查的进程的 <tt>PID</tt>。
命令软件包下载地址:https://packages.debian.org/sid/pstack
### 实例
pstree以树结构显示进程
```shell
pstree -p work | grep ad
sshd(22669)---bash(22670)---ad_preprocess... | sec-knowleage |
### Android 中 Java 层的运行机制
本部分主要关注 Android 中 Java 层代码的运行机制,主要介绍
- Java 虚拟机,从宏观角度即程序执行流程来考虑 Java 代码是如何被执行的。
- Smali 代码,从微观角度即指令级别考虑 Java 代码是如何对应到 Java 虚拟机中的指令。
- Java 层可执行文件,考虑 Java 虚拟机的对应可执行文件的具体格式。 | sec-knowleage |
---
title: 阿里云控制台接管
---
<center><h1>从云服务器 SSRF 漏洞到接管你的阿里云控制台</h1></center>
---
## 0x00 前言
本文将以阿里云为例,对云服务中的一些攻防手法进行演示,首先利用 Terraform 进行 ECS SSRF 漏洞环境的搭建,然后通过实例中存在的 SSRF 漏洞一步步拿下该云服务账户的所有的阿里云服务权限。
## 0x01 环境搭建
本文采用 TerraformGoat 进行靶场的搭建,TerraformGoat 靶场地址:[https://github.com/HuoCorp/TerraformGoat](https://github.com/HuoC... | sec-knowleage |
## Password spraying
下文译作密码碰撞
###常见手法
密码碰撞是一种使用使用有效的用户名和弱口令进行排列组合尝试登录的技术,目的是获得有效的身份凭证。
这种技术在从某种程度上来说并不可靠的,一不小心执行就会导致自己处于暴露的边缘。在碰撞之前,我们应该应该摸清楚目标的各个规则,如错误锁定时间次数等,以一种可控的方式尝试密码碰撞,并跨多个用户以避免锁定。也就是说密码碰撞实际上就属于暴力破解。
这项技术的使用是有前提的。不管它是在外网还是在内网执行,道理都是一样的。绝大部分需要的注意的东西都可以轻松试出了。
###前提准备
* 可碰撞的服务
* 域名/ip
* 用户名或邮箱
###常用工具
* [DomainPass... | sec-knowleage |
.\" auto-generated by docbook2man-spec $Revision: 1.1 $
.TH "COMMENT" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands"
.SH NAME
COMMENT \- 定义或者改变一个对象的评注
.SH SYNOPSIS
.sp
.nf
COMMENT ON
{
TABLE \fIobject_name\fR |
COLUMN \fItable_name\fR.\fIcolumn_name\fR |
AGGREGATE \fIagg_name\fR (\fIagg_type\fR) |
... | sec-knowleage |
.TH "INITDB" "1" "2003-11-02" "Application" "PostgreSQL Server Applications"
.SH NAME
initdb \- 创建一个新的 PostgreSQL数据库集群
.SH SYNOPSIS
.sp
\fBinitdb\fR\fR [ \fR\fB\fIoption\fB\fR...\fB \fR\fR]\fR \fR\fR \fB--pgdata \fR\fR | \fR\fB-D \fR\fIdirectory\fR\fR\fR
.SH "DESCRIPTION 描述"
.PP
\fBinitdb\fR 创建一个新的 PostgreSQL 数据库集群。 一... | sec-knowleage |
# Joomla 3.7.0 (CVE-2017-8917) SQL注入漏洞环境
Joomla是一个开源免费的内容管理系统(CMS),基于PHP开发。
Joomla在3.7.0中新引入的一个组件“com_fields”,这个组件任何人都可以访问,无需登陆验证。com_fields组件由于对请求数据过滤不严导致了SQL注入。
参考链接:
- <https://developer.joomla.org/security-centre/692-20170501-core-sql-injection.html>
- <https://blog.sucuri.net/2017/05/sql-injection-vulnerabilit... | sec-knowleage |
# Gotta catch em all
Category: Web, 80 Points
## Description
> Ash was too busy catching pokemons that he forgot his credentials.
## Solution
The attached website contained four pages, and two of them contained forms.
The first form was a login form:
```html
<form action="/login" method="post">
<input placeholder="... | sec-knowleage |
# T1098-Windows-AdminSDHolder
## 来自ATT&CK的描述
帐户操作可以帮助攻击者维持在环境中对凭据和某些权限级别的访问。账户操作可能包括修改权限,修改凭据,添加或更改权限组,修改帐户设置或修改执行身份验证等方式。为了创建或操纵帐户,攻击者必须已经对系统或域具有足够的权限。
## 测试案例
AdminSDHolder是一个特殊的AD容器,具有一些默认安全权限,用作受保护的AD账户和组的模板。
Active Directory将采用AdminSDHolder对象的ACL并定期将其应用于所有受保护的AD账户和组,以防止意外和无意的修改并确保对这些对象的访问是安全的。
如果能够修改AdminSDHolder对... | sec-knowleage |
.\" Copyright (c) 1983, 1990 The Regents of the University of California.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above co... | sec-knowleage |
class BitfieldBase:
def __init__(self, x):
if isinstance(x,BitfieldBase):
self.f = x.f
self.bits = x.bits
self.bitfield = x.bitfield
self.count = x.bitfield
else:
self.f = x
self.bits = 0
self.bitfield = 0x0
... | sec-knowleage |
.\" Copyright (c) 1995 Dirk Eddelbuettel (Dirk.Eddelbuettel@qed.econ.queensu.ca)
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) a... | sec-knowleage |
# Confluence Server Webwork Pre-Auth OGNL Injection (CVE-2021-26084)
[中文版本(Chinese version)](README.zh-cn.md)
Confluence is a web-based corporate wiki developed by Australian software company Atlassian.
An OGNL injection vulnerability exists that allows an unauthenticated attacker to execute arbitrary code on a Conf... | sec-knowleage |
# Sky Tower
> https://download.vulnhub.com/skytower/SkyTower.zip
>
> vbox虚拟机
靶场IP地址:`192.168.32.8`

扫描对外IP地址:
```
┌──(root㉿kali)-[~]
└─# nmap -sV -p1-65535 192.168.32.8
Starting Nmap 7.92 ( https://nmap.org ) at 2022-07-18 03:06 EDT
Nmap scan ... | sec-knowleage |
# S2-053 Remote Code Execution Vulnerablity
[中文版本(Chinese version)](README.zh-cn.md)
Affected Version: Struts 2.0.1 - Struts 2.3.33, Struts 2.5 - Struts 2.5.10
Details:
- http://struts.apache.org/docs/s2-053.html
- https://mp.weixin.qq.com/s?__biz=MzU0NTI4MDQwMQ==&mid=2247483663&idx=1&sn=6304e1469f23c33728ab5c736... | sec-knowleage |
tr
===
将字符进行替换压缩和删除
## 补充说明
**tr命令** 可以对来自标准输入的字符进行替换、压缩和删除。它可以将一组字符变成另一组字符,经常用来编写优美的单行命令,作用很强大。
### 语法
```shell
tr(选项)(参数)
```
### 选项
```shell
-c或——complerment:取代所有不属于第一字符集的字符;
-d或——delete:删除所有属于第一字符集的字符;
-s或--squeeze-repeats:把连续重复的字符以单独一个字符表示;
-t或--truncate-set1:先删除第一字符集较第二字符集多出的字符。
```
### 参数
* 字符集1:指定要转换或删除的原字... | sec-knowleage |
.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
.\"
.\" 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 copy and distribute modified versions of this
.\"... | sec-knowleage |
# Apache HTTPD 换行解析漏洞(CVE-2017-15715)
Apache HTTPD是一款HTTP服务器,它可以通过mod_php来运行PHP网页。其2.4.0~2.4.29版本中存在一个解析漏洞,在解析PHP时,`1.php\x0A`将被按照PHP后缀进行解析,导致绕过一些服务器的安全策略。
## 漏洞环境
编译及运行漏洞环境:
```
docker compose build
docker compose up -d
```
启动后Apache运行在`http://your-ip:8080`。
## 漏洞复现
上传一个名为1.php的文件,被拦截:

在1.php后面插入一个... | sec-knowleage |
### 堆的_int_malloc初始检查
| 检查目标 | 检查条件 | 信息 |
| :---: | :--------------------------------------: | :-----------------: |
| 申请的大小 | REQUEST_OUT_OF_RANGE(req) :((unsigned long) (req) >= (unsigned long) (INTERNAL_SIZE_T)(-2 * MINSIZE)) | __set_errno(ENOMEM) |
### 堆的_int_m... | sec-knowleage |
import subprocess
infile="mandog.png"
print "Running first collision."
subprocess.check_output(["./fastcol","-p",infile,"-o","a","b"])
col1a=open("a","rb").read()[-0x80:]
col1b=open("b","rb").read()[-0x80:]
print "Running second collision."
subprocess.check_output(["./fastcol","-p","a","-o","c","d"])
col2a=open("c",... | sec-knowleage |
# T1069-002-AD特权组/用户枚举
## 来自ATT&CK的描述
攻击者可能会尝试查找域级别的组和权限设置。域级别权限组的知识可以帮助攻击者确定存在哪些组以及哪些用户属于特定组。攻击者可以使用此信息来确定哪些用户具有提升的权限,例如域管理员。
在Windows操作系统上可以使用net group /domain命令进行查找,在Mac操作系统上使用dscacheutil -q group命令、Linux上可以使用ldapsearch命令查找。
## 测试案例
在侦察阶段检测到攻击者非常重要,因为如果攻击者正处于此阶段,则意味着已经绕过了所有外围设备和安全防护阶段。Microsoft Net.exe程序可用于枚举本地和域用户和... | sec-knowleage |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.