Skip to content

Commit 985d740

Browse files
committed
Removed helper files
1 parent be0ff19 commit 985d740

File tree

9 files changed

+16
-2372
lines changed

9 files changed

+16
-2372
lines changed

‎config/best1050.txt‎

Lines changed: 0 additions & 1049 deletions
This file was deleted.

‎config/credentials.csv‎

Lines changed: 0 additions & 1001 deletions
This file was deleted.

‎src/hackingBuddyGPT/usecases/web_api_testing/confusion_matrix_generator.py‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎src/hackingBuddyGPT/usecases/web_api_testing/documentation/diagram_plotter.py‎

Lines changed: 0 additions & 219 deletions
This file was deleted.

‎src/hackingBuddyGPT/usecases/web_api_testing/prompt_generation/information/pentesting_information.py‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ def __init__(self, openapi_spec_parser: OpenAPISpecificationParser, config) -> N
4242
self.password = self.faker.password()
4343
self.available_numbers = []
4444
self.config = config
45-
self.df = pandas.read_csv(self.get_file(self.config.get("csv_file"))[0], names=["username", "password"])
45+
file = self.get_file(self.config.get("csv_file"))
46+
if file == "Not found":
47+
self.df = pandas.DataFrame()
48+
else:
49+
self.df = pandas.read_csv(file[0], names=["username", "password"])
4650

4751
# Parse endpoints and their categorization from the given parser instance
4852
categorized_endpoints = openapi_spec_parser.classify_endpoints(self.config.get("name"))
@@ -1408,7 +1412,11 @@ def create_account(self, login_schema, login_path):
14081412
return account
14091413

14101414
def assign_brute_force_endpoints(self, admin):
1411-
password_list_path = self.get_file(self.config.get("password_file"))[0]
1415+
file = self.config.get("password_file")
1416+
if file == "Not found":
1417+
return
1418+
else:
1419+
password_list_path = self.get_file(file)[0]
14121420

14131421
# Open the password list file
14141422
with open(password_list_path, "r") as file:
@@ -3355,6 +3363,8 @@ def get_file(self, param):
33553363
# Search for file (glob is recursive-friendly)
33563364
file = glob.glob(os.path.join(parent_dir, param), recursive=True)
33573365

3366+
if not file or param == "":
3367+
return "Not found"
33583368
return file
33593369

33603370
def get_path_and_schema(self, login):

‎src/hackingBuddyGPT/usecases/web_api_testing/retrieve_spotify_token.py‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎src/hackingBuddyGPT/usecases/web_api_testing/utils/confusion_matrix_generator.py‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎tests/test_files/fakeapi_config.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"value"
2929
]
3030
},
31-
"password_file": "config/best1050.txt",
32-
"csv_file": "config/credentials.csv"
31+
"password_file": "",
32+
"csv_file": ""
3333
}

‎tests/test_files/test_config.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"/posts/{id}"
99
],
1010
"query_params": {},
11-
"password_file": "config/best1050.txt",
12-
"csv_file": "config/credentials.csv"
11+
"password_file": "",
12+
"csv_file": ""
1313
}

0 commit comments

Comments
 (0)