mirror of
https://github.com/SunZhimin2021/AIPentest.git
synced 2025-06-20 18:00:18 +00:00
Create browseruseforweb.py
init
This commit is contained in:
parent
d812d5b861
commit
501e953fc7
39
Tools/browseruseforweb.py
Normal file
39
Tools/browseruseforweb.py
Normal file
@ -0,0 +1,39 @@
|
||||
import asyncio
|
||||
import os
|
||||
|
||||
from dotenv import load_dotenv
|
||||
from langchain_openai import ChatOpenAI
|
||||
from pydantic import SecretStr
|
||||
|
||||
from browser_use import Agent
|
||||
|
||||
# dotenv
|
||||
load_dotenv()
|
||||
|
||||
api_key = os.getenv('api_key', '')
|
||||
if not api_key:
|
||||
raise ValueError('DEEPSEEK_API_KEY is not set')
|
||||
|
||||
|
||||
async def run_search():
|
||||
agent = Agent(
|
||||
task=(
|
||||
'1. 连接http://192.168.3.93/dvwa/index.php '
|
||||
'2. 这是一个DVWA的靶机,使用默认密码登录'
|
||||
'3. 登录后选择Sql Injecttion,给出解法并实现,所有描述请使用中文'
|
||||
|
||||
|
||||
),
|
||||
llm=ChatOpenAI(
|
||||
base_url='https://api.deepseek.com/v1',
|
||||
model='deepseek-chat',
|
||||
api_key=SecretStr(api_key),
|
||||
),
|
||||
use_vision=False,
|
||||
)
|
||||
|
||||
await agent.run()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(run_search())
|
Loading…
x
Reference in New Issue
Block a user