douguan3470 2019-05-15 13:37
浏览 84

如何使用python请求登录基于SMF开源软件的网站

I'm trying to use python requests to login into a website. The only catch is that it is based on SMF and uses sha1 to encrypt and send a hashed password. I know how it is encrypted but I don't where to get smf_session_id which is required to encrypt the password.

I've tried seeing looking through all the javascript files on the website but I can't find where it's defined. I've also tried seeing if the __cfduid or PHPSESSID have any relationship to it but it's different.

Python

payload = {
'user': 'user',
'passwrd': my_hash_function('pass') #I don't know where/how to get smf_session_id to complete the hash 

with requests.Session() as s:
    p = s.post('http://www.example.com/SMF/index.php?action=login2', data=payload)        

print (s.cookies)        
print ("Status Code: ", p.status_code)

payload = {'test': 'testparm'}
r = s.get('http://www.example.com/cgi-bin/vote_rank.cgi', data=payload)
print (r.status_code)
print (s.cookies)
print (r.headers)

Javascript

if (cur_session_id == null)         
    cur_session_id = smf_session_id; 

doForm.hash_passwrd.value = hex_sha1(hex_sha1(doForm.user.value.php_to8bit().php_strtolower() + doForm.passwrd.value.php_to8bit()) + cur_session_id)
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 对于这个复杂问题的解释说明
    • ¥50 三种调度算法报错 采用的你的方案
    • ¥15 关于#python#的问题,请各位专家解答!
    • ¥200 询问:python实现大地主题正反算的程序设计,有偿
    • ¥15 smptlib使用465端口发送邮件失败
    • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
    • ¥15 对于squad数据集的基于bert模型的微调
    • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
    • ¥20 steam下载游戏占用内存
    • ¥15 CST保存项目时失败