Skip to content

Instantly share code, notes, and snippets.

View zaghaghi's full-sized avatar

HamZag zaghaghi

  • Sweden, Stockholm
  • 20:05 (UTC +02:00)
View GitHub Profile

Setup sniproxy [SERVER]

Change DNSs [CLIENT]

  • /etc/hosts (replace x.x.x.x with server ip)
  • or whatever dns solution you like
from flask import request, abort, Response
from functools import wraps
def _realy_check_role_is_ok(roles, methods):
# all conditions will be checked here.
return True
def check_role(roles, methods):
def inner_function(function):
@wraps(function)
* https://github.com/eleurent/highway-env
* https://github.com/mpSchrader/gym-sokoban
* https://github.com/maximecb/gym-minigrid
* https://github.com/Unity-Technologies/obstacle-tower-env
* https://github.com/google-research/football
@zaghaghi
zaghaghi / node.01.py
Created November 26, 2019 20:50
Node Class
class Node:
def __init__(self, input_nodes=[]):
# گره‌هایی که مقدار به این گره ارسال می‌کنند
self.input_nodes = input_nodes
# گره‌هایی که این نود به آن‌ها مقدار ارسال می‌کند
self.output_nodes = []
# این گره را به عنوان گره خروجی تمامی گره‌های ورودی اضافه می‌کنیم
for n in self.input_nodes:
n.output_nodes.append(self)
@zaghaghi
zaghaghi / query.graphql
Created May 10, 2019 06:30
Get by Product
query {
ProductVersion(filter: {product: {name: "urllib3"}, version_value: "1.24.2"}) {
name
version_value
cves {
name
cvss3 {
name
base_severity
}
@zaghaghi
zaghaghi / query.graphql
Last active May 10, 2019 06:26
Get by Product
query {
ProductVersion(filter: {product: {name: "python"}, version_value: "2.7.16"}) {
name
version_value
cves {
name
cvss3 {
name
base_severity
}
@zaghaghi
zaghaghi / query.graphql
Last active May 10, 2019 06:26
Get By CVE ID
query {
CVE(name: "CVE-2019-9977") {
name
description
cvss2 {
name
severity
}
cvss3 {
name
w.name w.title w.affected_resources
CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer ::Memory::
CWE-134 Use of Externally-Controlled Format String ::Memory::
CWE-415 Double Free ::Memory::
CWE-416 Use After Free ::Memory::
CWE-129 Improper Validation of Array Index ::Memory::
CWE-14 Compiler Removal of Code to Clear Buffers ::Memory::
CWE-120 Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') ::Memory::
CWE-122 Heap-based Buffer Overflow ::Memory::
CWE-226 Sensitive Information Uncleared Before Release ::Memory::
MATCH (n:CVE {name: 'CVE-2019-9977'}), (n)-->(w:CWE), (n)-->(c2:CVSS2), (n)-->(c3:CVSS3), (n)-->(v:ProductVersion)-->(p:Product) RETURN n, w, c2, c3, v, p
{
"cve" : {
"data_type" : "CVE",
"data_format" : "MITRE",
"data_version" : "4.0",
"CVE_data_meta" : {
"ID" : "CVE-2019-0240",
"ASSIGNER" : "[email protected]"
},
"affects" : {