buu题解—相册,level1

相册:

打开题目,下载附件,发现是apk文件,在jd_gui中打开

 看到base64密码,没找到密文,没看懂。翻了一下大佬的wp找到。

找到Native Method,百度一下。

Native Method就是一个java调用非java代码的接口。一个Native Method是这样一个java的方法:该方法的实现由非java语言实现,比如C。这个特征并非java所特有,很多其它的编程语言都有这一机制,比如在C++中,你可以用extern "C"告知C++编译器去调用一个C的函数。

对于NativeMethod的问题,要到apk中对应的位置找到native-lib.so然后拖到IDA中

(直接将文件拖到ida中,找到对应文件)

找到三个base64密文,解出发现第二个为flag

flag{18218465125@163.com}

学到的知识点、:

1.对于apk中NativeMethod接口,找到对应的so文件,拖入ida中。

level1:

打开题目,下载附件。找到主函数分析

int __cdecl main(int argc, const char **argv, const char **envp)
{
  int i; // [rsp+4h] [rbp-2Ch]
  FILE *stream; // [rsp+8h] [rbp-28h]
  char ptr[24]; // [rsp+10h] [rbp-20h] BYREF
  unsigned __int64 v7; // [rsp+28h] [rbp-8h]

  v7 = __readfsqword(0x28u);
  stream = fopen("flag", "r");                  //  fopen函数打开文件用于读写,此处为对文件只读
  fread(ptr, 1uLL, 0x14uLL, stream);            // fread函数用于将文件中的数据读取到指定,即将stream中的数据读到ptr中
  fclose(stream);                               // fclose函数用来关闭一个已打开的文件
  for ( i = 1; i <= 19; ++i )
  {
    if ( (i & 1) != 0 )
      printf("%ld\n", (unsigned int)(ptr[i] << i));// a<<b对于整数表示“向左移动”。的按位表示a是左移位b
    else
      printf("%ld\n", (unsigned int)(i * ptr[i]));
  }
  return 0;
}

写脚本解密

 #include<stdio.h>
 int main(){
 	long long ptr[19]={198,232,816,200,1536,300,6144,984,51200,570,92160,1200,565248,756,1474560,800,6291456,1782,65536000};
 	int i,j;
 	for ( i = 1; i <= 19; ++i )
  {
    if ( (i & 1) != 0 )
    for(j=0;j<=256;j++){
    	if(ptr[i-1]==(j << i))
    	printf("%c",j);
	}
     
    else
    for(j=0;j<=256;j++){
    	if(ptr[i-1]/i==j)
    	printf("%c",j);
	}
     
  }
 	return 0;
 }

得到flag{d9-dE6-20c}

学到的知识:

  1.fopen函数(打开文件),fread函数(将指定文件读取到指定位置),fclose函数(关闭文件)。

  2.a<<b含义.

 

### BUU LFI Course Materials and Resources #### Overview of the Local File Inclusion (LFI) Vulnerability Local File Inclusion vulnerabilities occur when a web application allows user input to specify which files should be included dynamically within the server-side script, such as PHP's `include` or `require`. If not properly sanitized, this can lead to unauthorized access to sensitive system files or even remote code execution. In the context of BUU LFI courses, participants are introduced to various techniques for exploiting these types of vulnerabilities through practical exercises. The primary focus is on understanding how improper handling of file paths leads to security risks[^1]. #### Practical Example from BUU LFI Courses One specific example involves an exercise where users must exploit a vulnerable parameter named 'file'. By manipulating URL parameters like so: ``` http://example.com/index.php?file=../../../../etc/passwd ``` Participants learn that traversing directories using sequences of '../' enables them to reach higher-level folders until reaching critical areas containing flags or other important data points[^2]. For instance, accessing the flag might involve navigating back several levels relative to the current working directory by specifying multiple parent-directory references (`../../..`) before pointing towards the target resource ('flag'). ```bash http://target-url/?file=../../../flag ``` This demonstrates both theoretical knowledge about path traversal attacks alongside hands-on experience with real-world exploitation scenarios provided during training sessions at platforms similar to those described above[^5]. #### Detecting Server Environment Through Error Messages Another aspect covered includes methods for identifying whether the underlying operating system running behind-the-scenes is Windows or Linux based solely upon error messages returned after attempting invalid inputs via query strings attached directly onto URLs[^4]: - **Windows**: Typically shows errors related to missing semicolons (;), colons (:), etc., often associated with incorrect syntax used while trying to reference local filesystem objects. - **Linux/Unix-like Systems**: May display permission denied issues due to restricted permissions set against certain protected locations outside public_html directories unless explicitly allowed otherwise. Understanding differences between OS-specific behaviors helps refine attack vectors tailored specifically toward bypassing defenses present under different environments encountered throughout challenges posed within CTF competitions hosted online. --related questions-- 1. How does one differentiate between absolute vs relative paths in crafting payloads targeting LFI flaws? 2. What measures can developers take to prevent LFI vulnerabilities effectively? 3. Can you explain why it’s crucial to sanitize all forms of external input thoroughly prior to processing inside scripts responsible for including external resources? 4. Are there any tools recommended for automating detection and exploitation processes concerning LFI weaknesses found across diverse applications built over varying technologies stacks? 5. Describe common pitfalls beginners face learning about LFI exploits and suggest ways they could improve their skills progressively without compromising personal systems unintentionally.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值