Skip to content

Commit 0363f6e

Browse files
cpfsec
1 parent 4182c7e commit 0363f6e

File tree

3 files changed

+45
-10
lines changed

3 files changed

+45
-10
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# cfpsec
22
CFPsec is program to list Call For Papers or upcoming Hacking/Security Conferences based on cfptime.org website.
33

4-
[<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/alexandreborges/cfpsec?color=Red&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/releases/tag/1.4) [<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/alexandreborges/cfpsec?color=Yellow&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/releases) [<img alt="GitHub Release Date" src="https://img.shields.io/github/release-date/alexandreborges/cfpsec?label=Release%20Date&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/releases) [<img alt="GitHub" src="https://img.shields.io/github/license/alexandreborges/cfpsec?style=for-the-badge">](https://github.com/alexandreborges/cfpsec/blob/master/LICENSE)
4+
[<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/alexandreborges/cfpsec?color=Red&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/releases/tag/1.5) [<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/alexandreborges/cfpsec?color=Yellow&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/releases) [<img alt="GitHub Release Date" src="https://img.shields.io/github/release-date/alexandreborges/cfpsec?label=Release%20Date&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/releases) [<img alt="GitHub" src="https://img.shields.io/github/license/alexandreborges/cfpsec?style=for-the-badge">](https://github.com/alexandreborges/cfpsec/blob/master/LICENSE)
55
[<img alt="GitHub stars" src="https://img.shields.io/github/stars/alexandreborges/cfpsec?logoColor=Red&style=for-the-badge">](https://github.com/alexandreborges/cfpsec/stargazers) [<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/ale_sp_brazil?color=blueviolet&style=for-the-badge">](https://twitter.com/ale_sp_brazil)
66

77
![Alt text](pictures/picture_1.jpg?raw=true "Title")
@@ -21,7 +21,7 @@ CFPsec is program to list Call For Papers or upcoming Hacking/Security Conferenc
2121

2222
See GNU Public License on <http://www.gnu.org/licenses/>.
2323
24-
### Current Version: 1.4
24+
### Current Version: 1.5
2525

2626
CFPsec has been tested on Ubuntu and Windows 11. Likely, it also works on other
2727
operating systems. Before using CFPsec, execute:
@@ -49,6 +49,12 @@ To use the CFPsec, execute the command as shown below:
4949
### HISTORY
5050

5151

52+
Version 1.5:
53+
54+
This version:
55+
56+
* Fixes the --cfp option to reflect a structural change on the cfptime.org.
57+
5258
Version 1.4:
5359

5460
This version:

cfpsec/cfpsec.py

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,21 @@
1818
import argparse
1919
import requests
2020
import json
21+
import re
22+
from urllib.parse import urljoin
2123
from colorama import init, Fore, Style
2224

2325
__author__ = "Alexandre Borges"
2426
__copyright__ = "Copyright 2025, Alexandre Borges"
2527
__license__ = "GNU General Public License v3.0"
26-
__version__ = "1.4"
28+
__version__ = "1.5"
2729
__email__ = "reverseexploit@proton.me"
2830

2931
# Constants
30-
CFP_URL = 'https://api.cfptime.org/api/cfps/'
31-
UPCOMING_URL = 'https://api.cfptime.org/api/upcoming/'
32+
33+
ORIG_URL = 'https://api.cfptime.org'
34+
CFP_URL = 'https://api.cfptime.org/api/cfps'
35+
UPCOMING_URL = 'https://api.cfptime.org/api/upcoming'
3236

3337
# Colors
3438
COLORS = {
@@ -44,16 +48,41 @@
4448
"reset": Style.RESET_ALL
4549
}
4650

51+
4752
def fetch_data(url):
48-
"""Fetch data from the given URL."""
53+
session = requests.Session()
54+
55+
try:
56+
init_response = session.get(ORIG_URL)
57+
init_response.raise_for_status()
58+
except requests.RequestException as e:
59+
print(f"Error during initial request: {e}")
60+
sys.exit(1)
61+
62+
match = re.search(r'request\.headers\["X-CSRFToken"\]\s*=\s*"([^"]+)"', init_response.text)
63+
if not match:
64+
print("CSRF token not found in Swagger UI.")
65+
sys.exit(1)
66+
67+
csrf_token = match.group(1)
68+
69+
headers = {
70+
'Accept': 'application/json',
71+
'X-CSRFToken': csrf_token,
72+
'Referer': 'https://api.cfptime.org'
73+
}
74+
4975
try:
50-
response = requests.get(url)
76+
77+
full_url = urljoin(url + '/', '?format=json')
78+
response = session.get(full_url, headers=headers)
5179
response.raise_for_status()
5280
return response.json()
5381
except requests.RequestException as e:
54-
print(COLORS["lightred"] + f"Error fetching data: {e}" + COLORS["reset"])
82+
print(f"Error fetching data: {e}")
5583
sys.exit(1)
5684

85+
5786
def display_data(data, fields, headers):
5887
"""Display data in a formatted table with tabs between columns."""
5988
print(COLORS["reset"] + "\n" + headers)
@@ -82,7 +111,7 @@ def cfplist():
82111
]
83112
headers = (
84113
"Conference Name".ljust(35) + "\t" +
85-
"CFP End".ljust(12) + "\t" +
114+
"CFP End".ljust(15) + "\t" +
86115
"Conf Start".ljust(10) + "\t" +
87116
"City".ljust(16) + "\t" +
88117
"Twitter".ljust(18) + "\t" +

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name="cfpsec",
12-
version="1.4",
12+
version="1.5",
1313
author="Alexandre Borges",
1414
author_email="reverseexploit@proton.me",
1515
license="GNU GPL v3.0",

0 commit comments

Comments
 (0)