Skip to content

Commit

Permalink
combine with FBI bug inject
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Aug 27, 2024
1 parent 37c65ed commit 3ed34ae
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions tools/fbi/src/find_bug_inj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ extern "C" {
#include "lava_version.h"
#include <odb/pgsql/database.hxx>
#include <odb/session.hxx>
#include <cstdlib>

#define CBNO_TCN_BIT 0
#define CBNO_CRD_BIT 1
Expand Down Expand Up @@ -1006,7 +1007,7 @@ int main (int argc, char **argv) {
if (curtail == 0) { // Will be 0 unless specified on command line
if (!project["curtail_fbi"].isUInt()) {
curtail = 0;
}else{
} else{
// null should never happen, if it does we'll violate an assert in the asUInt
curtail = std::strtoul(project.get("curtail_fbi", Json::Value::null).asString().c_str(), 0, 0);
}
Expand All @@ -1016,8 +1017,31 @@ int main (int argc, char **argv) {
inputfile = std::string(argv[4]);

std::string db_name = project["db"].asString() + host.get("db_suffix", "").asString();
db.reset(new odb::pgsql::database("postgres", "postgrespostgres",
db_name, "localhost"));

const char* pgpass = std::getenv("PGPASS");
const char* pguser = std::getenv("PGUSER");
if (pgpass) {
// PGPASS environment variable is set, and pgpass points to its value.
std::cout << "PGPASS IS SET" << std::endl;
} else {
// PGPASS environment variable is not set.
std::cout << "PGPASS is not set" << std::endl;
exit(1);
}

if (pguser) {
// PGUSER environment variable is set, and pgpass points to its value.
std::cout << "PGUSER IS SET: " << pguser << std::endl;
} else {
// PGUSER environment variable is not set.
std::cout << "PGUSER is not set" << std::endl;
exit(1);
}

std::string DBHost("database");
int DBPort = 5432;
db.reset(new odb::pgsql::database(pguser, pgpass,
db_name, DBHost, DBPort));
/*
re-read pandalog, this time focusing on taint queries. Look for
dead available data, attack points, and thus bug injection oppotunities
Expand Down

0 comments on commit 3ed34ae

Please sign in to comment.