Skip to content

GetCyber

Dan & Tamara

  • ALL
  • KALI
  • DEBIAN
  • WEB
  • MORE
    • MACOS
    • WINDOWS
    • QUICK HACKS
    • BLOGS
  • 📺 YOUTUBE VIDEOS
  • 🤓 ABOUT
    • 🗓️ EVENTS
    • 📩 CONTACT

- Live Fri & Sat on YouTube!

Recent Posts

  • Manipulating and Filtering Content in LinuxMarch 2, 2023
  • Appointment – Starting Point – Hack The Box // Walkthrough & SolutionFebruary 28, 2023
  • Sequel – Starting Point – Hack The Box // Walkthrough & SolutionFebruary 28, 2023
  • Crocodile – Starting Point – Hack The Box // Walkthrough & SolutionFebruary 28, 2023
  • Exposed: The Insidious Linux Backdoors You Never Knew ExistedFebruary 25, 2023
NEWSLETTER SIGN UP!

Recent Comments

  1. Benimaru on PIECE of cake – Install Metasploitable 2 on VirtualBoxJune 3, 2023

    Metasploitable.vmdk file is not listing in the storage tab. There is only one parent tab called "Controller:SATA" inside which two…

  2. Lauren Jones on Installing Kali Linux on Android using NetHunter and TermuxMay 26, 2023

    You're getting a "Permission denied" error because you're trying to execute a file that does not have execution permissions. The…

  3. Shadow on Installing Kali Linux on Android using NetHunter and TermuxMay 21, 2023

    Hello. I found Dan (the man) Duran while having an issue with kali on bare metal having a connectivity issue.…

  4. Shadow on Installing Kali Linux on Android using NetHunter and TermuxMay 21, 2023

    Hello. I found Dan (the man) Duran while having an issue with kali on bare metal having a connectivity issue.…

  5. Muhammad Asif on Why is my Kali Linux not connecting to Wi-Fi? 😱 // 100% Problem FIXED!May 6, 2023

    Hey Mate. I am a bigger in Kali Linix console. I am using MacBook pro. Downloaded and running fine via…

Archives

  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • August 2022
  • June 2022
  • April 2022
  • March 2022
  • November 2021
  • October 2021

How to fix “su : must be run from a terminal”?

Posted on February 3, 2023 - February 3, 2023 by Dan Duran

I recently pawned a web server on a pentest I was doing. I was able to upload and execute a PHP reverse shell script that gave me a shell. The issue was that it would run as the www-data user, and when I tried to su to root, I got the following error:

“su : must be run from a terminal”

How do you fix that? No worries, here’s a solution using python. Simply execute the following commands from your shell if you have Python installed:

Copy Code Copied Use a different Browser

echo "import pty; pty.spawn('/bin/bash')" > /tmp/qwerty.py

After you do that, just apply the command:

Copy Code Copied Use a different Browser

python /tmp/qwerty.py

Basically, what you are doing here is spawning bin/bash into a python executable file inside the tmp folder. Then just run the program using python and voila!

I hope this helps. Cheers!

Dan D.

 

Posted in DEBIAN LINUX, FEATURED, KALI LINUX, KNOWLEDGE BASE, QUICK HACKS

Post navigation

Hive Ransomware Taken Down in FBI’s Hacking Operative
Meow – Starting Point – Hack The Box // Walkthrough & Solution

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright ©2023 GetCyber

Click to Copy