รูปแบบความเสี่ยง: OWASP Top 10 A07:2025 Authentication Failures
คำอธิบาย: ระบบยืนยันตัวความน่าเชื่อถือต่ำ ไม่ได้สัดส่วนกับความสำคัญของระบบ
วันที่รายงาน: 20 มีนาคม 2569
วันที่หน่วยงานรับทราบ: 20 มีนาคม 2569
| import discord | |
| from discord.ext import commands | |
| import aiohttp | |
| # 1. ตั้งค่าพื้นฐานของบอท | |
| intents = discord.Intents.default() | |
| intents.message_content = True # เปิดใช้งานการอ่านข้อความ | |
| bot = commands.Bot(command_prefix='!', intents=intents) | |
| @bot.event |
| [ | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "tokenAddress", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint160", |
| const ethers = require('ethers'); | |
| async function app() { | |
| const abi = [ | |
| 'event Transfer(address indexed from, address indexed to, uint256 value)' | |
| ]; | |
| const provider = new ethers.providers.JsonRpcProvider('https://data-seed-prebsc-1-s1.binance.org:8545/'); // BSC TESTNET |
| /* | |
| // this is what you normally do, right? | |
| const provider = new ethers.providers.Web3Provider(window.ethereum); | |
| const signer = provider.getSigner(); | |
| const USDT = new ethers.Contract('0xdAC17F958D2ee523a2206206994597C13D831ec7', [ | |
| 'function transfer(address recipient, uint256 amount) external returns (bool)' | |
| ], signer); | |
| // require ethers@5 | |
| const Sphinx31Watcher = provider.on('block', async function(){ | |
| const provider = new ethers.providers.JsonRpcProvider('https://rpc-l1.jibchain.net'); | |
| const wallet = new Wallet('0x...private_key....'); | |
| const Sphinx31 = new ethers.Contract('0xd431d826d7a4380b9259612176f00528b88840a7', [ | |
| 'function supplier(address addr) view returns (bool isCraft, uint256 machineIndex, uint256 laststamp)', | |
| 'function machine(uint256 _machineIndex) view returns (bool active, uint256 duration, uint256 miceCost, uint256 cmjCost, uint256 sx31Reward)', | |
| 'function obtain(uint256 _machineIndex)' |
| async function getAssetsOfAddress(addr){ | |
| const parseNFTMetadata = async function (metadata, ipfs_gateway = 'https://ipfs.8api.sh/ipfs/'){ | |
| const applyIPFSGateway = function(uri){ | |
| if(uri instanceof Array){ | |
| return uri.map(i=>applyIPFSGateway(i)); | |
| }else if(typeof uri === 'object'){ | |
| Object.keys(uri).forEach(k=>{ | |
| uri[k] = applyIPFSGateway(uri[k]); | |
| }); | |
| return uri; |
| async function parseNFTMetadata(metadata, ipfs_gateway = 'https://ipfs.io/ipfs/'){ | |
| const applyIPFSGateway = function(uri){ | |
| if(uri instanceof Array){ | |
| return uri.map(i=>applyIPFSGateway(i)); | |
| }else if(typeof uri === 'object'){ | |
| Object.keys(uri).forEach(k=>{ | |
| uri[k] = applyIPFSGateway(uri[k]); | |
| }); | |
| return uri; | |
| }else if(typeof uri === 'string'){ |
| const slip39 = require('slip39'); | |
| const original = 'Secret Message Here'; | |
| const shares = splitSLIP39(original); | |
| console.log('Shares', shares); | |
| const recoverd = recoverSLIP39([shares[1], shares[0]]); // pick any two to recover | |
| console.log(recoverd); |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.4; | |
| import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
| import "@openzeppelin/contracts/utils/Counters.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| contract ThaiChainSBT is ERC721URIStorage, Ownable { | |
| using Counters for Counters.Counter; | |
| Counters.Counter private _tokenIds; | |