Skip to content

Commit

Permalink
With great power comes great responsibility
Browse files Browse the repository at this point in the history
The africana-framework is a software designed for network & web hacking by automating as much stuff as possible to detect vulnerabilities on most common services and web technologies. It also has some wide range of penetration testing from internal network, Wi-Fi, system anonymity to web bug hunting. It's purely written for Good and not Evil
  • Loading branch information
r0jahsm0ntar1 committed Apr 20, 2024
1 parent 3b9b085 commit 362f8a4
Show file tree
Hide file tree
Showing 514 changed files with 6,434 additions and 481 deletions.
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ tqdm
flask
regex
numpy
scapy
updog
pycurl
ipaddr
flake8
py3DNS
Expand All @@ -27,7 +29,6 @@ urllib3
netaddr
PySocks
ipython
readline
paramiko
rgbprint
requests
Expand All @@ -44,7 +45,9 @@ GitPython
ansi2html
validators
SQLAlchemy
gnureadline
prettytable
pyreadline3
pycryptodome
humanfriendly
python-libnmap
Expand Down
7 changes: 6 additions & 1 deletion source/africana.go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ module main.go

replace bcolors => ./bcolors

replace internals => ./scanners

go 1.21.6

require bcolors v0.0.0-00010101000000-000000000000 // indirect
require (
bcolors v0.0.0-00010101000000-000000000000 // indirect
internals v0.0.0-00010101000000-000000000000 // indirect
)
Binary file added source/africana.go/main
Binary file not shown.
122 changes: 42 additions & 80 deletions source/africana.go/main.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
package main

import(
import (
"os"
"fmt"
"bufio"
"os/exec"
"syscall"
"strings"
"bcolors"
"internals/RunNmap"
)

func banner() {
func main() {
screenClear(); printBanner()
scanner := bufio.NewScanner(os.Stdin)
for {
printMenu()
fmt.Print("Enter your choice: ")
scanner.Scan()
userInput := scanner.Text()

switch strings.ToLower(userInput) {
case "1":
screenClear(); RunNmap()
case "2":
screenClear(); runDnsRecon()
case "3":
runBoth()
case "0":
screenClear(); exitBanner()
return
default:
fmt.Println("Invalid choice. Please select 'nmap', 'dnsrecon', 'both', or 'exit'.")
}
}
}

func printBanner() {
fmt.Println(bcolors.BLUE + ` _,._ ` + bcolors.ENDC)
fmt.Println(bcolors.BLUE + ` __.' _) ` + bcolors.ENDC)
fmt.Println(bcolors.BLUE + ` <_,)'.-'a\ ` + bcolors.ENDC)
Expand All @@ -28,7 +55,7 @@ func banner() {
fmt.Println(" \n")
}

func exit() {
func exitBanner() {
fmt.Print(`
_,.---.---.---.--.._
_.-' '--.'---.'---'-. _,'--.._
Expand All @@ -52,7 +79,7 @@ func exit() {
fmt.Println(bcolors.GREEN + " Man Of God. \n" + bcolors.ENDC)
}

func menu() {
func printMenu() {
fmt.Println(bcolors.RED + bcolors.BOLD +" ~>[ Choose what to do from the menu below ]<~ \n" + bcolors.ENDC)
fmt.Println(bcolors.BLUE + "[ 1. Port Scanning 6. Start Nikto Scaning ]" + bcolors.ENDC)
fmt.Println(bcolors.BLUE + "[ 2. Dns Reconning 7. Fero File Searching ]" + bcolors.ENDC)
Expand All @@ -61,82 +88,17 @@ func menu() {
fmt.Println(bcolors.BLUE + "[ 5. Nuclei Vuln Scanning 0. Exit Africana Tool ]\n" + bcolors.ENDC)
}

func clear() {
Cmd := exec.Command("clear")
Out, err := Cmd.Output()
if err != nil {
panic(err)
}
fmt.Println(string(Out))
_, err = exec.Command("clear").Output()
if err != nil {
switch e := err.(type) {
case *exec.Error:
fmt.Println("failed executing:", err)
case *exec.ExitError:
fmt.Println("command exit rc =", e.ExitCode())
default:
panic(err)
}
func screenClear() {
cmd := exec.Command("clear")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Println("Error running creenClear:", err)
}
}

func nmap() {
binary, lookErr := exec.LookPath("nmap")
if lookErr != nil {
panic(lookErr)
}
var host string
fmt.Print(bcolors.GREEN + "(" + bcolors.ENDC + "africana:" + bcolors.DARKCYAN + "framework" + bcolors.RED + " type > host" + bcolors.GREEN + ")# " + bcolors.ENDC)
fmt.Scan(&host)
args := []string{"nmap", "-p-", "-vv", host}
env := os.Environ()
execErr:= syscall.Exec(binary, args, env)
if execErr != nil {
panic(execErr)
}
}

func dnsr() {
binary, lookErr := exec.LookPath("dnsrecon")
if lookErr != nil {
panic(lookErr)
}
var host string
fmt.Print(bcolors.GREEN + "(" + bcolors.ENDC + "africana:" + bcolors.DARKCYAN + "framework" + bcolors.RED + " type > host" + bcolors.GREEN + ")# " + bcolors.ENDC)
fmt.Scan(&host)
args := []string{"dnsrecon", "-a", "-d", host}
env := os.Environ()
execErr:= syscall.Exec(binary, args, env)
if execErr != nil {
panic(execErr)
}
}

func africs() {
clear()
banner()
menu()
var choice string
fmt.Print(bcolors.GREEN + "(" + bcolors.ENDC + "africana:" + bcolors.DARKCYAN + "framework" + bcolors.GREEN + ")# " + bcolors.ENDC)
fmt.Scan(&choice)
switch choice {
case "1":
draw := func() {
main()
}
fmt.Print("\n"); nmap()
draw()
case "2":
fmt.Print("\n"); dnsr(); africs()
case "0":
clear(); exit()
break
default:
fmt.Println(bcolors.ENDC + " ~{ " + bcolors.RED + "Poor choice of selection!. Please select int -> " + bcolors.DARKCYAN + " from 0. to 9. " + bcolors.ENDC + "}~" + bcolors.ENDC)
}
}

func main() {
africs()
func runBoth() {
fmt.Println("Running both nmap and dnsrecon...")
runNmap()
runDnsRecon()
}
3 changes: 3 additions & 0 deletions source/africana.go/scanners/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module colors.go

go 1.21.6
28 changes: 28 additions & 0 deletions source/africana.go/scanners/internals.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package internals

import (
"os"
"fmt"
"bcolors"
"os/exec"
)

func runNmap() {
fmt.Println(bcolors.GREEN + "Running nmap..." + bcolors.ENDC)
cmd := exec.Command("nmap", "-p-", "-v", "localhost")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Println("Error running nmap:", err)
}
}

func runDnsRecon() {
fmt.Println(bcolors.GREEN + "Running dnsrecon..." + bcolors.ENDC)
cmd := exec.Command("dnsrecon", "-d", "example.com")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err := cmd.Run(); err != nil {
fmt.Println("Error running dnsrecon:", err)
}
}
4 changes: 4 additions & 0 deletions src/core/bcolors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import os
import random
try:
from rgbprint import gradient_print
except:
pass

def check_os():
if os.name == "nt":
Expand Down
Loading

0 comments on commit 362f8a4

Please sign in to comment.