一.拖入ida,来静态分析F5大法好



要注意的点:

1._gmz_init_set_str() 这个函数,也是看师傅的wp,学到的,以后还是得多google,
本质上是这个函数:
int mpz_init_set_str (mpz_t rop, const char *str, int base) [Function]
将str以base进制送入rop的内存
2._gmpz_pown()这个函数
void mpz_powm (mpz_t rop, const mpz_t base, const mpz_t exp, const mpz_t mod) [Function]
rop的exp次方,对mod取模

已经很明显的是rsa加密,解开就好了。


import binascii
import sys
import gmpy2
import re
from Crypto.Util import number
sys.setrecursionlimit(1000000)
def ByteToHex(bins):
return ''.join(["%02X" % x for x in bins]).strip()
def n2s(num): #将数字转成字符串
t = hex(int(num))[2:-1] # python
if len(t) % 2 == 1:
t = '0' + t
return (binascii.a2b_hex(t).decode('latin1'))
#求f(n)
def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:
g, y, x = egcd(b % a, a)
return (g, x - (b // a) * y, y)
def modinv(a, m):
g, x, y = egcd(a, m)
if g != 1:
raise Exception('modular inverse does not exist')
else:
return x % m
def getfn(p,q):
return (p-1)*(q-1)
#求n
def getn(p,q):
return p*q
#求d
def getd(e,fn):
k=0
while True:
if (fn*k+1)%e==0:
(d,m)=divmod(fn*k+1,e) #避免损失精度
return d
k+=1
e=65537
n=103461035900816914121390101299049044413950405173712170434161686539878160984549
p=282164587459512124844245113950593348271
q=366669102002966856876605669837014229419
c=0xad939ff59f6e70bcbfad406f2494993757eee98b91bc244184a377520d06fc35
# p=(psa+qsa)//2
# q=(psa-qsa)//2
d=gmpy2.invert(e,(p-1)*(q-1))
m=pow(c,int(d),n)
m=number.long_to_bytes(m)
print(m)
di=re.findall('\d+',str(m))
flag=""
for i in di:
flag+=chr(int(i,16))
print(flag)

buu signin的更多相关文章

  1. gitlab不小心把sign-in取消了怎么恢复

    环境和版本 [root@linux-node1 etc]# ll /var/cache/yum/x86_64/7/gitlab-ce/packages/ total 292928 -rw-r--r-- ...

  2. Integrating Google Sign-In into Your Android App

    To integrate Google Sign-In into your Android app, configure Google Sign-In and add a button to your ...

  3. 微软Bot Framework文档中,关于Sign-in Card的一处代码错误及更正

    Bot Framework文档出错处网址:https://docs.botframework.com/en-us/csharp/builder/sdkreference/attachments.htm ...

  4. 服务器时间误差导致的google sign-in后台验证错误(远程调试java程序)

    https://developers.google.com/identity/sign-in/web/backend-auth import com.google.api.client.googlea ...

  5. IdentityServer4 sign-in

    原文地址 Sign-in IdentityServer 代表 user 分配token之前,user必须登录IdentityServer Cookie authentication 使用 cookie ...

  6. Buu刷题

    前言 希望自己能够更加的努力,希望通过多刷大赛题来提高自己的知识面.(ง •_•)ง easy_tornado 进入题目 看到render就感觉可能是模板注入的东西 hints.txt给出提示,可以看 ...

  7. BUU刷题01

    [安洵杯 2019]easy_serialize_php 直接给了源代码 <?php $function = @$_GET['f']; function filter($img){ $filte ...

  8. buu学习记录(上)

    前言:菜鸡误入buu,差点被打吐.不过学到了好多东西. 题目名称: (1)随便注 (2)高明的黑客 (3)CheckIn (4)Hack World (5)SSRF Me (6)piapiapia ( ...

  9. 攻防世界 reverse SignIn

    SignIn    2019_SUCTF __int64 __fastcall main(__int64 a1, char **a2, char **a3) { char mod; // [rsp+0 ...

随机推荐

  1. 第13讲 | 套接字Socket:Talk is cheap, show me the code

    第13讲 | 套接字Socket:Talk is cheap, show me the code 基于 TCP 和 UDP 协议的 Socket 编程.在讲 TCP 和 UDP 协议的时候,我们分客户 ...

  2. python操作mongodb根据_id查询数据的实现方法

    python操作mongodb根据_id查询数据的实现方法   python操作mongodb根据_id查询数据的实现方法,实例分析了Python根据pymongo不同版本操作ObjectId的技巧, ...

  3. 《MySQL面试小抄》索引考点一面总结

    <MySQL面试小抄>索引考点一面总结 我是肥哥,一名不专业的面试官! 我是囧囧,一名积极找工作的小菜鸟 囧囧表示:面试最怕的就是面试官问的知识点太笼统,自己无法快速定位到关键问题点!!! ...

  4. java中存储mysql数据库时间类型【date、time、datetime、timestamp】

    在MySQL中对于时间的存储自己见表的时候都是设置的varchar类型的,感觉挺方便的. 昨天拿别人建好的表写代码,发现这张表中时间类型为datetime的,凭感觉试了一下不行,网上查了刚开始试了好几 ...

  5. 优雅关闭springboot应用

    1.添加钩子函数,钩子函数中指定要调用的方法 @PostConstruct public void run() { this.zkClient.start(this); this.schedulerS ...

  6. 工作流中的数据持久化详解!Activiti框架中JPA的使用分析

    Activiti中JPA简介 可以使用JPA实体作为流程变量, 并进行操作: 基于流程变量更新已有的JPA实体,可以在用户任务的表单中填写或者由服务任务生成 重用已有的领域模型,不需要编写显示的服务获 ...

  7. 三维点云去噪无监督学习:ICCV2019论文分析

    三维点云去噪无监督学习:ICCV2019论文分析 Total Denoising: Unsupervised Learning of 3D Point Cloud Cleaning 论文链接: htt ...

  8. 智能驾驶L2发展策略

    智能驾驶L2发展策略 智能驾驶L2,以们通俗的定义是,以高级辅助驾驶的产品为主的各种巡航产品,包括定速巡航,自适应巡航ACC,预见性巡航,智能巡航等等. 车辆驾驶是集注意力高度集中,手把控方向盘和换挡 ...

  9. 使用CUDA Warp-Level级原语

    使用CUDA Warp-Level级原语 NVIDIA GPU以SIMT(单指令,多线程)的方式执行称为warps 的线程组.许多CUDA程序通过利用warp执行来实现高性能.本文将展示如何使用cud ...

  10. 循环IRNNv2Layer实现

    循环IRNNv2Layer实现 IRNNv2Layer实现循环层,例如循环神经网络(RNN),门控循环单元(GRU)和长期短期记忆(LSTM).支持的类型为RNN,GRU和LSTM.它执行循环操作,该 ...