[Buuctf] [SUCTF2019]signin

在这里插入图片描述

1.查壳

在这里插入图片描述
64位elf文件,没有壳

2.用64位IDA打开

找到主函数,F5查看伪代码
在这里插入图片描述
有一个sub_96A函数对输入的字符串做了处理,双击进去看一下内容
在这里插入图片描述
对于熟悉汇编代码的人,这里应该是可以看出来的
这里右移四位把高四位放到低四位返回的是一个字节的高四位的值,然后下一行,& 0xF是把高四位清零了然后将低四位返回,其实就是把一个字符的ascii码值返回了。
这个函数的作用就是返回字符串对应的ASCII码值。
接着往下看,出现的是一堆不认识的函数,我们得去查他们的作用

 __gmpz_init_set_str(x,a,b):以b进制保存a到x中
__gmpz_powm(v6, v6, v5, v4); v6的v5次方再%v4存储到v6中
__gmpz_cmp(v6, v7);			比较,v6 == v7 返回0

这里就可以看出这是一个rsa加密,v7是密文
N=103461035900816914121390101299049044413950405173712170434161686539878160984549
e=65537
而将n分解的话我们一个用一个网站
http://www.factordb.com/
在这里插入图片描述
然后上脚本

import gmpy2
import binascii
N=103461035900816914121390101299049044413950405173712170434161686539878160984549
p=282164587459512124844245113950593348271
q=366669102002966856876605669837014229419
v7=0xad939ff59f6e70bcbfad406f2494993757eee98b91bc244184a377520d06fc35
e = 65537
d=gmpy2.invert(e,(p-1)*(q-1))
m=gmpy2.powmod(v7,d,N)
byte_202010=[0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66]
print(binascii.unhexlify(hex(m)[2:]).decode(encoding="utf-8"))
>>>suctf{Pwn_@_hundred_years}

flag{Pwn_@_hundred_years}

  • 6
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
"Place sign in" 错误通常出现在使用 Spring Security 进行身份验证的应用程序中。这通常意味着用户没有通过身份验证并且没有正确的会话信息。可能的原因是在使用 HttpSession 时,没有正确地配置 Spring Security。 为了解决这个问题,你可以尝试以下步骤: 1. 确保在 Spring Security 配置中启用了会话管理: ```java @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.ALWAYS); } } ``` 2. 确保使用 Spring Security 进行身份验证时,正确地配置了 HttpSession: ```java @Configuration @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .sessionManagement() .sessionCreationPolicy(SessionCreationPolicy.ALWAYS) .and() .formLogin() .loginPage("/login") .permitAll() .and() .logout() .logoutSuccessUrl("/") .permitAll() .and() .authorizeRequests() .antMatchers("/admin/**").hasRole("ADMIN") .anyRequest().authenticated(); } @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth .inMemoryAuthentication() .withUser("user").password("password").roles("USER") .and() .withUser("admin").password("password").roles("USER", "ADMIN"); } } ``` 3. 确保在使用 HttpSession 时,正确地配置了 Spring Boot 的属性: ```properties # application.properties server.servlet.session.timeout=30m ``` 如果你仍然遇到问题,可能需要进一步检查你的代码和配置是否正确。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值