Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
简单快速的使用mysql
软件架构说明
pip3 install fastmysql
pip3 install fastmysql -i https://mirrors.aliyun.com/pypi/simple
import fastmysql
query_res = fastmysql.query_table_all_data(
db_name='test',
tb_name='test'
)
# 获取建表语句
res = fastmysql.show_create_table(
db_name='test',
tb_name='test'
)
cursor.execute('insert into user (name,password) value (?,?)',(name,password)) 或者
cursor.execute('insert into user (name,password) value (%s,%s)',(name,password)) %s与?都可以作为sql语句的占位符,它们作为占位符的功能是没有区别的,mysql.connector用 %s 作为占位符;pymysql用 ? 作为占位符。但是注意不要写成
cursor.execute('insert into user (name,password) value (?,?)'%(name,password)) 这种写法是直接将参数拼接到sql语句中,这样数据库就容易被sql注入攻击,比如
cursor.execute('select * from user where user=%s and password=%s'%(name,password)) 要是name和password都等于'a or 1=1',那么这个语句会把整个user表都查询出来
FAQs
make it easy to use pymysql
We found that fastmysql 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.