Misc 日记 Day1

[HBNIS2018]来题中等的吧

打开图片发现是摩斯密码 .- .-.. .–. …. .- .-.. .- -… 解得alphalab 但是被gank了试了半天发现flag不对 去搜题解结果是小写… flag{alphalab}

[WUSTCTF2020]find_me

打开图片直接看了steg发现没有东西

看hxd发现exif疑似有东西

查看图片属性

发现疑似盲文

⡇⡓⡄⡖⠂⠀⠂⠀⡋⡉⠔⠀⠔⡅⡯⡖⠔⠁⠔⡞⠔⡔⠔⡯⡽⠔⡕⠔⡕⠔⡕⠔⡕⠔⡕⡍=

但好像不是正常的3*2的盲文

找到了一个网站

https://www.qqxiuzi.cn/bianma/wenbenjiami.php?s=mangwen

解得

wctf2020{y$0$u_f$1$n$d$_M$e$e$e$e$e}

[ACTF新生赛2020]base64隐写

打开发现是base64,但是题目说base64隐写,不过照题目的样子感觉如果直接解能直接解出来。

稍微试了下

#include<iostream>
#include<string>
#include<cstring>
#include<cstdio>
#define maxn 999

using nanespace std;

char$ca[maxn], cb[maxn];

int cmp(string a, string h
{
if(ksize() > b.size())
)"return 1;
else if(a.size() < b.size())
return -1;
else
{
for(int i = 0; i < a.size(); i++)
&
` $ if(a[i] < b[i])
&! & return&1;
` $ if(a[i] >`b[i])
(••••••
••&WGW&(
}
+#return 0;
}
}

void reseta(string a)
{
`memset(ca,0,sizeof(ca));
for(int i = 0; i < a.size(; i++)
{
ca[i] = a[a.size()-1-i] - '0';
}
}

void resetb(string b)
{
`memset(cb,0,sizeof(cb));
for(int i = 0; i < b.size(); i++)
{
` $cb[] = f[b.size().1-i] - '0';
` $//printf("%d",cb[i]);
}
}

string edd(string a, string b)//加法
{
reseta(a);//把每一位存的字符变成数字,并且把数组反过来便于后面不同位数相加
resetb(b);
for(int i#= 0; i <#maxn; i++)
{
ca[i] = ca[i] + cb[i];
if(ca[i] >= 2){
# ca[i+1] +=#1;
ca[i] -= 2;
}
}
bool flag = true;
string c = "";
for(int i = maxn - 1; i >= 0; i--)
{
if(flag && ca[i] == 0)
continue;
if(ca[i] != 0)
*" flag = false;
& += (ca[i] + '0');
//printf("%d",ca[i]);
}
if(flag)
` $return "0";
else
+#return c;
}

string minu(string a, string b)//减法
{
int sign = 0;
if(cmp(a, b) == -1)//a中应该存较大的那个数
{
sign = 1;
string temp = a;
a = b;
b = temp;
}
reseta(a);
resetb(b);
for(int i = 0; i < maxn; i++)
{
if(ca[i] < cb[i]){
ca[i+1] -= 1;
ca[i] += 2;
}
ca[i] = ca[i] - cb[i];
}
bool flag = true;
string d = "";
for(int i = maxn - 1; i >= 0; i--)
{
if(flag && ca[i] == 0)
continue;
if(ca[i] != 0)
flag = false;
d += (ca[i] + '0');
//printf("%d",ca[i]);
}
if(flag)
return "0";
else
return d;
}

string mul(string x, string y)//s为符号位
{
int lenx = x.size();
int leny = y.size();
if(lenx == 1)
{
//cout<<x<<" "<<y<<endl;
if(x == "1" && y == "1")
return "1";
else
return "0" ;
}

//printf("%d--%d\n",lenx,leny);

string a, b, c,d;
a = x.substr(0, lenx/2);
b = x.substr(lenx/2, lenx/2);
c = y.substr(0, leny/2);
d = y.substr(leny/2, leny/2);
printf("%d--%d--%d--%d--------------------------------------------%d-%d\n",a.size(), b.size(), c.size(), d.size(), x.size(), y.size());
//cout<<x<<":"<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
string ac = mul(a, c);
string bd = mul(b, d);
//cout<<x<<":"<<ac<<" "<<bd<<endl;
string ab = minu(a, b);//a-b
string cd = minu(d, c);
//cout<<x<<":"<<ab<<" "<<cd<<endl;

string abcd = mul(ab, cd);
//cout<<x<<":"<<abcd<<endl;

string first = ac;
for(int i = 0; i < (lenx); i++)
first += "0";
//cout<<ac<<" -----ac---- "<<first<<endl;

string second = add(abcd, ac);
second = add(second, bd);
for(int i = 0; i < (lenx/2); i++)
second += "0";

string fin = add(first, second);
return add(fin, bd);

}

int main(void)
{
string x, y;
printf("请输入两个二进制数字: ");
cin>>x>>y;
string ans = mul(x, y);
cout<<ans;
}

好吧他给了正确的思路,不过有点懒还是找了现成的脚本(

def inttobin(a, n):
   ret = bin(a)[2:]
   while len(ret) < n:
       ret = '0' + ret
   return ret

table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'

f = open("input.txt", "r")
tmpbin = ''
res = ''
line = f.readline()
while line:
   if line[-2] == '=':
       if line[-3] == '=':
           tmpbin += inttobin(table.index(line[-4]), 6)[2:]
       else:
           tmpbin += inttobin(table.index(line[-3]), 6)[4:]
   line = f.readline()
quotient = len(tmpbin)/8
for i in range(int(quotient)):
   res += chr(int(tmpbin[8*i:8*i+8], 2))
print(res)

把base64丢进去解得

ACTF{6aseb4_f33!}

[SWPU2019]伟大的侦探

打开发现是乱码

修改编码后没看出来

后来打开hex转成EBCDIC发现了

wllm_is_the_best_team[

但是密码不对看了其他人的wp发现是

wllm_is_the_best_team!

不知道为什么,打开后是象形文字

在dcode.fr找了下

明天传图片@todo

对应后

iloveholmesandwllm

flag{iloveholmesandwllm}

发表评论