Skip to content

Instantly share code, notes, and snippets.

@anon767
anon767 / cvefixes.py
Created December 12, 2023 12:01
Extract cvefixes samples
import pandas as pd
import sqlite3 as lite
from sqlite3 import Error
from pathlib import Path
from datetime import date
import numpy as np
import requests
import difflib as diff
import re
import csv
@anon767
anon767 / codet5p.py
Created November 29, 2023 17:54
CodeT5p vuln inference
import argparse
import torch
import transformers
C_SAMPLE = """#include <iostream>
using namespace std;
#define MAXSIZE 40
@anon767
anon767 / securewoof.js
Last active October 30, 2023 17:37
API Call to securewoof
<html>
<input id="fileupload" name="fileupload" type="file" value="" />
</html>
async function uploadFile() {
let formData = new FormData();
formData.append("file", fileupload.files[0]);
const response = await fetch('https://antivir.securewoof.com', {
method: "POST",
body: formData
});
@anon767
anon767 / compile_and_clang.py
Last active September 8, 2023 09:57
VulTrigger
import os
import glob
from pydriller import Repository, Git
from unidiff import PatchSet
import subprocess
REPOS = {"Augeas": "https://github.com/hercules-team/augeas", "BitlBee": "https://github.com/bitlbee/bitlbee", "Cantata": "https://github.com/CDrummond/cantata", "ImageMagick": "https://github.com/ImageMagick/ImageMagick"
,"JPEGSnoop": "https://github.com/ImpulseAdventure/JPEGsnoop", "JasPer": "https://github.com/jasper-software/jasper", "LibRaw": "https://github.com/LibRaw/LibRaw", "PHP": "https://github.com/php/php-src", "WavPack": "https://github.com/dbry/WavPack",
"Ceph": "https://github.com/ceph/ceph", "FFmpeg": "https://github.com/FFmpeg/FFmpeg", "file":"https://github.com/file/file", "freetype2":"https://github.com/aseprite/freetype2", "libgd": "https://github.com/libgd/libgd", "libpng": "https://github.com/glennrp/libpng",
"libsndfile": "https://github.com/libsndfile/libsndfile", "libtiff":"https://github.com/libsdl-org/libtiff", "libxml2": "https://github.com/GNOME/li
@anon767
anon767 / README.md
Last active May 26, 2023 17:30
Classify function and lines with LineVul

How to use?

  • Clone LineVul
  • Download model like explained in their Repo
  • Place classify.py in the LineVul/linevul folder
  • Run it for example with:
 python3 classify.py \
 --input test.c --model_name=12heads_linevul_model.bin \
@anon767
anon767 / README.md
Last active May 17, 2023 14:31
sample

Task

  1. sample.c contains a vulnerability. Why is this a vulnerability and which line is causing the flaw?
  2. Check out https://github.com/awsm-research/LineVul/tree/main/linevul LineVul is a vulnerability discovery model which uses a BERT-like transformer model and attention scores to calculate relevance scores. The relevance scores denote how likely it is for each line to contribute to a vulnerability. Can you tell which 3 lines of sample.c score top given the prediction of LineVul?
/*
* [The "BSD license"]
* Copyright (c) 2010 Terence Parr
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
3.1.0 ffmpeg_methods 5464 4968 430486
51 739f8d28d0e9a704facec711e2d657c7 dd2dcf7e52ce4abd23d61fd00e0002d4 503269070ce19d5ef2745ee631fad56e ca49f824f4f7356fddabfe1387440889 dcd8f9f23dce88503db2b74bc301a87c 9acffd7039df24f65e1bc9b958ea3c4c
52 4d17d5a83da10b30717f5338d2e3a130 e705b1ea92b73b8e44f5dc9c62cc70f5 1b8f8cf3f6c2c52853585549715822c6 5a27eba6e90dde02ab5864d9054f549a 79430fb9fa76a713409a83abb3511da2
53 54430577d8c851d4a778fb5bb5ab8520 2e22b5863119dccdb0f287612aab9e1d b59c5b4e7730fe195ee9382d02a0470b c5f47843d04fd1347a88fbe8379a45ae e8550cbca4db2e176c2d648f6d26e5a2 b32dad21d28c571220ab20d743faba10 2938c04c3dbf26aa6a40cdb07b0484a1 3d3636bd248babd6f3c354a215e14283
54 d5bc865db50d1b29072451ce329724f3
55 c0cb251c993c2e6606db74819b4eb827 de74247435c851921c7e30e9546fe6ee 8b309398e3a44610b111044ca9890a0f a83b6ff0d5935b9fb95daafff7154ffb 3b89b058d66bbe64a1aac3af67d1ee63 7bbb07c5b9dcabbf96cbd733d739bfc1 62a75c100fc4f276430aea1243223687 f88746e6248000b0dbac08cf40c5cc28
56 90390873e1aebda042ac0b7f32efe3e2 e9226c
@anon767
anon767 / formatted.c
Last active October 16, 2022 15:51
Compiler Output Tests
#include <stdio.h>
#define f(f, g) \
{ \
z e = 0; \
for (; e < f; e++) \
g; \
}
#define i(f, g) \
static z f(z a) { return g; }
#define j(f, g) \
@anon767
anon767 / cobfuscator.py
Last active October 16, 2022 12:29
Reproduce Antivir Fuzzing
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Overxfl0w13 - 2015 - https://github.com/overxfl0w - #
# For anything -> https://github.com/overxfl0w/CObfuscator #
import re
import sys
from random import randint