
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
GeminiKit is an unofficial Python wrapper developed through reverse-engineering. This tool utilizes cookie values to interact with Google Gemini for testing purposes.
To install GeminiKit, you can use pip:
pip install -U geminikit
or
pip install git+https://github.com/rekcah-pavi/geminikit
For a detailed video guide, click here.
Ensure all tabs are closed in Google Chrome.
chrome://net-export/
.Include cookies and credentials
.Maximum log size
to 1 MB
.Start logging
button.Stop logging
button.from geminikit import get_cookies_from_file
with open("chrome-net-export-log.json", 'r') as f:
cookies = get_cookies_from_file(f.read())
print(cookies)
from geminikit import get_cookies_from_file
from geminikit import Gemini
with open("chrome-net-export-log.json", 'r') as f:
cookies = get_cookies_from_file(f.read())
gemini = Gemini(cookies)
from geminikit import get_cookies_from_file
from geminikit import Asynic_Gemini as Gemini
import asyncio
import aiofiles #pip install aiofiles
async def main():
async with aiofiles.open("chrome-net-export-log.json", mode='r') as f:
cookies = get_cookies_from_file(await f.read())
gemini = await Gemini.create(cookies)
asyncio.run(main())
res = gemini.ask("hello")
print(res['text'])
res = await gemini.ask("hello")
print(res['text'])
response = gemini.ask("tell me a joke")
print(res['text'])
#user value must be a dictionary containing SNlM0e, conversation_id, response_id, choice_id (available inside the response dictionary)
res = gemini.ask("another one",user=response)
print(res['text'])
response = await gemini.ask("tell me a joke")
print(res['text'])
#user value must be a dictionary containing SNlM0e, conversation_id, response_id, choice_id (available inside the response dictionary)
res = await gemini.ask("another one",user=response)
print(res['text'])
res = gemini.speech("hello")
#res = gemini.speech("hello", lang_code="en")
with open("a.wav", "wb") as f:
f.write(res)
import aiofiles #pip install aiofiles
res = await gemini.speech("hello")
#res = gemini.speech("hello", lang_code="en")
async with aiofiles.open("a.wav", mode='wb') as f:
await f.write(res)
with open("cat.jpg", "rb") as f:
img_link = gemini.upload_image(f.read())
photo = ['cat.jpg', img_link] # photo name (if not available, use 'none.jpg'), link
res = gemini.ask("What is in this photo?", photo=photo)
print(res['text'])
import aiofiles #pip install aiofiles
async with aiofiles.open("cat.jpg", mode='rb') as f:
img_data = await f.read()
img_link = await gemini.upload_image(img_data)
photo = ['cat.jpg', img_link] # photo name (if not available, use 'none.jpg'), link
res = await gemini.ask("What is in this photo?", photo=photo)
print(res['text'])
res = gemini.ask("send me some wallpapers")
print(res['text'])
#Or You can access URLs directly
for url in res['image_urls']:
img_name = url.split("/")[-1]
img_bytes = gemini.get_img_bytes(url)
with open(img_name, 'wb') as f:
f.write(img_bytes)
import aiofiles #pip install aiofiles
res = await gemini.ask("send me some wallpapers")
print(res['text'])
#Or You can access URLs directly
for url in res['image_urls']:
img_name = url.split("/")[-1]
img_bytes = await gemini.get_img_bytes(url)
async with aiofiles.open(img_name, mode='wb') as f:
await f.write(img_bytes)
res = gemini.ask("Generate an image of a cat holding a rose.")
print(res['text'])
for url in res['generated_image_urls']:
img_name = url.split("/")[-1][:10] + ".png"
img_bytes = gemini.get_img_bytes(url)
with open(img_name, 'wb') as f:
f.write(img_bytes)
import aiofiles #pip install aiofiles
res = await gemini.ask("Generate an image of a cat holding a rose.")
print(res['text'])
for url in res['generated_image_urls']:
img_name = url.split("/")[-1][:10] + ".png"
img_bytes = await gemini.get_img_bytes(url)
async with aiofiles.open(img_name, mode='wb') as f:
await f.write(img_bytes)
res = gemini.ask("Hi")
url = gemini.share(res['conversation_id'], res['response_id'], res['choice_id'], res['req_id'], res['fsid'], title="test by me")
print(url)
res = await gemini.ask("Hi")
url = await gemini.share(res['conversation_id'], res['response_id'], res['choice_id'], res['req_id'], res['fsid'], title="test by me")
print(url)
FAQs
The python package that returns Response of Google Gemini through Cookies.
We found that geminikit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.