Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade /install script to use gcc 10 and libgcc 10 #2241

Closed
stuxnet8t8 opened this issue Dec 9, 2021 · 10 comments
Closed

Upgrade /install script to use gcc 10 and libgcc 10 #2241

stuxnet8t8 opened this issue Dec 9, 2021 · 10 comments
Assignees
Labels

Comments

@stuxnet8t8
Copy link

I've tried everything I can think of, I've done apt-get update && upgrade, I've tried apt cache search, nothing, I've uninstalled and reinstalled, I have no idea.

Please help me

@bcoles
Copy link
Collaborator

bcoles commented Dec 9, 2021

Libgcc-9-dev has no installation candidate

Presumably you're seeing this error when running the ./install script ?

gcc9 is kind of old now. I don't remember why BeEF needs it. The version shouldn't matter.

It should be safe to simply install gcc10 instead of gcc9.

@bcoles
Copy link
Collaborator

bcoles commented Dec 9, 2021

I'm guessing you're using Kali or Debian. The following patch to the install script replaces gcc-9* with gcc-10 and may resolve your issue.

diff --git a/install b/install
index 3b52fdc1..c28b6a69 100755
--- a/install
+++ b/install
@@ -106,7 +106,7 @@ install_linux () {
   info "Installing ${Distro} prerequisite packages..."
   if [ "${Distro}" = "Debian" ] || [ "${Distro}" = "Kali" ]; then
     sudo apt-get update
-    sudo apt-get install curl git build-essential openssl libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison nodejs libcurl4-openssl-dev gcc-9-base libgcc-9-dev
+    sudo apt-get install curl git build-essential openssl libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison nodejs libcurl4-openssl-dev gcc-10-base libgcc-10-dev
     if command_exists rvm || command_exists rbenv version; then
       info "Ruby package Manager exists - Ruby install skipped"
     else

@bcoles bcoles added the Install label Dec 9, 2021
@stuxnet8t8
Copy link
Author

So do I just run that as is or do I need to insert it into the actual code?

@bcoles
Copy link
Collaborator

bcoles commented Dec 9, 2021

@DeezyE why was gcc-9-base libgcc-9-dev added to the install script in #1940 ?

@bcoles
Copy link
Collaborator

bcoles commented Dec 9, 2021

So do I just run that as is or do I need to insert it into the actual code?

It is a patch. - means remove. + means add. Red means bad. Green means good. Remove the bad stuff. Add the good stuff.

The patch simply replaces gcc-9 with gcc-10.

You can manually replace every instance of gcc-9 with gcc-10 in the install file using a text editor.

You can automatically replace every instance of gcc-9 with gcc-10 in the install file using sed: sed -i 's/gcc-9/gcc-10/g' install.

Or, if you're using BeEF from the git repository you can apply the patch manually by pasting the above diff into a file (ie, patch.diff) and applying the patch with git apply patch.diff.

@stuxnet8t8
Copy link
Author

Excellent, thanks, friend. I'll give it a bash when I get home.

@stuxnet8t8
Copy link
Author

Worked like a charm, thanks buddy.

@DeezyE
Copy link
Contributor

DeezyE commented Dec 22, 2021

Good find.
Replacing gcc9 with 10 makes sense and we can update the install script as you've posted @bcoles.
I will change the name of this issue to reflect needed change

I'm guessing you're using Kali or Debian. The following patch to the install script replaces gcc-9* with gcc-10 and may resolve your issue.

diff --git a/install b/install
index 3b52fdc1..c28b6a69 100755
--- a/install
+++ b/install
@@ -106,7 +106,7 @@ install_linux () {
   info "Installing ${Distro} prerequisite packages..."
   if [ "${Distro}" = "Debian" ] || [ "${Distro}" = "Kali" ]; then
     sudo apt-get update
-    sudo apt-get install curl git build-essential openssl libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison nodejs libcurl4-openssl-dev gcc-9-base libgcc-9-dev
+    sudo apt-get install curl git build-essential openssl libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison nodejs libcurl4-openssl-dev gcc-10-base libgcc-10-dev
     if command_exists rvm || command_exists rbenv version; then
       info "Ruby package Manager exists - Ruby install skipped"
     else

@DeezyE DeezyE changed the title Libgcc-9-dev has no installation candidate HELP Upgrade /install script to use gcc 10 and libgcc 10 Dec 22, 2021
@bcoles
Copy link
Collaborator

bcoles commented Dec 22, 2021

#2241 (comment)

@DeezyE
Copy link
Contributor

DeezyE commented Dec 22, 2021

Libgcc-9-dev has no installation candidate

Presumably you're seeing this error when running the ./install script ?

gcc9 is kind of old now. I don't remember why BeEF needs it. The version shouldn't matter.

It should be safe to simply install gcc10 instead of gcc9.

I am confirming this is even needed. I added it 2 years ago, but might be moot today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants