自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(60)
  • 资源 (1)
  • 收藏
  • 关注

原创 蓝队面试知识点整理

蓝队面试知识点整理

2022-05-07 10:11:13 8633

原创 WEB安全-PHP代码执行漏洞

一、漏洞成因当应用在调用一些能将字符转化为代码的函数(如PHP中的eval,assert)时,没有考虑用户是否能控制这个字符串,这就会造成代码执行漏洞。二、PHP漏洞环境搭建2.1 phpstudy环境安装phpStudy Linux 面板简称小皮面板,小皮面板是phpStudy官方开发团队在2019.10.8号发布的一款Linux服务器管理软件,一键LAMP/LNMP、创建网站及FTP、数据库、文件管理、PHP多版本共存及切换、SSL、计划任务以及服务器网站安全管理。Centos安装脚本

2020-05-28 11:42:04 680

原创 剑指offer13-15:链表中倒数第K个结点、反转链表、合并两个排序的列表

13、链表中倒数第K个结点输入一个链表,输出该链表中倒数第k个结点。思路:定义两个指针都指向头部,先让第一个指针走k步,然后两个指针一起向后走,直到第一个指针为空,此时第二个指针就是倒数第k个。或者也可以先进行一次遍历,求出长度然后求出倒数k个的值。/*public class ListNode { int val; ListNode next = null; L...

2020-03-23 17:30:00 205

原创 剑指offer10-12:二进制中1的个数、数值的整数次方、调整数组顺序使奇数位于偶数前面

10、二进制中1的个数输入一个整数,输出该数二进制表示中1的个数。其中负数用补码表示。思路:方法一,无符号右移,整数n变成二进制表示后逐个判断最低位是否是1,如果是1就让计数器加1,然后进行无符号右移1位,如果不是1,就直接右移1位,直到传入的整数n变成0停止。如何判断最低位是否是0,可以用n&1来判断。public class Solution { public int N...

2020-03-22 11:40:16 185

原创 剑指offer7-9:跳台阶、变态跳台阶、矩阵覆盖

7、跳台阶一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法(先后次序不同算不同的结果)。思路:简单的一维动态规划,dp[1]=1,dp[2]=2;到达第n阶(n>2)有两种方法,从第n-2阶一次跳两阶上去或者从第n-1阶跳一阶上去。于是可得状态转移方程:dp[n]=dp[n-1]+dp[n-2];public class Solution { ...

2020-03-22 10:44:07 121

原创 剑指offer4-6:重建二叉树、用两个栈实现队列、旋转数组的最小数字

4、重建二叉树输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。思路:因为是树的结构,一般都是用递归来实现。用数学归纳法的思想就是,假设最后一步,就是root的左右子树都已经重建好了,那么我只要考虑将root...

2020-03-21 18:02:47 138

原创 剑指offer1-3:二维数组中的查找、替换空格、从尾到头打印链表

1、二维数组中的查找题目描述在一个二维数组中(每个一维数组的长度相同),每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。思路:从二维数组的左下角开始比较,若数组中的元素大于待查数字,则往上找,即height–(因为该行都比待查数字大),若数组中的元素小于待查数字,则往右找,即i++publi...

2020-03-18 10:23:36 135

原创 WEB安全-SSRF服务器端请求伪造

一、SSRF简介服务端请求伪造,用户通过 WEB 访问/上传/发出请求,绕过服务器防火墙,获取服务器及其内网信息。SSRF 可以说是一个媒介,结合服务器中的服务,常常可以形成一条完整的攻击链。可以利用存在缺陷的web应用作为代理攻击远程和本地的服务器一般情况下,SSRF攻击的目标是从外网无法访问的内部系统。(正是因为它是由服务端发起的,所以它能够请求到与它相连而与外网隔离的内部系统)二、...

2020-03-08 23:32:53 436

原创 WEB安全-命令执行漏洞

一、什么是命令执行漏洞?1、概述在Web 程序中,因为业务功能需求要通过Web前端传递参数到后台服务器上执行。但由于开发人员没有对输入进行严格的过滤,导致攻击者可以构造一些额外的“带有非法目的”命令,去欺骗后台服务器执行这些非法命令。在存在命令执行漏洞的情况下,如果Web 应用使用的是root权限,则该漏洞可以导致攻击者在服务器上执行任意命令。以DVWA平台low 安全等级为例,我们来看...

2020-03-02 18:53:08 1446

原创 WEB安全-文件解析漏洞

一、什么是文件解析?当服务器接收到一个HTTP请求的时候,web容器(如IIS、Apache)首先会根据文件的后缀名,来决定如何去处理这个请求。当服务器获取到所请求的页面的后缀(如.php)后,接下来就会在服务器端寻找可以处理这类后缀名的应用程序,如果找不到则直接把这个文件返还给客户端。二、Apache 解析漏洞(1)漏洞原理该解析漏洞属于用户配置问题,且Apache与php的结合方式为...

2020-03-02 18:15:30 598

原创 WEB安全-文件上传漏洞

一、什么是文件上传漏洞大多数网站都有文件上传的接口,如果没有对上传的文件类型做严格的限制,会导致攻击者可以上传恶意文件。(例如Webshell)利用这些恶意文件,攻击者可能获取到执行服务器端命令的能力。二、漏洞分析我们从DVWA网站的代码来理解文件上传漏洞。网站上传界面:(1)low 等级前端代码:前端通过POST方法,将文件传给php处理:PHP通过$_FILES方法接收...

2020-03-02 16:55:56 644

原创 WEB安全-CSRF攻击

一、什么是CSRF攻击?CSRF(Cross-Site Request Forgery)跨站点请求伪造。是指利用受害者未失效的身份认证信息(cookie、session等),诱骗其点击恶意链接或者访问包含攻击代码的页面,在受害人不知情的情况下,以受害人的身份向(身份认证信息所对应的)服务器发送请求,从而完成非法操作(如转账、改密等)的一种攻击行为。二、攻击过程依然是我们非常好用的DVWA...

2020-03-02 15:46:31 241

原创 WEB安全-XSS

一、XSS概述XSS全称Cross Site Script,跨站脚本攻击。通常指攻击者通过“HTML注入”篡改网页,插入恶意脚本,从而在用户浏览网页时,控制用户浏览器的一种攻击手段 。到底什么是XSS呢?我们直接来看一个例子。我们先写一个前端页面,要求用户输入用户名,并传给后端处理:后端处理页面,网页将接收到的用户名直接输出到页面上:访问前端页面,输入用户名Monster:点击...

2020-03-02 09:03:59 372

转载 WEB安全-SQL注入

一、SQL注入概述利用web应用程序对用户输入验证上的疏忽,攻击者在输入的数据中包含对某些数据库系统有特殊意义的符号或命令。通过将这些恶意命令拼接到正常的SQL执行语句中一并执行,达到对后台数据库系统直接下达命令的攻击方式,称为SQL注入。提问:为什么可以把构造的SQL命令插入到正常的SQL执行语句中一并执行呢?SQL查询支持and、or、union等多种查询方法,攻击者可以通过这些方法,...

2020-03-01 17:14:07 445

原创 CTF-RSA1(已知p、q、dp、dq、c)

题目:p = 8637633767257008567099653486541091171320491509433615447539162437911244175885667806398411790524083553445158113502227745206205327690939504032994699902053229 q = 12640674973996472769176047937170...

2019-10-24 15:35:34 9618 15

原创 CTF-伪加密

伪加密题目来源:buuCTF-crypto-zip伪加密原理zip伪加密是在文件头的加密标志位做修改,进而再打开文件时识被别为加密压缩包。背景一个 ZIP 文件由三个部分组成:压缩源文件数据区+压缩源文件目录区+压缩源文件目录结束标志详情:http://blog.csdn.net/wclxyn/article/details/7288994实例用Winhex工具打开zip文件查看...

2019-10-21 12:17:35 7247

原创 CTF-变异凯撒

先用常规的凯撒密码试试看https://planetcalc.com/1434/这个网址分方便,可以一次凯撒密码的26种情况一次性列举出来,比较方便没有找到有用的信息联想到题目的名字,变异凯撒,正常手段行不通应该会是对移位的位数这里下绊子找一张ascii表看一下结合题目给的提示、发现从 a 到 f 移动了5位从 f 到 l 移动了6位从 Z 到 a 移动了7位从 _ ...

2019-10-21 10:48:56 484

原创 模型选择与调优(KNN)

一、交叉验证(cross validation)将拿到的训练数据,分为训练和验证集。以下图为例:将数据分成4份,其中一份作为验证集。然后经过4次(组)的测试,每次都更换不同的验证集。即得到4组模型的结果,取平均值作为最终结果。又称4折交叉验证。二、超参数搜索-网格搜索通常情况下,有很多参数是需要手动指定的(如k-近邻算法中的K值), 这种叫超参数。但是手动过程繁杂,所以需要对模型预设几种超...

2019-10-18 18:45:43 540

原创 snort规则

Snort规则被分成两个逻辑部分:规则头和规则选项。规则头包含规则的动作,协议,源和目标ip地址与网络掩码,以及源和目标端口信息;规则选项部分包含报警消息内容和要检查的包的具体部分。1. 规则头规则动作在snort中有五种动作:alert、log、pass、activate和dynamic.Alert:使用选择的报警方法生成一个警报,然后记录(log)这个包。 Alert动作用来在一个...

2019-09-19 18:55:04 11180

原创 K-近邻算法(KNN)

1. 转换器回忆之前做特征工程的步骤:- 1 实例化(实例化的是一个转换器类)- 2 调用fit_transform(对文档建立分类词频矩阵)我们把特征工程的接口称之为转换器,其中转换器调用的形式是:fit_transformfit_transform是fit和transform的组合...

2019-08-13 18:39:33 225

原创 特征预处理——降维

降维降维是指在某些限定条件下,较低特征的个数,得到一组“不相关”的主变量的过程1、特征选择

2019-08-02 18:51:17 331

原创 sklearn自带数据集的使用以及特征提取、特征预处理

一、sklearn自带数据集的使用1.导入鸢尾花数据集,查看你数据集的描述以及特征from sklearn.datasets import load_irisdef datasets_demo(): iris = load_iris() print("鸢尾花数据集:\n",iris) print("查看数据集描述:\n",iris["DESCR"]) pr...

2019-07-30 16:53:10 7016

原创 LeetCode.27:Remove Element

Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this by modifying the input array...

2019-05-25 20:04:41 84

原创 LeetCode.26:Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifyin...

2019-05-23 09:57:54 68

原创 LeetCode.25:Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the number of n...

2019-05-22 10:31:52 80

原创 LeetCode.24: Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.You may not modify the values in the list’s nodes, only nodes itself may be changed.思路:非递归,重指针操作用三个指针不停的变换位置来交换结点,需仔细理解,想了好久,推...

2019-05-20 22:43:59 103

原创 LeetCode.23: Merge k Sorted Lists

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[ 1->4->5, 1->3->4, 2->6]Output: 1->1->2->3->4-&gt...

2019-05-19 22:46:32 78

原创 LeetCode.22: Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())", ...

2019-05-18 13:51:09 87

原创 LeetCode.21: Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1->3->4Output: 1-&gt...

2019-05-16 16:55:14 129

原创 LeetCode.20:Valid Parentheses

Given a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of br...

2019-05-13 22:50:58 77

原创 LeetCode.19:Remove Nth Node From End of List

Given a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the ...

2019-05-10 16:19:32 89

原创 LeetCode.18 4Sum

Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of tar...

2019-05-10 14:42:44 83

原创 LeetCode-17. Letter Combinations of a Phone Number

Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is give...

2019-05-08 15:55:15 141

原创 LeetCode-16. 3Sum Closest

Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would ...

2019-05-07 16:20:32 115

原创 LeetCode.15:3Sum

Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set must not contai...

2019-05-06 10:51:01 73

原创 LeetCode.14:Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”.Example 1:Input: ["flower","flow","flight"]Output: "fl...

2019-04-28 21:07:12 122

原创 LeetCode.12、13:Integer to Roman、Roman to Integer

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D ...

2019-04-27 19:55:04 94

原创 LeetCode.11:Container With Most Water

Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two l...

2019-04-26 14:48:08 108

原创 LeetCode.63:Unique Paths II【DP】

A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bot...

2019-04-24 16:42:34 138

原创 LeetCode.62:Unique Paths【DP】

A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bot...

2019-04-24 15:57:02 111

Ocaml循环队列模块

最近由于项目需要,需要用OCaml语言去实现一个循环队列去实现一些功能。翻遍了Ocaml的官方网站和标准库,发现OCaml只提供普通的队列,于是自己基于Array模块设计了循环队列RoundRobinQueue的模块。能够实现Queue中的基本功能

2019-03-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除