整个语句的含义是:使用${COOKIES['USERNAME']}作为作者名,${POST_PARAMS['title']}作为标题,${POST_PARAMS['text']}作为文本内容,创建一个帖子,并将新帖子的ID保存在post_id变量中
我看着好像也没对用户名进行检测,好像可以做手脚
继续审计
from bs4 import BeautifulSoup
import html
html_content = """
在这放入html
"""
使用Beautiful Soup解析HTML
soup = BeautifulSoup(html_content, 'html.parser')
提取所有的文本内容
plain_text = soup.get_text()
解码特殊字符转义
decoded_text = html.unescape(plain_text)
print(decoded_text)
对比图如下
function reply {
local post_id=$1;
local username=$2;
local text=$3;
local hashed=$(hash_username "${username}");
curr_id=$(for d in posts/${post_id}/*; do basename $d; done | sort -n | tail -n 1);
next_reply_id=$(awk '{print $1+1}' <<< "${curr_id}");
next_file=(posts/${post_id}/${next_reply_id});
echo "${username}" > "${next_file}";
echo "RE: $(nth_line 2 < "posts/${post_id}/1")" >> "${next_file}";
echo "${text}" >> "${next_file}";
# add post this is in reply to to posts cache
echo "${post_id}/${next_reply_id}" >> "users_lookup/${hashed}/posts";
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\x}"
}
max_page_include_depth=64
page_include_depth=0
function include_page {
# include_page
local pathname=$1
local cmd=""
[[ "${pathname:(-4)}" = '.wtf' ]];
local can_execute=$?;
page_include_depth=$(($page_include_depth+1))
if [[ $page_include_depth -lt $max_page_include_depth ]]
then
local line;
while read -r line; do
# check if we're in a script line or not ($ at the beginning implies script line)
# also, our extension needs to be .wtf
[[ "$" = "${line:0:1}" && ${can_execute} = 0 ]];
is_script=$?;
# execute the line.
if [[ $is_script = 0 ]]
then
cmd+=$'
'"${line#"$"}";
else
if [[ -n $cmd ]]
then
eval "$cmd" || log "Error during execution of ${cmd}";
cmd=""
fi
echo $line
fi
done < ${pathname}
else
echo "