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

username updates and cleanup #17

Merged
merged 10 commits into from
Apr 12, 2022
Merged

username updates and cleanup #17

merged 10 commits into from
Apr 12, 2022

Conversation

stuartjash
Copy link
Contributor

No description provided.

@@ -16,7 +16,11 @@ class TCC: ArtifactsModule {
}

func getTCC() {
let fileURL = try! filemanager.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appendingPathComponent("com.apple.TCC/TCC.db")
let username = getUsersOnSystem()
let local_name = username[0].username
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is going back to the approach of only focusing on one user on the system right? Don't you want to do this more like you did with ShellHistoryAndProfiles where you're checking each users personal directory to see if these files exist? That way we account for every artifact for each user on the system

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would look for whatever user is logged in, running the aftermath application. My thought was we probably wouldn't be scanning all profiles on said system, but that does make sense. I'll make the fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed an update to fix this

let newFileName = "\(user.username)_\(filename)"
self.copyFileToCase(fileToCopy: path, toLocation: self.profilesDir, newFileName: newFileName)
}
} else { continue }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these continue's performing any additional function that I don't know about?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they break that current iteration of the for loop

aftermath/Module.swift Show resolved Hide resolved
for user in getBasicUsersOnSystem() {

var fileURL: URL
if filemanager.fileExists(atPath: "\(user.homedir)/Library/Application Support/com.apple.TCC/TCC.db") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep this cleaner

let tcc_path = "\(user.homedir)/Library/Application Support/com.apple.TCC/TCC.db"
if filemanager.fileExists(atPath: tcc_path) {...

@@ -6,6 +6,7 @@
//

import Foundation
import CoreData
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed?

authValue = String(describing: item)
while sqlite3_step(queryStatement) == SQLITE_ROW {
let col1 = sqlite3_column_text(queryStatement, 0)
if col1 != nil{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can clean all of these up by using

                    if let col1 = col1 {
                        client = String(cString: col1)
                    }

This is the more standard way to do it in swift that way you're not force unwrapping with client = String(cString: col1!)

If you would prefer to do all of this in a separate PR that's fine. I know you have a lot of sql statements

@stuartjash stuartjash merged commit e86602f into master Apr 12, 2022
@stuartjash stuartjash deleted the FixUsernames branch October 5, 2022 14:26
jbradley89 pushed a commit that referenced this pull request Mar 8, 2024
added slack to personal info disable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants