(define-module (chur exploit)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system trivial)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages python)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages tor))

(define-public sqlmap
  (package
    (name "sqlmap")
    (version "1.4.5")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/sqlmapproject/sqlmap.git")
                    (commit "3c93872d53e21fd3a15a0ebb7b2cc8bb6ed2fa7f")))
              (sha256
               (base32 "1v1v2dsawi1piid4787w35zn9sxpbdik944jkf44c6r9wisysgfy"))))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
         (use-modules (guix build utils))
         (let* ((src (assoc-ref %build-inputs "source"))
                (out (assoc-ref %outputs "out"))
                (bin (string-append out "/bin"))
                (bash (string-append (assoc-ref %build-inputs "bash") "/bin/bash"))
                (py (string-append (assoc-ref %build-inputs "python") "/bin/python3")))
           (mkdir-p bin)
           (copy-recursively src out)
           (with-directory-excursion bin
             (call-with-output-file "sqlmap"
               (lambda (p)
                 (format p "#!~a
exec ~a ~a/sqlmap.py \"$@\"" bash py out)))
             (chmod "sqlmap" #o555)
             #t)))))
    (inputs `(("python" ,python)
              ("bash" ,bash)
              ("openssl" ,openssl)))
    (synopsis "Automatic SQL injection and database takeover tool")
    (description "sqlmap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester, and a broad range of switches including database fingerprinting, over data fetching from the database, accessing the underlying file system, and executing commands on the operating system via out-of-band connections.")
    (home-page "http://sqlmap.org")
    (license license:gpl2)))

(define-public instashell
  (package
    (name "instashell")
    (version "1.5.4")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/thelinuxchoice/instashell.git")
                    (commit "49b6b4fa9b4eedfc0df0279a3d65e3263c66b57d")))
              (sha256
               (base32 "0z6nqimic7awcscsmpc661163rm1klrcd35cidiw538ci7ykp6a6"))))
    (build-system trivial-build-system)
    (arguments
     `(#:modules ((guix build utils))
       #:builder
       (begin
         (use-modules (guix build utils))
         (let* ((src (assoc-ref %build-inputs "source"))
                (out (assoc-ref %outputs "out"))
                (bin (string-append out "/sbin"))
                (bin-bash (string-append (assoc-ref %build-inputs "bash") "/bin/bash")))
           (mkdir-p bin)
           (copy-recursively src out)
           (with-directory-excursion bin
             (call-with-output-file "instashell"
               (lambda (p)
                 (format p "#!~a
sudo bash ~a/instashell.sh $@" bin-bash out)))
             (chmod "instashell" #o555)
             #t)))))
    (inputs `(("bash" ,bash)
              ("curl" ,curl)
              ("openssl" ,openssl)
              ("tor" ,tor)))
    (synopsis "Multi-threaded Instagram Brute Forcer without password limit")
    (description "Instashell is an Shell Script to perform multi-threaded brute force attack against Instagram, this script can bypass login limiting and it can test infinite number of passwords with a rate of +400 passwords/min using 20 threads.")
    (home-page "https://github.com/thelinuxchoice/instashell")
    (license license:gpl3)))
